Skip to content
Permalink
Browse files
Fix for nan extents when using the 'zoom out' tool and height or widt…
…h of window is 0

git-svn-id: http://svn.osgeo.org/qgis/trunk@6068 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Nov 10, 2006
1 parent c9fed33 commit eea03f2379a6a1895e08a40780eae8842df54e3e
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/gui/qgsmaptoolzoom.cpp
@@ -91,13 +91,20 @@ void QgsMapToolZoom::canvasReleaseEvent(QMouseEvent * e)
double sf;
if (mZoomRect.width() > mZoomRect.height())
{
if(r.width() == 0)//prevent nan map extent
{
return;
}
sf = extent.width() / r.width();
}
else
{
if(r.height() == 0)//prevent nan map extent
{
return;
}
sf = extent.height() / r.height();
}

r.expand(sf);

#ifdef QGISDEBUG

0 comments on commit eea03f2

Please sign in to comment.