Bugfixes:

- fixed PlotCurveItem generating exceptions when data has length=0
- fixed ImageView.setImage only working once
This commit is contained in:
Luke Campagnola 2014-01-01 20:22:13 -05:00
parent 21c1686221
commit 95dd56bdb6
3 changed files with 8 additions and 3 deletions

View File

@ -35,6 +35,8 @@ pyqtgraph-0.9.9 [unreleased]
- fixed ImageItem handling of rgb images - fixed ImageItem handling of rgb images
- fixed makeARGB re-ordering of color channels - fixed makeARGB re-ordering of color channels
- fixed unicode usage in AxisItem tick strings - fixed unicode usage in AxisItem tick strings
- fixed PlotCurveItem generating exceptions when data has length=0
- fixed ImageView.setImage only working once
pyqtgraph-0.9.8 2013-11-24 pyqtgraph-0.9.8 2013-11-24

View File

@ -393,16 +393,18 @@ class PlotCurveItem(GraphicsObject):
if self.path is None: if self.path is None:
x,y = self.getData() x,y = self.getData()
if x is None or len(x) == 0 or y is None or len(y) == 0: if x is None or len(x) == 0 or y is None or len(y) == 0:
return QtGui.QPainterPath() self.path = QtGui.QPainterPath()
self.path = self.generatePath(*self.getData()) else:
self.path = self.generatePath(*self.getData())
self.fillPath = None self.fillPath = None
self._mouseShape = None self._mouseShape = None
return self.path return self.path
@debug.warnOnException ## raising an exception here causes crash @debug.warnOnException ## raising an exception here causes crash
def paint(self, p, opt, widget): def paint(self, p, opt, widget):
profiler = debug.Profiler() profiler = debug.Profiler()
if self.xData is None: if self.xData is None or len(self.xData) == 0:
return return
if HAVE_OPENGL and getConfigOption('enableExperimental') and isinstance(widget, QtOpenGL.QGLWidget): if HAVE_OPENGL and getConfigOption('enableExperimental') and isinstance(widget, QtOpenGL.QGLWidget):

View File

@ -198,6 +198,7 @@ class ImageView(QtGui.QWidget):
if not isinstance(img, np.ndarray): if not isinstance(img, np.ndarray):
raise Exception("Image must be specified as ndarray.") raise Exception("Image must be specified as ndarray.")
self.image = img self.image = img
self.imageDisp = None
if xvals is not None: if xvals is not None:
self.tVals = xvals self.tVals = xvals