Skip to content

Commit a72005e

Browse files
author
mhugent
committed
Fix for nan extents when using the 'zoom out' tool and height or width of window is 0
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6068 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 09d8b56 commit a72005e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/gui/qgsmaptoolzoom.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,20 @@ void QgsMapToolZoom::canvasReleaseEvent(QMouseEvent * e)
9191
double sf;
9292
if (mZoomRect.width() > mZoomRect.height())
9393
{
94+
if(r.width() == 0)//prevent nan map extent
95+
{
96+
return;
97+
}
9498
sf = extent.width() / r.width();
9599
}
96100
else
97101
{
102+
if(r.height() == 0)//prevent nan map extent
103+
{
104+
return;
105+
}
98106
sf = extent.height() / r.height();
99107
}
100-
101108
r.expand(sf);
102109

103110
#ifdef QGISDEBUG

0 commit comments

Comments
 (0)