ReaderPaging: allow for page diff greater than 1 in onScrollPageRel (#8836)

Cf. <https://www.mobileread.com/forums/showthread.php?p=4200567>.
This commit is contained in:
Frans de Jonge
2022-02-28 21:27:46 +01:00
committed by GitHub
parent 41e57fccd2
commit d691964c0b

View File

@@ -861,7 +861,11 @@ end
function ReaderPaging:onScrollPageRel(page_diff)
if page_diff == 0 then return true end
if page_diff > 0 then
if page_diff > 1 or page_diff < -1 then
-- More than 1 page, don't bother with how far we've scrolled.
self:onGotoRelativePage(Math.round(page_diff))
return true
elseif page_diff > 0 then
-- page down, last page should be moved to top
local last_page_state = table.remove(self.view.page_states)
local last_visible_area = last_page_state.visible_area