Просмотр исходного кода

wxGUI/wxpsmap: attempt to fix https://trac.osgeo.org/grass/ticket/1547

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50476 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 13 лет назад
Родитель
Сommit
44091b04e7
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      gui/wxpython/psmap/frame.py

+ 4 - 1
gui/wxpython/psmap/frame.py

@@ -1439,7 +1439,10 @@ class PsMapBufferedWindow(wx.Window):
 
         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