From dac245842714a0d1e521c60d1de71b4486c822cf Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 5 Aug 2019 21:24:58 +0200 Subject: [PATCH] [UX] Extend edge zones (#5181) See: https://github.com/koreader/koreader/pull/5179#discussion_r310676845 --- .../apps/reader/modules/readerfrontlight.lua | 12 ++++++------ frontend/apps/reader/modules/readergesture.lua | 18 +++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/frontend/apps/reader/modules/readerfrontlight.lua b/frontend/apps/reader/modules/readerfrontlight.lua index 5f83fcb64..0efc30983 100644 --- a/frontend/apps/reader/modules/readerfrontlight.lua +++ b/frontend/apps/reader/modules/readerfrontlight.lua @@ -71,14 +71,14 @@ function ReaderFrontLight:onChangeFlIntensity(ges, direction) local powerd = Device:getPowerDevice() local gestureScale if ges.direction == "south" or ges.direction == "north" then - gestureScale = Screen:getHeight() * 7/8 * 0.8 + gestureScale = Screen:getHeight() * 0.8 elseif ges.direction == "west" or ges.direction == "east" then - gestureScale = Screen:getWidth() * 7/8 * 0.8 + gestureScale = Screen:getWidth() * 0.8 else local width = Screen:getWidth() local height = Screen:getHeight() -- diagonal - gestureScale = math.sqrt(width * width + height * height) * 7/8 * 0.8 + gestureScale = math.sqrt(width * width + height * height) * 0.8 end if powerd.fl_intensity == nil then return false end @@ -130,14 +130,14 @@ function ReaderFrontLight:onChangeFlWarmth(ges, direction) local gestureScale if ges.direction == "south" or ges.direction == "north" then - gestureScale = Screen:getHeight() * 7/8 * 0.8 + gestureScale = Screen:getHeight() * 0.8 elseif ges.direction == "west" or ges.direction == "east" then - gestureScale = Screen:getWidth() * 7/8 * 0.8 + gestureScale = Screen:getWidth() * 0.8 else local width = Screen:getWidth() local height = Screen:getHeight() -- diagonal - gestureScale = math.sqrt(width * width + height * height) * 7/8 * 0.8 + gestureScale = math.sqrt(width * width + height * height) * 0.8 end local steps_tbl = {} diff --git a/frontend/apps/reader/modules/readergesture.lua b/frontend/apps/reader/modules/readergesture.lua index 86428540a..f8ed733aa 100644 --- a/frontend/apps/reader/modules/readergesture.lua +++ b/frontend/apps/reader/modules/readergesture.lua @@ -845,25 +845,25 @@ function ReaderGesture:setupGesture(ges, action) local direction, distance local zone_fullscreen = { - ratio_x = 0.0, ratio_y = 0, + ratio_x = 0, ratio_y = 0, ratio_w = 1, ratio_h = 1, } local zone_left_edge = { - ratio_x = 0, ratio_y = 1/8, - ratio_w = 1/8, ratio_h = 7/8, + ratio_x = 0, ratio_y = 0, + ratio_w = 1/8, ratio_h = 1, } local zone_right_edge = { - ratio_x = 7/8, ratio_y = 1/8, - ratio_w = 1/8, ratio_h = 7/8, + ratio_x = 7/8, ratio_y = 0, + ratio_w = 1/8, ratio_h = 1, } local zone_top_edge = { - ratio_x = 1/8, ratio_y = 0, - ratio_w = 7/8, ratio_h = 1/8, + ratio_x = 0, ratio_y = 0, + ratio_w = 1, ratio_h = 1/8, } local zone_bottom_edge = { - ratio_x = 1/8, ratio_y = 7/8, - ratio_w = 7/8, ratio_h = 1/8, + ratio_x = 0, ratio_y = 7/8, + ratio_w = 1, ratio_h = 1/8, } -- legacy global variable DTAP_ZONE_FLIPPING may still be defined in default.persistent.lua