I am exploring Squeak, release 5.2 in MacOS.
I am drawing lines (PolygonMorph) inside a RectangleMorph 'r'. When I translate 'r' the lines translate but when I rescale 'r' the lines do not rescale.
Run the snipped below. Then with the Halo translate and resize the rectangle 'r'. You will see line 'p' get translated but not rescaled.
r := RectangleMorph new.
"[Pharo] r:= Morph.new."
r extent: 500@500.
r openInWindow.
p := PolygonMorph
vertices: {(r left)@(r top). (r right)@(r bottom)}
color: Color white borderWidth: 2 borderColor: Color white.
r addMorph: p.
How can I get 'p' to rescale ?
bye
This may not be the complete answer you are looking for, but sharing what I did, might help you to make some progress with your interesting problem.
'add halo'somewhere and right-clicked to bring all methods with that literal.#addHalo:as the associated message to the menu item.haltto debug#addHalo:.addGrow:with:to the morph.addGrow:with:sendssetExtentFromHalo:and that this sendsextent:.My conclusion is that you would need a new subclass of
RectangleMorphthat resizes all its sub-morphs, proportionally, when it receivessetExtentFromHalo:. Something on the lines ofGive this a try (I haven't), and let us know how it went.