mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
use new directions in pan/swipe gesture
This commit is contained in:
@@ -173,13 +173,13 @@ function ReaderPaging:flipping(flipping_page, flipping_ges)
|
||||
local whole = self.number_of_pages
|
||||
local rel_proportion = flipping_ges.distance / Screen:getWidth()
|
||||
local abs_proportion = flipping_ges.distance / Screen:getHeight()
|
||||
if flipping_ges.direction == "right" then
|
||||
if flipping_ges.direction == "east" then
|
||||
self:gotoPage(flipping_page - math.floor(read*rel_proportion))
|
||||
elseif flipping_ges.direction == "left" then
|
||||
elseif flipping_ges.direction == "west" then
|
||||
self:gotoPage(flipping_page + math.floor(unread*rel_proportion))
|
||||
elseif flipping_ges.direction == "down" then
|
||||
elseif flipping_ges.direction == "south" then
|
||||
self:gotoPage(flipping_page - math.floor(whole*abs_proportion))
|
||||
elseif flipping_ges.direction == "up" then
|
||||
elseif flipping_ges.direction == "north" then
|
||||
self:gotoPage(flipping_page + math.floor(whole*abs_proportion))
|
||||
end
|
||||
UIManager:setDirty(self.view.dialog, "partial")
|
||||
@@ -189,9 +189,9 @@ function ReaderPaging:onSwipe(arg, ges)
|
||||
if self.flipping_mode then
|
||||
self:flipping(self.flipping_page, ges)
|
||||
self:updateFlippingPage(self.current_page)
|
||||
elseif ges.direction == "left" or ges.direction == "up" then
|
||||
elseif ges.direction == "west" or ges.direction == "north" then
|
||||
self:onPagingRel(1)
|
||||
elseif ges.direction == "right" or ges.direction == "down" then
|
||||
elseif ges.direction == "east" or ges.direction == "south" then
|
||||
self:onPagingRel(-1)
|
||||
end
|
||||
return true
|
||||
|
||||
@@ -130,9 +130,9 @@ function BBoxWidget:adjustScreenBBox(ges, relative)
|
||||
elseif nearest == upper_center then
|
||||
if relative then
|
||||
local delta = 0
|
||||
if ges.direction == "up" then
|
||||
if ges.direction == "north" then
|
||||
delta = -ges.distance / 5
|
||||
elseif ges.direction == "down" then
|
||||
elseif ges.direction == "south" then
|
||||
delta = ges.distance / 5
|
||||
end
|
||||
upper_left.y = upper_left.y + delta
|
||||
@@ -142,9 +142,9 @@ function BBoxWidget:adjustScreenBBox(ges, relative)
|
||||
elseif nearest == right_center then
|
||||
if relative then
|
||||
local delta = 0
|
||||
if ges.direction == "left" then
|
||||
if ges.direction == "west" then
|
||||
delta = -ges.distance / 5
|
||||
elseif ges.direction == "right" then
|
||||
elseif ges.direction == "east" then
|
||||
delta = ges.distance / 5
|
||||
end
|
||||
bottom_right.x = bottom_right.x + delta
|
||||
@@ -154,9 +154,9 @@ function BBoxWidget:adjustScreenBBox(ges, relative)
|
||||
elseif nearest == bottom_center then
|
||||
if relative then
|
||||
local delta = 0
|
||||
if ges.direction == "up" then
|
||||
if ges.direction == "north" then
|
||||
delta = -ges.distance / 5
|
||||
elseif ges.direction == "down" then
|
||||
elseif ges.direction == "south" then
|
||||
delta = ges.distance / 5
|
||||
end
|
||||
bottom_right.y = bottom_right.y + delta
|
||||
@@ -166,9 +166,9 @@ function BBoxWidget:adjustScreenBBox(ges, relative)
|
||||
elseif nearest == left_center then
|
||||
if relative then
|
||||
local delta = 0
|
||||
if ges.direction == "left" then
|
||||
if ges.direction == "west" then
|
||||
delta = -ges.distance / 5
|
||||
elseif ges.direction == "right" then
|
||||
elseif ges.direction == "east" then
|
||||
delta = ges.distance / 5
|
||||
end
|
||||
upper_left.x = upper_left.x + delta
|
||||
|
||||
@@ -562,9 +562,9 @@ function Menu:onTapCloseAllMenus(arg, ges_ev)
|
||||
end
|
||||
|
||||
function Menu:onSwipe(arg, ges_ev)
|
||||
if ges_ev.direction == "left" then
|
||||
if ges_ev.direction == "west" then
|
||||
self:onNextPage()
|
||||
elseif ges_ev.direction == "right" then
|
||||
elseif ges_ev.direction == "east" then
|
||||
self:onPrevPage()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -358,9 +358,9 @@ function TouchMenu:onPrevPage()
|
||||
end
|
||||
|
||||
function TouchMenu:onSwipe(arg, ges_ev)
|
||||
if ges_ev.direction == "left" then
|
||||
if ges_ev.direction == "west" then
|
||||
self:onNextPage()
|
||||
elseif ges_ev.direction == "right" then
|
||||
elseif ges_ev.direction == "east" then
|
||||
self:onPrevPage()
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user