Make use of "using std::xxx" at smallest possible scope.

This commit is contained in:
Jim Evins
2013-12-28 11:49:38 -05:00
parent a46bc43a4d
commit eeb55cf846
5 changed files with 29 additions and 13 deletions
+7 -3
View File
@@ -25,6 +25,7 @@
#include <QMouseEvent>
#include <QGraphicsLineItem>
#include <QGraphicsDropShadowEffect>
#include <algorithm>
#include <cmath>
#include <iostream>
@@ -194,13 +195,16 @@ namespace glabels
///
void View::zoomToFit()
{
using std::min;
using std::max;
double x_scale = (72.0/physicalDpiX()) * ( width() - ZOOM_TO_FIT_PAD ) / mModel->w();
double y_scale = (72.0/physicalDpiY()) * ( height() - ZOOM_TO_FIT_PAD ) / mModel->h();
double newZoom = std::min( x_scale, y_scale );
double newZoom = min( x_scale, y_scale );
// Limits
newZoom = std::min( newZoom, zoomLevels[0] );
newZoom = std::max( newZoom, zoomLevels[nZoomLevels-1] );
newZoom = min( newZoom, zoomLevels[0] );
newZoom = max( newZoom, zoomLevels[nZoomLevels-1] );
setZoomReal( newZoom, true );
}