瀏覽代碼

wxGUI/mapwindow: support background color for text overlays

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58473 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 11 年之前
父節點
當前提交
757c804128
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      gui/wxpython/mapwin/buffered.py

+ 3 - 0
gui/wxpython/mapwin/buffered.py

@@ -343,6 +343,9 @@ class BufferedMapWindow(MapWindowBase, wx.Window):
             w, h = self.GetFullTextExtent(img['text'])[0:2]
             pdc.SetFont(img['font'])
             pdc.SetTextForeground(img['color'])
+            if 'background' in img:
+                pdc.SetBackgroundMode(wx.SOLID)
+                pdc.SetTextBackground(img['background'])
             coords, bbox = self.TextBounds(img)
             if rotation == 0:
                 pdc.DrawText(img['text'], coords[0], coords[1])