[GRASS-SVN] r52379 - grass/branches/develbranch_6/gui/wxpython/mapdisp

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 16 00:56:42 PDT 2012


Author: annakrat
Date: 2012-07-16 00:56:42 -0700 (Mon, 16 Jul 2012)
New Revision: 52379

Modified:
   grass/branches/develbranch_6/gui/wxpython/mapdisp/mapwindow.py
Log:
wxGUI: fixed zoom (combination of recenter mode and backward wheel direction

Modified: grass/branches/develbranch_6/gui/wxpython/mapdisp/mapwindow.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/mapdisp/mapwindow.py	2012-07-16 07:54:07 UTC (rev 52378)
+++ grass/branches/develbranch_6/gui/wxpython/mapdisp/mapwindow.py	2012-07-16 07:56:42 UTC (rev 52379)
@@ -948,9 +948,18 @@
         current  = event.GetPositionTuple()[:]
         wheel = event.GetWheelRotation()
         Debug.msg (5, "BufferedWindow.MouseAction(): wheel=%d" % wheel)
+        if wheel > 0:
+            zoomtype = 1
+        else:
+            zoomtype = -1
+        
+        if UserSettings.Get(group = 'display',
+                            key = 'scrollDirection',
+                            subkey = 'selection'):
+            zoomtype *= -1
         # zoom 1/2 of the screen (TODO: settings)
         if zoomBehaviour == 0:  # zoom and recenter
-            if wheel > 0:
+            if zoomtype > 0:
                 begin = (current[0] - self.Map.width / 4,
                          current[1] - self.Map.height / 4)
                 end   = (current[0] + self.Map.width / 4,
@@ -964,16 +973,6 @@
             begin = (current[0]/2, current[1]/2)
             end = ((self.Map.width - current[0])/2 + current[0],
                    (self.Map.height - current[1])/2 + current[1])
-        
-        if wheel > 0:
-            zoomtype = 1
-        else:
-            zoomtype = -1
-        
-        if UserSettings.Get(group = 'display',
-                            key = 'scrollDirection',
-                            subkey = 'selection'):
-            zoomtype *= -1
             
         # zoom
         self.Zoom(begin, end, zoomtype)



More information about the grass-commit mailing list