Skip to content

Commit fd42980

Browse files
authoredFeb 4, 2019
fix error in scale optimization (#9081)
1 parent 384d310 commit fd42980

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/gui/qgsmapcanvas.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ email : sherman at mrcc.com
1515
* *
1616
***************************************************************************/
1717

18+
#include <cmath>
1819

1920
#include <QtGlobal>
2021
#include <QApplication>
@@ -69,7 +70,6 @@ email : sherman at mrcc.com
6970
#include "qgscoordinatetransformcontext.h"
7071
#include "qgssvgcache.h"
7172
#include "qgsimagecache.h"
72-
#include <cmath>
7373

7474
/**
7575
* \ingroup gui
@@ -1010,7 +1010,7 @@ void QgsMapCanvas::zoomToSelected( QgsVectorLayer *layer )
10101010
QgsFeatureIterator fit = layer->getFeatures( req );
10111011
QgsFeature f;
10121012
QgsPointXY closestPoint;
1013-
double closestSquaredDistance = extentRect.width() + extentRect.height();
1013+
double closestSquaredDistance = pow( extentRect.width(), 2.0 ) + pow( extentRect.height(), 2.0 );
10141014
bool pointFound = false;
10151015
while ( fit.nextFeature( f ) )
10161016
{

0 commit comments

Comments
 (0)
Please sign in to comment.