mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Update readerfrontlight.lua
Frontlight decrease of sensitivity for two-fingered pan gesture
This commit is contained in:
@@ -11,8 +11,8 @@ local _ = require("gettext")
|
||||
|
||||
local ReaderFrontLight = InputContainer:new{
|
||||
steps = {0,1,1,1,1,2,2,2,3,4,5,6,7,8,9,10},
|
||||
gestureScale = Screen:getWidth() * FRONTLIGHT_SENSITIVITY_DECREASE,
|
||||
}
|
||||
|
||||
function ReaderFrontLight:init()
|
||||
if Device:isTouchDevice() then
|
||||
self.ges_events = {
|
||||
@@ -42,7 +42,7 @@ function ReaderFrontLight:onAdjust(arg, ges)
|
||||
local powerd = Device:getPowerDevice()
|
||||
if powerd.flIntensity ~= nil then
|
||||
DEBUG("frontlight intensity", powerd.flIntensity)
|
||||
local step = math.ceil(#self.steps * ges.distance / Screen:getWidth())
|
||||
local step = math.ceil(#self.steps * ges.distance / self.gestureScale)
|
||||
DEBUG("step = ", step)
|
||||
local delta_int = self.steps[step] or self.steps[#self.steps]
|
||||
DEBUG("delta_int = ", delta_int)
|
||||
|
||||
Reference in New Issue
Block a user