mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix cre scroll page update and allow jumping to page (#3333)
This makes Go to, Skim to and TOC page selection work in scroll mode, and page given to other module more accurate (previously, we were one action lagging).
This commit is contained in:
@@ -558,6 +558,7 @@ function ReaderRolling:_gotoPos(new_pos)
|
||||
self.view.dim_area.y = 0
|
||||
end
|
||||
end
|
||||
self.ui.document:gotoPos(new_pos)
|
||||
-- The current page we get in scroll mode may be a bit innacurate,
|
||||
-- but we give it anyway to onPosUpdate so footer and statistics can
|
||||
-- keep up with page.
|
||||
@@ -570,7 +571,11 @@ end
|
||||
|
||||
function ReaderRolling:_gotoPage(new_page)
|
||||
self.ui.document:gotoPage(new_page)
|
||||
self.ui:handleEvent(Event:new("PageUpdate", self.ui.document:getCurrentPage()))
|
||||
if self.view.view_mode == "page" then
|
||||
self.ui:handleEvent(Event:new("PageUpdate", self.ui.document:getCurrentPage()))
|
||||
else
|
||||
self.ui:handleEvent(Event:new("PosUpdate", self.ui.document:getCurrentPos(), self.ui.document:getCurrentPage()))
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderRolling:_gotoXPointer(xpointer)
|
||||
|
||||
Reference in New Issue
Block a user