D16941: Fix inconsistent viewport positioning in PageView
Albert Astals Cid
noreply at phabricator.kde.org
Wed Nov 28 22:16:01 GMT 2018
aacid added inline comments.
INLINE COMMENTS
> pageview.cpp:1334
> // restore viewport center or use default {x-center,v-top} alignment
> - const QRect & r = item->croppedGeometry();
> - int newCenterX = r.left(),
> - newCenterY = r.top();
> - if ( vp.rePos.enabled )
> - {
> - if ( vp.rePos.pos == Okular::DocumentViewport::Center )
> - {
> - newCenterX += (int)( normClamp( vp.rePos.normalizedX, 0.5 ) * (double)r.width() );
> - newCenterY += (int)( normClamp( vp.rePos.normalizedY, 0.0 ) * (double)r.height() );
> - }
> - else
> - {
> - // TopLeft
> - newCenterX += (int)( normClamp( vp.rePos.normalizedX, 0.0 ) * (double)r.width() + viewport()->width() / 2 );
> - newCenterY += (int)( normClamp( vp.rePos.normalizedY, 0.0 ) * (double)r.height() + viewport()->height() / 2 );
> - }
> - }
> - else
> - {
> - newCenterX += r.width() / 2;
> - newCenterY += viewport()->height() / 2 - 10;
> - }
> + QPoint centerCoord = viewportToContentArea( vp );
>
const
> pageview.cpp:4656
> +
> + QPoint centerPos = viewportToContentArea( vp );
> + center( centerPos.x(), centerPos.y() );
const
REPOSITORY
R223 Okular
BRANCH
unify_vp_calc
REVISION DETAIL
https://phabricator.kde.org/D16941
To: tobiasdeiminger, #okular, sander
Cc: ngraham, sander, aacid, okular-devel, darcyshen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20181128/3c1b4e5b/attachment-0001.html>
More information about the Okular-devel
mailing list