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

ImageItem informs ViewBox when its size changes

Minor edits
parent fa354ea4
......@@ -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:
......
......@@ -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
......
......@@ -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)
......
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