[GRASS-SVN] r50474 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jan 26 09:16:10 EST 2012


Author: annakrat
Date: 2012-01-26 06:16:10 -0800 (Thu, 26 Jan 2012)
New Revision: 50474

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap.py
Log:
wxGUI/wxpsmap: attempt to fix #1547

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap.py	2012-01-26 14:13:26 UTC (rev 50473)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/psmap.py	2012-01-26 14:16:10 UTC (rev 50474)
@@ -1406,7 +1406,10 @@
 
         else:   #dragging    
             rW, rH = float(rect.GetWidth()), float(rect.GetHeight())
-            zoomFactor = 1/max(rW/cW, rH/cH)
+            try:
+                zoomFactor = 1/max(rW/cW, rH/cH)
+            except ZeroDivisionError:
+                zoomFactor = 1
             # when zooming to full extent, in some cases, there was zoom 1.01..., which causes problem
             if abs(zoomFactor - 1) > 0.01:
                 zoomFactor = zoomFactor 



More information about the grass-commit mailing list