[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:
Frans de Jonge
2019-02-28 23:49:23 +01:00
committed by GitHub
parent 96823df503
commit 4547b2d65f
3 changed files with 31 additions and 4 deletions

View File

@@ -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