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:
1 parent
fb90d632ed
commit
b1e9b35da8
1 file changed
+1
-1
@@ -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