RSComposite>>shapeFromModel:
I found a bug:
c := RSComposite new.
c addShape: (RSBox new model: 42).
c addShape: (RSEllipse new model: 43).
c shapeFromModel: 42
returns nil
Somehow related, the class RSComposite has nodes and children as instance variables. That is weird. Why these?
Same as RSCanvas. RSComposite looks in nodes collection. instead of the entire shapes collection.
RSComposite >> #shapeFromModel: anObject
"Retreive a shape from a given model. Return nil if not found"
^ self nodes shapeFromModel: anObject
Then you should access to c shapes shapeFromModel: 42 or use: add: instead of addShape:
Is this issue related to the new method deepShapeFromModel:
Maybe we can change this method in this way
shapeFromModel: anObject
"Retreive a shape from a given model. Return nil if not found"
^ self shapes shapeFromModel: anObject
you can write it in 2 ways
c := RSComposite new.
c addShape: (RSBox new model: 42).
c addShape: (RSEllipse new model: 43).
c shapes shapeFromModel: 42
Or
c := RSComposite new.
c add: (RSBox new model: 42).
c add: (RSEllipse new model: 43).
c shapeFromModel: 42
Very similar to #287
By now user should query this objects with deepShapeFromModel: