[GRASS-SVN] r48027 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Sep 1 08:53:54 EDT 2011
Author: martinl
Date: 2011-09-01 05:53:54 -0700 (Thu, 01 Sep 2011)
New Revision: 48027
Modified:
grass/trunk/gui/wxpython/gui_modules/layertree.py
grass/trunk/gui/wxpython/gui_modules/mapdisp_vdigit.py
grass/trunk/gui/wxpython/gui_modules/toolbars.py
grass/trunk/gui/wxpython/gui_modules/wxvdriver.py
Log:
wxGU: fix opacity level for vdigit
Modified: grass/trunk/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/layertree.py 2011-09-01 11:53:25 UTC (rev 48026)
+++ grass/trunk/gui/wxpython/gui_modules/layertree.py 2011-09-01 12:53:54 UTC (rev 48027)
@@ -224,13 +224,16 @@
return self.mapdisplay
def OnIdle(self, event):
- """
- Only re-order and re-render a composite map image from GRASS during
+ """!Only re-order and re-render a composite map image from GRASS during
idle time instead of multiple times during layer changing.
"""
if self.rerender:
+ if self.mapdisplay.toolbars['vdigit']:
+ vector = True
+ else:
+ vector = False
if self.mapdisplay.statusbarWin['render'].GetValue():
- self.mapdisplay.MapWindow2D.UpdateMap(render = True)
+ self.mapdisplay.MapWindow.UpdateMap(render = True, renderVector = vector)
if self.lmgr.IsPaneShown('toolbarNviz'): # nviz
self.mapdisplay.MapWindow3D.UpdateMap(render = True)
self.rerender = False
@@ -628,16 +631,17 @@
def OnSetBgMap(self, event):
"""!Set background vector map for editing sesstion"""
+ digit = self.mapdisplay.GetWindow().digit
if event.IsChecked():
mapName = self.GetPyData(self.layer_selected)[0]['maplayer'].GetName()
UserSettings.Set(group = 'vdigit', key = 'bgmap', subkey = 'value',
value = str(mapName), internal = True)
- self.mapdisplay.digit.OpenBackgroundMap(mapName)
+ digit.OpenBackgroundMap(mapName)
self._setGradient('bgmap')
else:
UserSettings.Set(group = 'vdigit', key = 'bgmap', subkey = 'value',
value = '', internal = True)
- self.mapdisplay.digit.CloseBackgroundMap()
+ digit.CloseBackgroundMap()
self._setGradient()
self.RefreshLine(self.layer_selected)
@@ -669,7 +673,7 @@
if self.mapdisplay.toolbars['vdigit'] and \
self.mapdisplay.toolbars['vdigit'].GetLayer() == maplayer:
alpha = int(new_opacity * 255)
- self.mapdisplay.digit.driver.UpdateSettings(alpha)
+ self.mapdisplay.GetWindow().digit.GetDisplay().UpdateSettings(alpha = alpha)
# redraw map if auto-rendering is enabled
self.rerender = True
Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp_vdigit.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp_vdigit.py 2011-09-01 11:53:25 UTC (rev 48026)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp_vdigit.py 2011-09-01 12:53:54 UTC (rev 48027)
@@ -39,7 +39,7 @@
self.pdcVector = wx.PseudoDC()
self.toolbar = self.parent.toolbars['vdigit']
- self.digit = None
+ self.digit = None # wxvdigit.IVDigit
self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
Modified: grass/trunk/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/toolbars.py 2011-09-01 11:53:25 UTC (rev 48026)
+++ grass/trunk/gui/wxpython/gui_modules/toolbars.py 2011-09-01 12:53:54 UTC (rev 48027)
@@ -1091,10 +1091,11 @@
if not self.parent.MapWindow.resize:
self.parent.MapWindow.UpdateMap(render = True)
+ # respect opacity
opacity = mapLayer.GetOpacity(float = True)
if opacity < 1.0:
alpha = int(opacity * 255)
- self.digit.UpdateSettings(alpha)
+ self.digit.GetDisplay().UpdateSettings(alpha = alpha)
return True
Modified: grass/trunk/gui/wxpython/gui_modules/wxvdriver.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxvdriver.py 2011-09-01 11:53:25 UTC (rev 48026)
+++ grass/trunk/gui/wxpython/gui_modules/wxvdriver.py 2011-09-01 12:53:54 UTC (rev 48027)
@@ -882,7 +882,8 @@
UserSettings.Get(group = 'vdigit', key = 'symbol',
subkey = [key, 'color'])[1],
UserSettings.Get(group = 'vdigit', key = 'symbol',
- subkey = [key, 'color'])[2])
+ subkey = [key, 'color'])[2],
+ alpha)
if key == 'highlight':
self.settings[key] = color
More information about the grass-commit
mailing list