ImageItem informs ViewBox when its size changes
Minor edits
This commit is contained in:
parent
fa354ea4a3
commit
cbd0efe79a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user