ImageItem informs ViewBox when its size changes
Minor edits
This commit is contained in:
parent
fa354ea4a3
commit
cbd0efe79a
@ -196,9 +196,11 @@ class ImageItem(GraphicsObject):
|
|||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
gotNewData = True
|
gotNewData = True
|
||||||
if self.image is None or image.shape != self.image.shape:
|
shapeChanged = (self.image is None or image.shape != self.image.shape)
|
||||||
self.prepareGeometryChange()
|
|
||||||
self.image = image.view(np.ndarray)
|
self.image = image.view(np.ndarray)
|
||||||
|
if shapeChanged:
|
||||||
|
self.prepareGeometryChange()
|
||||||
|
self.informViewBoundsChanged()
|
||||||
|
|
||||||
prof.mark('1')
|
prof.mark('1')
|
||||||
|
|
||||||
|
@ -92,7 +92,6 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor):
|
|||||||
# Thanks, Ulrich!
|
# Thanks, Ulrich!
|
||||||
# cycle for a match
|
# cycle for a match
|
||||||
for sample, label in self.items:
|
for sample, label in self.items:
|
||||||
print label.text, name
|
|
||||||
if label.text == name: # hit
|
if label.text == name: # hit
|
||||||
self.items.remove( (sample, label) ) # remove from itemlist
|
self.items.remove( (sample, label) ) # remove from itemlist
|
||||||
self.layout.removeItem(sample) # remove from layout
|
self.layout.removeItem(sample) # remove from layout
|
||||||
|
@ -35,6 +35,8 @@ for k, c in coords.items():
|
|||||||
|
|
||||||
|
|
||||||
def drawSymbol(painter, symbol, size, pen, brush):
|
def drawSymbol(painter, symbol, size, pen, brush):
|
||||||
|
if symbol is None:
|
||||||
|
return
|
||||||
painter.scale(size, size)
|
painter.scale(size, size)
|
||||||
painter.setPen(pen)
|
painter.setPen(pen)
|
||||||
painter.setBrush(brush)
|
painter.setBrush(brush)
|
||||||
|
Loading…
Reference in New Issue
Block a user