[squeak-dev] HandMorph etc #grabTransform

Nicolai Hess nicolaihess at gmail.com
Mon Dec 14 09:26:20 UTC 2015


2015-12-14 2:19 GMT+01:00 tim Rowledge <tim at rowledge.org>:

>
> > On 12-12-2015, at 2:53 AM, karl ramberg <karlramberg at gmail.com> wrote:
> >
> >
> >
> > On Thu, Dec 10, 2015 at 11:47 PM, tim Rowledge <tim at rowledge.org> wrote:
> > Has anybody used the #grabTransform message that is sent by HandMorph as
> part of picking up a Morph? Every use I can find of it seems to set it to
> an Identity transform and trying to use it for make my dragged morph appear
> half-size is not working in a very understandable manner.
> >
> > I think this is used for moving a morph that is transformed and also
> grabbing a duplicated morph that is transformed.
>
> Actually it doesn’t seem to be;


It makes a difference, if the visible position and orientation is a
composition from multiple transformed morphs.
For example:

e:=EllipseMorph new .
e addMorphBack:StringMorph new.
e openInHand

Now
- show halo for ellipse morph
-  rotate the ellipse morph
- show halo for string morph
- rotate string morph
- grab or duplicate the string morph
-> new string morphs transform automatically gets the combined
transformation of the original string morph and the ellipse morph.




> a morph that has been rotated/scaled/etc by manipulating the halo gets a
> FlexMorph shell built around it and that is dragged and then when you drop
> the composite the flex shell is stripped away; which seems  pretty
> heavyweight way to do it to be honest.
>
> >
> >
> > HandMorph>grabMorph:from: is the major player here; it asks the
> formerOwner for the grabTransform (without specifying for which grabbed
> morph, which seems odd) and uses that along withe formerOwner’s transform
> to do things to the grabbed morph. If I make my owner-morph implement
> grabTransform to return an identity transform, the grabbing works as
> normal. If I provide atransform that does any scaling (which is what I want
> to use) then
> > a) the positions and offsets get all screwy
> > b) dropping doesn’t work the same - you have to drop the morph and then
> click-release again to get it to actually drop. That part really confuses
> me right now.
> >
> > Maybe attachMorph: will work easier as you can do the trickery to the
> morph and just attach it to the hand ?
>
> We can’t use attachMorph: since … oh wait, I see what you mean. I was
> about to say that grabbing the morph prevents us but of course the code is
> actually #startDrag: and we get to choose to use attach or grab. Yeah, that
> should work I guess, though I did some experiments with it before noticing
> the grabTransform stuff; you can get all sorts of surprises if you wrap
> your morph in a TransformationMorph and forget to unwrap it on drop.
>
> If nobody has any clue about what it was originally for, what it was ever
> used for or if any surviving code has a use for it then we should remove it
> (or rework it to do something helpful).
>
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Useful Latin Phrases:- Nihil curo de ista tua stulta superstitione = I'm
> not interested in your dopey religious cult.
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20151214/56375124/attachment.htm


More information about the Squeak-dev mailing list