mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[fix] GestureDetector: add PAN_DELAYED_INTERVAL (#4666)
When multiswipes are enabled, this fixes the long-standing complaint that swiping to open the menu could unintentionally trigger some light panning. With the introduction of multiswipes, this problem has become more noticeable.
This commit is contained in:
@@ -401,8 +401,12 @@ function ReaderPaging:onPan(_, ges)
|
||||
self.view:PanningStart(-ges.relative.x, -ges.relative.y)
|
||||
end
|
||||
elseif ges.direction == "north" or ges.direction == "south" then
|
||||
self:onPanningRel(self.last_pan_relative_y - ges.relative.y)
|
||||
self.last_pan_relative_y = ges.relative.y
|
||||
local relative_type = "relative"
|
||||
if self.ui.gesture and self.ui.gesture.multiswipes_enabled then
|
||||
relative_type = "relative_delayed"
|
||||
end
|
||||
self:onPanningRel(self.last_pan_relative_y - ges[relative_type].y)
|
||||
self.last_pan_relative_y = ges[relative_type].y
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user