Commit 3dfd1723 authored by Albert Astals Cid's avatar Albert Astals Cid

Only update zoomFactor for current page

REVIEW: 119894
BUGS: 335819
FIXED-IN: 4.14.1

Reviewed by Fabio and Markus Trippelsdorf
parent f09df0aa
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment