From 3dfd172375cab9352fe73713df11219cb03ed199 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Sun, 24 Aug 2014 22:37:15 +0200 Subject: [PATCH] Only update zoomFactor for current page REVIEW: 119894 BUGS: 335819 FIXED-IN: 4.14.1 Reviewed by Fabio and Markus Trippelsdorf --- ui/pageview.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/ui/pageview.cpp b/ui/pageview.cpp index 8ceafae87..39a9390f8 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -1205,10 +1205,6 @@ void PageView::slotRealNotifyViewportChanged( bool smoothMove ) // enable setViewport calls d->blockViewport = false; - // update zoom text if in a ZoomFit/* zoom mode - if ( d->zoomMode != ZoomFixed ) - updateZoomText(); - if( viewport() ) { viewport()->update(); @@ -1343,6 +1339,10 @@ void PageView::notifyCurrentPageChanged( int previous, int current ) Q_FOREACH ( VideoWidget *videoWidget, item->videoWidgets() ) videoWidget->pageEntered(); } + + // update zoom text and factor if in a ZoomFit/* zoom mode + if ( d->zoomMode != ZoomFixed ) + updateZoomText(); } } @@ -3384,7 +3384,8 @@ void PageView::updateItemSize( PageViewItem * item, int colWidth, int rowHeight height = ( height / width ) * colWidth; zoom = (double)colWidth / width; item->setWHZC( colWidth, (int)height, zoom, crop ); - d->zoomFactor = zoom; + if ((uint)item->pageNumber() == d->document->currentPage()) + d->zoomFactor = zoom; } else if ( d->zoomMode == ZoomFitPage ) { @@ -3392,7 +3393,8 @@ void PageView::updateItemSize( PageViewItem * item, int colWidth, int rowHeight const double scaleH = (double)rowHeight / (double)height; zoom = qMin( scaleW, scaleH ); item->setWHZC( (int)(zoom * width), (int)(zoom * height), zoom, crop ); - d->zoomFactor = zoom; + if ((uint)item->pageNumber() == d->document->currentPage()) + d->zoomFactor = zoom; } else if ( d->zoomMode == ZoomFitAuto ) { @@ -3420,7 +3422,8 @@ void PageView::updateItemSize( PageViewItem * item, int colWidth, int rowHeight zoom = qMin( scaleW, scaleH ); } item->setWHZC( (int)(zoom * width), (int)(zoom * height), zoom, crop ); - d->zoomFactor = zoom; + if ((uint)item->pageNumber() == d->document->currentPage()) + d->zoomFactor = zoom; } #ifndef NDEBUG else