[GRASS-SVN] r48222 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Sep 9 08:54:50 EDT 2011
Author: annakrat
Date: 2011-09-09 05:54:50 -0700 (Fri, 09 Sep 2011)
New Revision: 48222
Modified:
grass/trunk/gui/wxpython/gui_modules/psmap.py
Log:
wx.psmap: fix text background color
Modified: grass/trunk/gui/wxpython/gui_modules/psmap.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/psmap.py 2011-09-09 09:37:50 UTC (rev 48221)
+++ grass/trunk/gui/wxpython/gui_modules/psmap.py 2011-09-09 12:54:50 UTC (rev 48222)
@@ -1536,7 +1536,7 @@
rot = float(textDict['rotate'])
else:
rot = 0
-
+
fontsize = textDict['fontsize'] * self.currScale
if textDict['background'] != 'none':
background = textDict['background']
@@ -1546,19 +1546,27 @@
pdc.RemoveId(drawId)
pdc.SetId(drawId)
pdc.BeginDrawing()
- # doesn't work
+
+ # border is not redrawn when zoom changes, why?
+## if textDict['border'] != 'none' and not rot:
+## units = UnitConversion(self)
+## borderWidth = units.convert(value = textDict['width'],
+## fromUnit = 'point', toUnit = 'pixel' ) * self.currScale
+## pdc.SetPen(wx.Pen(colour = convertRGB(textDict['border']), width = borderWidth))
+## pdc.DrawRectangle(*bounds)
+
if background:
- pdc.SetBackground(wx.Brush(convertRGB(background)))
+ pdc.SetTextBackground(convertRGB(background))
pdc.SetBackgroundMode(wx.SOLID)
else:
- pdc.SetBackground(wx.TRANSPARENT_BRUSH)
pdc.SetBackgroundMode(wx.TRANSPARENT)
-
+
fn = self.parent.makePSFont(textDict)
-
+
pdc.SetFont(fn)
pdc.SetTextForeground(convertRGB(textDict['color']))
pdc.DrawRotatedText(textDict['text'], coords[0], coords[1], rot)
+
pdc.SetIdBounds(drawId, wx.Rect(*bounds))
self.Refresh()
pdc.EndDrawing()
More information about the grass-commit
mailing list