Skip to content

Fix scroll down/up at the last/first page in single page, non-continuous mode

Kai Shen requested to merge swkfk/okular:master into master

The bug I encountered

In single page, non-continuous mode, open a PDF file. If you scroll up at the first page and then scroll down, the document will not go to the second page. The same when scroll down at the last page and then scroll up.

What did I find

I find that, the code in part/pageview.cpp:3271-3299 uses singlePageWheelAccumulatedDelta to accumulate the scroll behavior. But if we scroll up at the first page, the data will be accumulated positive. And then, if we scroll down, the data will go back to zero first, and then we can turn to the next page with another 'scroll down' event.

What did I do

I just clear the accumulated data when it is enough to perform 'a real scroll', even if the target page is invalid (such as the previous page of the first page).

Edited by Kai Shen

Merge request reports

Loading