mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[feat, plugin] Add AutoTurn (#5295)
Fixes <https://github.com/koreader/koreader/issues/3019>.
This commit is contained in:
@@ -645,6 +645,12 @@ function ReaderRolling:onGotoViewRel(diff)
|
||||
elseif self.view.view_mode == "page" then
|
||||
local page_count = self.ui.document:getVisiblePageCount()
|
||||
local old_page = self.current_page
|
||||
-- we're in paged mode, so round up
|
||||
if diff > 0 then
|
||||
diff = math.ceil(diff)
|
||||
else
|
||||
diff = math.floor(diff)
|
||||
end
|
||||
self:_gotoPage(self.current_page + diff*page_count)
|
||||
if diff > 0 and old_page == self.current_page then
|
||||
self.ui:handleEvent(Event:new("EndOfBook"))
|
||||
|
||||
Reference in New Issue
Block a user