[GRASS-SVN] r66928 - grass/trunk/gui/wxpython/modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Nov 25 12:32:40 PST 2015
Author: martinl
Date: 2015-11-25 12:32:40 -0800 (Wed, 25 Nov 2015)
New Revision: 66928
Modified:
grass/trunk/gui/wxpython/modules/colorrules.py
Log:
wxGUI: fix colorrules preview (no backport needed)
Modified: grass/trunk/gui/wxpython/modules/colorrules.py
===================================================================
--- grass/trunk/gui/wxpython/modules/colorrules.py 2015-11-25 18:58:44 UTC (rev 66927)
+++ grass/trunk/gui/wxpython/modules/colorrules.py 2015-11-25 20:32:40 UTC (rev 66928)
@@ -1786,6 +1786,7 @@
# make sure that extents are updated at init
self.Map.region = self.Map.GetRegion()
self.Map.SetRegion()
+ self.Map.GetRenderMgr().renderDone.connect(self._updatePreviewFinished)
def Draw(self, pdc, img = None, pdctype = 'image'):
"""Draws preview or clears window"""
@@ -1877,20 +1878,25 @@
def UpdatePreview(self, img = None):
"""Update canvas if window changes geometry"""
Debug.msg (2, "BufferedWindow.UpdatePreview(%s): render=%s" % (img, self.render))
- oldfont = ""
- oldencoding = ""
- if self.render:
- # extent is taken from current map display
- try:
- self.Map.region = copy.deepcopy(self.parent.parent.GetLayerTree().GetMap().GetCurrentRegion())
- except AttributeError:
- self.Map.region = self.Map.GetRegion()
- # render new map images
- self.mapfile = self.Map.Render(force = self.render)
- self.img = self.GetImage()
- self.resize = False
+ if not self.render:
+ return
+ # extent is taken from current map display
+ try:
+ self.Map.region = copy.deepcopy(self.parent.parent.GetLayerTree().GetMap().GetCurrentRegion())
+ except AttributeError:
+ self.Map.region = self.Map.GetRegion()
+ # render new map images
+ self.mapfile = self.Map.Render(force = self.render)
+
+ def _updatePreviewFinished(self):
+ if not self.render:
+ return
+
+ self.img = self.GetImage()
+ self.resize = False
+
if not self.img:
return
More information about the grass-commit
mailing list