[Okular-devel] Review Request: Implement the handling of page rotations for source references

Michel Ludwig michel.ludwig at gmail.com
Tue Nov 8 21:02:05 UTC 2011



> On Nov. 8, 2011, 5:10 p.m., Albert Astals Cid wrote:
> > I'm not convinced by this patch, as far as i understood what you wanted to do is get the generators assume everything was on Rotate0, which is what it actually is, so i don't think the generators should be querying the page rotation at all. That seems wrong.
> > 
> > Personally i think that what is wrong is 
> >   const Okular::SourceReference * ref = d->document->dynamicSourceReference( pageItem->  pageNumber(), nX * pageItem->page()->width(), nY * pageItem->page()->height() );
> > That is using width and height indiscriminately when it is there at the UI level where i think makes more sense to compensate for the rotation of the page.
> > 
> > I'd certainly prefer a patch that does not touch generator implementation at all.
> > 
> > If you need help i might give it a go if you give me some sample files to test.

There is one problem with the Okular::Page, namely in the 'PagePrivate::rotateAt' method, which swaps the width and height of the page depending on the rotation (line 339). In order to compensate for that, I had to ask for the rotation of the page in the generators to compute the correct viewport location relative to Rotation0. Of course, if one doesn't do that, one gets the wrong location.

I've attached a example LaTeX file and its corresponding synctex file. I guess the most convenient way would simply be to open the LaTeX file in the live preview branch of Kile:

http://sourceforge.net/apps/mediawiki/kile/index.php?title=Live_Preview

The rotation can be changed in the View / Document Viewer menu.

And yes, I would be happy if you could have a look at it :)


- Michel


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103060/#review8027
-----------------------------------------------------------


On Nov. 6, 2011, 6:40 p.m., Michel Ludwig wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103060/
> -----------------------------------------------------------
> 
> (Updated Nov. 6, 2011, 6:40 p.m.)
> 
> 
> Review request for Okular.
> 
> 
> Description
> -------
> 
> Implement the handling of page rotations for source references.
> 
> 
> Diffs
> -----
> 
>   generators/dvi/generator_dvi.cpp 2bc8641 
>   generators/poppler/generator_pdf.cpp 07937b3 
>   ui/pagepainter.cpp ca55e81 
>   ui/pageview.h 9fac706 
>   ui/pageview.cpp eebdf46 
> 
> Diff: http://git.reviewboard.kde.org/r/103060/diff/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Michel Ludwig
> 
>

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


More information about the Okular-devel mailing list