Make use of "using std::xxx" at smallest possible scope.
This commit is contained in:
+7
-3
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user