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

John-Reed Maffeo jrmaffeo at gmail.com
Fri Aug 2 18:36:08 UTC 2019


Nicola,

This command will rescale the polygonMorph. I am not sure how it is used in
your example.

1. Run your sample code and create the rectangle.
2. Use the Halo to resize the parent and make sure to maintain the aspect
ratio
3. Launch Explore from the Halo.
4. Find the polygon submorph and select it.
5. In the code space at the bottom of the Explorer do "self bounds: self
owner bounds"

Probably not much help, but perhaps a hint to something that will.

-jrm

On Tue, Jul 30, 2019 at 12:43 AM Nicola Mingotti <nmingotti at gmail.com>
wrote:

> Hi,
>
> 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 ?
>
> bye
> Nicola
>
>
>
>
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20190802/a742c869/attachment.html>


More information about the Beginners mailing list