[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

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