[squeak-dev] HandMorph etc #grabTransform

tim Rowledge tim at rowledge.org
Mon Dec 14 01:19:55 UTC 2015


> 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; 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.




More information about the Squeak-dev mailing list