[Newbies] How to rescale child Morph when father does ?
Nicola Mingotti
nmingotti at gmail.com
Sun Aug 4 00:55:09 UTC 2019
Hi John,
Thank you for your suggestion.
In StackOverflow a guy suggested something else and also has given me
some hints on how to look for solutions myself. See here:
https://stackoverflow.com/questions/57269261/how-to-rescale-submorph-when-the-container-does/57279752#57279752
It will take me a while to solve this, there are still a lot of more
fundamental things that i do not know and I need to get them sorted out.
bye
Nicola
On 8/2/19 8:36 PM, John-Reed Maffeo wrote:
> 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
> <mailto: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
> <mailto:Beginners at lists.squeakfoundation.org>
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
>
> _______________________________________________
> 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/20190804/589106d7/attachment.html>
More information about the Beginners
mailing list