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