[GRASS-SVN] r50475 - grass/branches/develbranch_6/gui/wxpython/psmap

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jan 26 09:33:00 EST 2012


Author: annakrat
Date: 2012-01-26 06:33:00 -0800 (Thu, 26 Jan 2012)
New Revision: 50475

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

Modified: grass/branches/develbranch_6/gui/wxpython/psmap/frame.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/psmap/frame.py	2012-01-26 14:16:10 UTC (rev 50474)
+++ grass/branches/develbranch_6/gui/wxpython/psmap/frame.py	2012-01-26 14:33:00 UTC (rev 50475)
@@ -1439,7 +1439,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