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:
@@ -421,10 +421,14 @@ end
|
||||
|
||||
function ReaderRolling:onPan(_, ges)
|
||||
if self.view.view_mode == "scroll" then
|
||||
local distance_type = "distance"
|
||||
if self.ui.gesture and self.ui.gesture.multiswipes_enabled then
|
||||
distance_type = "distance_delayed"
|
||||
end
|
||||
if ges.direction == "north" then
|
||||
self:_gotoPos(self.current_pos + ges.distance)
|
||||
self:_gotoPos(self.current_pos + ges[distance_type])
|
||||
elseif ges.direction == "south" then
|
||||
self:_gotoPos(self.current_pos - ges.distance)
|
||||
self:_gotoPos(self.current_pos - ges[distance_type])
|
||||
end
|
||||
end
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user