Review Request 129284: Don't jump up 1/2 page on file reload if scrolled to page (with left-right cursor)

Miklós Máté mtmkls at gmail.com
Sat Mar 11 21:52:05 UTC 2017



> On March 11, 2017, 6:15 p.m., Albert Astals Cid wrote:
> > What do you mean with "if scrolled to page (with left-right cursor)"?
> > 
> > Maybe you can add an autotest for this?

When you press cursor left or cursor right it scrolls the document to previous/next page, and it sets only the page number in the viewport without additional position (rePos.enabled=false, which aligns the top of the page to the top of the viewport). When a document is loaded with such a viewport, a rePos is generated, and if the viewport was on page 104 initially, the rePos one will be set to an offset such that the divider between pages 103 and 104 is in the center.

My patch intended to fix this by making the center of the selected page the center of the viewport instead of the top edge of the page. It's not 100% correct though: if the default zoom is high, the center of the page may not be the desired starting viewport. The best solution would be to avoid generating rePos upon loading a file, but that seems like a lot of work.


- Miklós


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/129284/#review102795
-----------------------------------------------------------


On Oct. 30, 2016, 3:28 p.m., Miklós Máté wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/129284/
> -----------------------------------------------------------
> 
> (Updated Oct. 30, 2016, 3:28 p.m.)
> 
> 
> Review request for Okular.
> 
> 
> Repository: okular
> 
> 
> Description
> -------
> 
> This fixes the problem for now, but the whole load/relayout/scroll logic cries for a refactoring. For example, upon loading a file the viewport is set 4 times, and if the viewport was "104" initially, it becomes "104;C2:0.49933:0.499527:1" in the end.
> 
> 
> Diffs
> -----
> 
>   ui/pageview.cpp bb540cb 
> 
> Diff: https://git.reviewboard.kde.org/r/129284/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Miklós Máté
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20170311/89f374f9/attachment.html>


More information about the Okular-devel mailing list