Commit cd24530e authored by Luke Campagnola's avatar Luke Campagnola
Browse files

Bugfixes:

  - Corrected ImageItem.setRect transformation order  
  - PlotCurveItem uses nkPen for interpreting shadowPen arguments
  - PlotItem and PlotWidget wrap a few more missing methods from ViewBox
parent fbbe4ef9
......@@ -128,8 +128,8 @@ class ImageItem(GraphicsObject):
def setRect(self, rect):
"""Scale and translate the image to fit within rect."""
self.resetTransform()
self.scale(rect.width() / self.width(), rect.height() / self.height())
self.translate(rect.left(), rect.top())
self.scale(rect.width() / self.width(), rect.height() / self.height())
def setImage(self, image=None, autoLevels=None, **kargs):
"""
......
......@@ -35,7 +35,8 @@ class PlotCurveItem(GraphicsObject):
else:
self.setPen(pen)
self.shadowPen = shadowPen
self.setShadowPen(shadowPen)
if y is not None:
self.updateData(y, x, copy)
......@@ -159,7 +160,7 @@ class PlotCurveItem(GraphicsObject):
self.update()
def setShadowPen(self, pen):
self.shadowPen = pen
self.shadowPen = fn.mkPen(pen)
self.update()
def setDownsampling(self, ds):
......
......@@ -134,7 +134,7 @@ class PlotItem(GraphicsWidget):
for m in [
'setXRange', 'setYRange', 'setXLink', 'setYLink',
'setRange', 'autoRange', 'viewRect', 'setMouseEnabled',
'enableAutoRange', 'disableAutoRange']:
'enableAutoRange', 'disableAutoRange', 'setAspectLocked']:
setattr(self, m, getattr(self.vb, m))
self.items = []
......
......@@ -23,7 +23,7 @@ class PlotWidget(GraphicsView):
self.plotItem = PlotItem(**kargs)
self.setCentralItem(self.plotItem)
## Explicitly wrap methods from plotItem
for m in ['addItem', 'removeItem', 'autoRange', 'clear', 'setXRange', 'setYRange', 'setRange']:
for m in ['addItem', 'removeItem', 'autoRange', 'clear', 'setXRange', 'setYRange', 'setRange', 'setAspectLocked', 'setMouseEnabled']:
setattr(self, m, getattr(self.plotItem, m))
#QtCore.QObject.connect(self.plotItem, QtCore.SIGNAL('viewChanged'), self.viewChanged)
self.plotItem.sigRangeChanged.connect(self.viewRangeChanged)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment