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

Albert Astals Cid aacid at kde.org
Wed Nov 9 17:53:38 UTC 2011


A Dimarts, 8 de novembre de 2011, Michel Ludwig vàreu escriure:
> > 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 :)

Ok, here comes my suggestion. It is basically veeeeery similar to your patch 
but touches [almost] no generator code.

What do you think?

Albert

P.S: It seems there is a kind of "refresh" problem after the rotation is 
switched but that should be hopefully easy to fix for you?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NamedRotations
Type: text/x-patch
Size: 10328 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20111109/877ee8e9/attachment-0001.diff>


More information about the Okular-devel mailing list