[GRASS-SVN] r50519 - grass/branches/develbranch_6/gui/wxpython/psmap
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jan 28 05:49:20 EST 2012
Author: annakrat
Date: 2012-01-28 02:49:20 -0800 (Sat, 28 Jan 2012)
New Revision: 50519
Modified:
grass/branches/develbranch_6/gui/wxpython/psmap/frame.py
Log:
wxGUI/wxpsmap: reopened bug #1547 hopefully fixed
Modified: grass/branches/develbranch_6/gui/wxpython/psmap/frame.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/psmap/frame.py 2012-01-28 10:48:10 UTC (rev 50518)
+++ grass/branches/develbranch_6/gui/wxpython/psmap/frame.py 2012-01-28 10:49:20 UTC (rev 50519)
@@ -1452,19 +1452,22 @@
if self.mouse['use'] == 'zoomout':
zoomFactor = min(rW/cW, rH/cH)
- if rW/rH > cW/cH:
- yView = rect.GetY() - (rW*(cH/cW) - rH)/2
- xView = rect.GetX()
-
- if self.mouse['use'] == 'zoomout':
- x,y = rect.GetX() + (rW-(cW/cH)*rH)/2, rect.GetY()
- xView, yView = -x, -y
- else:
- xView = rect.GetX() - (rH*(cW/cH) - rW)/2
- yView = rect.GetY()
- if self.mouse['use'] == 'zoomout':
- x,y = rect.GetX(), rect.GetY() + (rH-(cH/cW)*rW)/2
- xView, yView = -x, -y
+ try:
+ if rW/rH > cW/cH:
+ yView = rect.GetY() - (rW*(cH/cW) - rH)/2
+ xView = rect.GetX()
+
+ if self.mouse['use'] == 'zoomout':
+ x,y = rect.GetX() + (rW-(cW/cH)*rH)/2, rect.GetY()
+ xView, yView = -x, -y
+ else:
+ xView = rect.GetX() - (rH*(cW/cH) - rW)/2
+ yView = rect.GetY()
+ if self.mouse['use'] == 'zoomout':
+ x,y = rect.GetX(), rect.GetY() + (rH-(cH/cW)*rW)/2
+ xView, yView = -x, -y
+ except ZeroDivisionError:
+ xView, yView = rect.GetX(), rect.GetY()
return zoomFactor, (int(xView), int(yView))
More information about the grass-commit
mailing list