[GRASS-SVN] r50518 - grass/trunk/gui/wxpython/psmap
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jan 28 05:48:10 EST 2012
Author: annakrat
Date: 2012-01-28 02:48:10 -0800 (Sat, 28 Jan 2012)
New Revision: 50518
Modified:
grass/trunk/gui/wxpython/psmap/frame.py
Log:
wxGUI/wxpsmap: reopened bug #1547 hopefully fixed
Modified: grass/trunk/gui/wxpython/psmap/frame.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/frame.py 2012-01-28 10:44:58 UTC (rev 50517)
+++ grass/trunk/gui/wxpython/psmap/frame.py 2012-01-28 10:48:10 UTC (rev 50518)
@@ -1451,20 +1451,23 @@
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
+ zoomFactor = min(rW/cW, rH/cH)
+ 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