Disable paint in GLScatterPlotItem if it has no data

This commit is contained in:
Kenneth Lyons 2021-02-06 15:31:54 -08:00
parent e7ceebd867
commit a1064345d3

View File

@ -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)