[GRASS-SVN] r50476 - grass/trunk/gui/wxpython/psmap

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


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

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

Modified: grass/trunk/gui/wxpython/psmap/frame.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/frame.py	2012-01-26 14:33:00 UTC (rev 50475)
+++ grass/trunk/gui/wxpython/psmap/frame.py	2012-01-26 14:33:32 UTC (rev 50476)
@@ -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