ImageItem informs ViewBox when its size changes

Minor edits
This commit is contained in:
Luke Campagnola 2013-06-19 19:32:55 -04:00
parent fa354ea4a3
commit cbd0efe79a
3 changed files with 7 additions and 4 deletions

View File

@ -196,10 +196,12 @@ class ImageItem(GraphicsObject):
return
else:
gotNewData = True
if self.image is None or image.shape != self.image.shape:
self.prepareGeometryChange()
shapeChanged = (self.image is None or image.shape != self.image.shape)
self.image = image.view(np.ndarray)
if shapeChanged:
self.prepareGeometryChange()
self.informViewBoundsChanged()
prof.mark('1')
if autoLevels is None:

View File

@ -92,7 +92,6 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
# Thanks, Ulrich!
# cycle for a match
for sample, label in self.items:
print label.text, name
if label.text == name: # hit
self.items.remove( (sample, label) ) # remove from itemlist
self.layout.removeItem(sample) # remove from layout

View File

@ -35,6 +35,8 @@ for k, c in coords.items():
def drawSymbol(painter, symbol, size, pen, brush):
if symbol is None:
return
painter.scale(size, size)
painter.setPen(pen)
painter.setBrush(brush)