[GRASS-SVN] r56485 - grass/branches/releasebranch_6_4/gui/wxpython/psmap
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed May 29 09:11:57 PDT 2013
Author: annakrat
Date: 2013-05-29 09:11:57 -0700 (Wed, 29 May 2013)
New Revision: 56485
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/psmap/frame.py
Log:
wxGUI/composer: fix multiline text on Windows (merge from trunk, r56363, r56368)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/psmap/frame.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/psmap/frame.py 2013-05-29 15:29:58 UTC (rev 56484)
+++ grass/branches/releasebranch_6_4/gui/wxpython/psmap/frame.py 2013-05-29 16:11:57 UTC (rev 56485)
@@ -1844,16 +1844,17 @@
coords = self.instruction[id]['coords']# recalculate coordinates, they are not equal to BB
self.instruction[id]['coords'] = coords = [(int(coord) - view[i]) * zoomFactor
for i, coord in enumerate(coords)]
- self.DrawRotText(pdc = self.pdcObj, drawId = id, textDict = self.instruction[id],
- coords = coords, bounds = oRect )
extent = self.parent.getTextExtent(textDict = self.instruction[id])
if self.instruction[id]['rotate']:
rot = float(self.instruction[id]['rotate'])
else:
rot = 0
+ self.instruction[id]['rect'] = bounds = self.parent.getModifiedTextBounds(coords[0], coords[1], extent, rot)
+ self.DrawRotText(pdc = self.pdcObj, drawId = id, textDict = self.instruction[id],
+ coords = coords, bounds = bounds )
- self.instruction[id]['rect'] = bounds = self.parent.getModifiedTextBounds(coords[0], coords[1], extent, rot)
self.pdcObj.SetIdBounds(id, bounds)
+
elif type == 'northArrow':
self.Draw(pen = self.pen[type], brush = self.brush[type], pdc = self.pdcObj,
drawid = id, pdctype = 'bitmap', bb = oRect)
@@ -2028,7 +2029,6 @@
else:
rot = 0
- fontsize = textDict['fontsize'] * self.currScale
if textDict['background'] != 'none':
background = textDict['background']
else:
@@ -2055,8 +2055,11 @@
fn = self.parent.makePSFont(textDict)
pdc.SetFont(fn)
- pdc.SetTextForeground(convertRGB(textDict['color']))
- pdc.DrawRotatedText(textDict['text'], coords[0], coords[1], rot)
+ pdc.SetTextForeground(convertRGB(textDict['color']))
+ if rot == 0:
+ pdc.DrawLabel(text=textDict['text'], rect=bounds)
+ else:
+ pdc.DrawRotatedText(textDict['text'], coords[0], coords[1], rot)
pdc.SetIdBounds(drawId, wx.Rect(*bounds))
self.Refresh()
More information about the grass-commit
mailing list