[squeak-dev] Rotating Morphs; how to rotate about a point other than the centre of bounds?

tim Rowledge tim at rowledge.org
Thu Apr 6 23:23:16 UTC 2017


Thanks Bob,

> On 06-04-2017, at 3:52 PM, Bob Arning <arning315 at comcast.net> wrote:
> 
> | secondHand |
> secondHand _ Morph new extent: 3 at 50; color: Color yellow.
> holder _ Morph new extent: 1 at 1; position: 100 at 100.
> secondHand bottomRight: 0 at 0.
> holder openInWorld.
> flex _ holder addFlexShell.
> holder addMorph: secondHand.
> 1 to: 30 do: [ :i |
>     flex angle: Float pi * (i/30.0) negated.
>     World displayWorldSafely.
>     (Delay forSeconds: 1) wait
> ].
> flex explore


That’s… interesting. So by putting the morph I care about into a ‘fake morph’ that doesn’t even enclose it and rotating that in a TransformationMorph it does pretty much what I need. Really clever and completely not what I’d ever expect.

Has to be a more easily usable approach that we can come up with to do this, surely. What is the purpose of the entire rotationCenter thing if not to make it be the center of any following rotations?

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
May the bugs of many programs nest on your hard drive.




More information about the Squeak-dev mailing list