ReaderPaging: fix offset issue on next page in pan zoom (#11408)

reviewable/pr11463/r1^2
hugleo 2 months ago committed by GitHub
parent 041117cbb6
commit ef0077df23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1029,8 +1029,15 @@ function ReaderPaging:onGotoPageRel(diff)
goto_end(y)
goto_end(x)
elseif new_page > 0 then
-- Be sure that the new and old view areas are reset so that no value is carried over to next page.
-- Without this, we would have panned_y = new_va.y - old_va.y > 0, and panned_y will be added to the next page's y direction.
-- This occurs when the current page has a y > 0 position (for example, a cropped page) and can fit the whole page height,
-- while the next page needs scrolling in the height.
self:_gotoPage(new_page)
new_va = self.visible_area:copy()
old_va = self.visible_area
goto_end(y, -y_diff)
goto_end(x, -x_diff)
else
goto_end(x)
end

Loading…
Cancel
Save