[GRASS-SVN] r52378 - grass/trunk/gui/wxpython/mapdisp
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jul 16 00:54:08 PDT 2012
Author: annakrat
Date: 2012-07-16 00:54:07 -0700 (Mon, 16 Jul 2012)
New Revision: 52378
Modified:
grass/trunk/gui/wxpython/mapdisp/mapwindow.py
Log:
wxGUI: fixed zoom (combination of recenter mode and backward wheel direction
Modified: grass/trunk/gui/wxpython/mapdisp/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/mapwindow.py 2012-07-16 07:37:38 UTC (rev 52377)
+++ grass/trunk/gui/wxpython/mapdisp/mapwindow.py 2012-07-16 07:54:07 UTC (rev 52378)
@@ -981,9 +981,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,
@@ -997,15 +1006,7 @@
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