[GRASS-SVN] r52373 - grass/trunk/gui/wxpython/mapdisp

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 13 13:57:40 PDT 2012


Author: annakrat
Date: 2012-07-13 13:57:40 -0700 (Fri, 13 Jul 2012)
New Revision: 52373

Modified:
   grass/trunk/gui/wxpython/mapdisp/mapwindow.py
Log:
wxGUI: fix zooming out for recenter mode

Modified: grass/trunk/gui/wxpython/mapdisp/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/mapwindow.py	2012-07-13 16:26:37 UTC (rev 52372)
+++ grass/trunk/gui/wxpython/mapdisp/mapwindow.py	2012-07-13 20:57:40 UTC (rev 52373)
@@ -983,11 +983,16 @@
         Debug.msg (5, "BufferedWindow.MouseAction(): wheel=%d" % wheel)
         # zoom 1/2 of the screen (TODO: settings)
         if zoomBehaviour == 0:  # zoom and recenter
-            # TODO: fix zooming out
-            begin = (current[0] - self.Map.width / 4,
-                     current[1] - self.Map.height / 4)
-            end   = (current[0] + self.Map.width / 4,
-                     current[1] + self.Map.height / 4)
+            if wheel > 0:
+                begin = (current[0] - self.Map.width / 4,
+                         current[1] - self.Map.height / 4)
+                end   = (current[0] + self.Map.width / 4,
+                         current[1] + self.Map.height / 4)
+            else:
+                begin = ((self.Map.width - current[0]) / 2,
+                         (self.Map.height - current[1]) / 2)
+                end = (begin[0] + self.Map.width / 2,
+                       begin[1] + self.Map.height / 2)
         elif zoomBehaviour == 1:  # zoom to current cursor position
             begin = (current[0]/2, current[1]/2)
             end = ((self.Map.width - current[0])/2 + current[0],



More information about the grass-commit mailing list