[feat, plugin] Add AutoTurn (#5295)

Fixes <https://github.com/koreader/koreader/issues/3019>.
This commit is contained in:
Frans de Jonge
2019-09-01 21:30:19 +02:00
committed by GitHub
parent b038fa3046
commit 4cdc3ab99b
6 changed files with 204 additions and 0 deletions

View File

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