Don't let people zoomin/out past the "range of values"

BUGS: 338452
FIXED-IN: 4.14.1
This commit is contained in:
Albert Astals Cid 2014-08-21 23:34:54 +02:00
parent b98f1e9338
commit f09df0aa05

View file

@ -3663,10 +3663,14 @@ void PageView::updateZoom( ZoomMode newZoomMode )
QVector<float>::iterator i;
if ( newZoomMode == ZoomOut )
{
if (newFactor <= zoomValue.first())
return;
i = qLowerBound(zoomValue.begin(), zoomValue.end(), newFactor) - 1;
}
else
{
if (newFactor >= zoomValue.last())
return;
i = qUpperBound(zoomValue.begin(), zoomValue.end(), newFactor);
}
const float tmpFactor = *i;