mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Avoid PageUpdate from receiving out-of-range page
Otherwise, current_page can acquire negative values, or values greater than the page count, when the user tries to go back the first page or past the last page.
This commit is contained in:
@@ -349,7 +349,7 @@ end
|
||||
|
||||
function ReaderRolling:gotoPage(new_page)
|
||||
self.ui.document:gotoPage(new_page)
|
||||
self.ui:handleEvent(Event:new("PageUpdate", new_page))
|
||||
self.ui:handleEvent(Event:new("PageUpdate", self.ui.document:getCurrentPage()))
|
||||
end
|
||||
|
||||
function ReaderRolling:gotoXPointer(xpointer)
|
||||
|
||||
Reference in New Issue
Block a user