Skip to content

Commit

Permalink
ReaderPaging: fix offset issue on next page in pan zoom (#11408)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugleo committed Feb 17, 2024
1 parent 041117c commit ef0077d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions frontend/apps/reader/modules/readerpaging.lua
Expand Up @@ -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
Expand Down

0 comments on commit ef0077d

Please sign in to comment.