How do I get the Scaling Halo handle

Scott Wallace scott.wallace at squeakland.org
Tue Sep 14 09:06:25 UTC 2004


At 11:39 PM -0700 9/13/04, darius at inglang.com wrote:
>  > (2)  Secondly, note that if a morph is "flexed", i.e. if it has been
>>  rotated (a sure sign of this state is that the yellow resize handle
>>  has turned to something more like pale-orange) then resizing with
>>  that pale-orange resize handle will also be aspect-ratio preserving.
>
>True with SketchMorphs.
>But not true with the PolygonMorph.
>I've tried your directions with the PolygonMorph but the pale-orange handle
>never appears, nor does it behave as you described.

Hi, Darius,

Actually, I believe this trick works with every kind of morph 
*except* for PolygonMorphs.

PolygonMorphs, uniquely among morphs, never get "flexed", i.e. they 
never agree to acquire a TransformationMorph shell, hence they never 
are able to benefit from the scaling that is afforded by such a 
shell.  (This applies equally to subclasses of PolygonMorph, such as 
StarMorph and CurveMorph, of course.)

Look at method PolygonMorph >> addFlexShellIfNecessary.  The comment 
there says "When scaling or rotating from a halo, I can do this 
without a flex shell."

So yes, you're right, this is a case that slips through the cracks: 
it's possible, using the pale-orange handle, to preserve aspect ratio 
while resizing every kind of Morph *except* PolygonMorphs.  :-(

Here's a workaround, however:  embed your polygon in a borderless and 
transparent RectangleMorph, and apply the flexing trick on the 
RectangleMorph instead.  This will work, but at the price of jaggies.

Incidentally, my claim that shift-drag of the resize handle would 
yield an aspect-preserving resize on SketchMorphs was *wrong*.  It 
was correct for the system I was checking it in as I wrote, but 
certainly not for any released Squeak version.

Finally, it shouldn't be hard to modify PolygonMorph such that 
shift-resize actually did the proportional scaling you're hoping for.

Cheers,

  -- Scott



More information about the Squeak-dev mailing list