Browse Source

wxNviz: fix weird vector rendering on Mac in https://trac.osgeo.org/grass/ticket/2381 (merge from trunk, https://trac.osgeo.org/grass/changeset/61477)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@61478 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 10 years ago
parent
commit
c021b9fb8f
1 changed files with 4 additions and 5 deletions
  1. 4 5
      gui/wxpython/nviz/mapwindow.py

+ 4 - 5
gui/wxpython/nviz/mapwindow.py

@@ -80,17 +80,16 @@ class GLWindow(MapWindowBase, glcanvas.GLCanvas):
         self.lmgr = lmgr
         self.lmgr = lmgr
         self.frame = frame
         self.frame = frame
 
 
-        attribs=[WX_GL_RGBA, WX_GL_DOUBLEBUFFER]
         # for wxGTK we need to set WX_GL_DEPTH_SIZE to draw vectors correctly
         # for wxGTK we need to set WX_GL_DEPTH_SIZE to draw vectors correctly
         # but we don't know the right value
         # but we don't know the right value
         # in wxpython 2.9, there is IsDisplaySupported
         # in wxpython 2.9, there is IsDisplaySupported
         if CheckWxVersion(version=[2, 8, 11]) and \
         if CheckWxVersion(version=[2, 8, 11]) and \
            sys.platform not in ('win32', 'darwin'):
            sys.platform not in ('win32', 'darwin'):
             depthBuffer = int(UserSettings.Get(group='display', key='nvizDepthBuffer', subkey='value'))
             depthBuffer = int(UserSettings.Get(group='display', key='nvizDepthBuffer', subkey='value'))
-            attribs.extend([WX_GL_DEPTH_SIZE, depthBuffer])
-        attribs.append(0)
-
-        glcanvas.GLCanvas.__init__(self, parent, id, attribList=attribs)
+            attribs = [WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, depthBuffer, 0]
+            glcanvas.GLCanvas.__init__(self, parent, id, attribList=attribs)
+        else:
+            glcanvas.GLCanvas.__init__(self, parent, id)
 
 
         MapWindowBase.__init__(self, parent=parent, giface=giface, Map=Map)
         MapWindowBase.__init__(self, parent=parent, giface=giface, Map=Map)
         self.Hide()
         self.Hide()