Skip to content

Commit

Permalink
Fix for nan extents when using the 'zoom out' tool and height or widt…
Browse files Browse the repository at this point in the history
…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 eea03f2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gui/qgsmaptoolzoom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eea03f2

Please sign in to comment.