Skip to content

Commit

Permalink
Merge pull request pyqtgraph#194 from ixjlyons/gl-background
Browse files Browse the repository at this point in the history
Use glColor instead of mkColor to set GLViewWidget background color.
  • Loading branch information
campagnola committed Aug 8, 2015
2 parents f224936 + 9ea38a1 commit 1036edf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyqtgraph/opengl/GLViewWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ def initializeGL(self):
def setBackgroundColor(self, *args, **kwds):
"""
Set the background color of the widget. Accepts the same arguments as
pg.mkColor().
pg.mkColor() and pg.glColor().
"""
self.opts['bgcolor'] = fn.mkColor(*args, **kwds)
self.opts['bgcolor'] = fn.glColor(*args, **kwds)
self.update()

def getViewport(self):
Expand Down Expand Up @@ -174,7 +174,7 @@ def paintGL(self, region=None, viewport=None, useItemNames=False):
self.setProjection(region=region)
self.setModelview()
bgcolor = self.opts['bgcolor']
glClearColor(bgcolor.red(), bgcolor.green(), bgcolor.blue(), 1.0)
glClearColor(*bgcolor)
glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT )
self.drawItemTree(useItemNames=useItemNames)

Expand Down

0 comments on commit 1036edf

Please sign in to comment.