Browse Source

wxGUI: fixed zoom (combination of recenter mode and backward wheel direction

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52378 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 12 years ago
parent
commit
96ceb0f0cf
1 changed files with 10 additions and 9 deletions
  1. 10 9
      gui/wxpython/mapdisp/mapwindow.py

+ 10 - 9
gui/wxpython/mapdisp/mapwindow.py

@@ -981,9 +981,18 @@ class BufferedWindow(MapWindow, wx.Window):
         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,
@@ -997,15 +1006,7 @@ class BufferedWindow(MapWindow, wx.Window):
             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)