Merge pull request #1554 from ixjlyons/glscatterplotitem-nodata
Disable paint in GLScatterPlotItem if it has no data
This commit is contained in:
commit
d1bcbf8ec0
@ -1,3 +1,4 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
from OpenGL.GL import *
|
from OpenGL.GL import *
|
||||||
from OpenGL.arrays import vbo
|
from OpenGL.arrays import vbo
|
||||||
from .. GLGraphicsItem import GLGraphicsItem
|
from .. GLGraphicsItem import GLGraphicsItem
|
||||||
@ -14,7 +15,7 @@ class GLScatterPlotItem(GLGraphicsItem):
|
|||||||
GLGraphicsItem.__init__(self)
|
GLGraphicsItem.__init__(self)
|
||||||
glopts = kwds.pop('glOptions', 'additive')
|
glopts = kwds.pop('glOptions', 'additive')
|
||||||
self.setGLOptions(glopts)
|
self.setGLOptions(glopts)
|
||||||
self.pos = []
|
self.pos = None
|
||||||
self.size = 10
|
self.size = 10
|
||||||
self.color = [1.0,1.0,1.0,0.5]
|
self.color = [1.0,1.0,1.0,0.5]
|
||||||
self.pxMode = True
|
self.pxMode = True
|
||||||
@ -99,6 +100,9 @@ class GLScatterPlotItem(GLGraphicsItem):
|
|||||||
##glPointParameterfv(GL_POINT_SIZE_MIN, (0,))
|
##glPointParameterfv(GL_POINT_SIZE_MIN, (0,))
|
||||||
|
|
||||||
def paint(self):
|
def paint(self):
|
||||||
|
if self.pos is None:
|
||||||
|
return
|
||||||
|
|
||||||
self.setupGLState()
|
self.setupGLState()
|
||||||
|
|
||||||
glEnable(GL_POINT_SPRITE)
|
glEnable(GL_POINT_SPRITE)
|
||||||
|
Loading…
Reference in New Issue
Block a user