[Newbies] How to rescale child Morph when father does ?

Nicola Mingotti nmingotti at gmail.com
Tue Jul 30 07:43:07 UTC 2019


Considering this short snippet:
"Prepare the rectangle containing the drawing."
r := RectangleMorph new.
r extent: 500 at 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.

1] I see that the PolygonMorph 'p' translates with its father the RectangleMorph 'r'. Ok, as expected.

2] If I rescale 'r' with the Halo yellow button, 'p' is not rescaled and the effect is unexpected. 

How can I make 'p' rescale with its father ? 


More information about the Beginners mailing list