HandMorph etc #grabTransform

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

HandMorph etc #grabTransform

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

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.

I doubt this code was stuck in for the fun of it so I feel sure somebody must have had a use for it in the past. Does anyone remember anything about it?

Oh joy; power cut. Hopefully the UPS will last long enough to get this sent.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- Overdue for deincarnation.



Reply | Threaded
Open this post in threaded view
|

Re: HandMorph etc #grabTransform

timrowledge
With power back, I can do some googling and it seems nothing has ever really been done with #grabTransform that has leaked out into the public googlesphere.

Somebody somewhere must remember what it was intended for?


> On 10-12-2015, at 2:47 PM, tim Rowledge <[hidden email]> 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.
>
> 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.
>
> I doubt this code was stuck in for the fun of it so I feel sure somebody must have had a use for it in the past. Does anyone remember anything about it?
>
> Oh joy; power cut. Hopefully the UPS will last long enough to get this sent.



tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Ignoranus (n): A person who's both stupid and an asshole.



Reply | Threaded
Open this post in threaded view
|

Re: HandMorph etc #grabTransform

Karl Ramberg
In reply to this post by timrowledge


On Thu, Dec 10, 2015 at 11:47 PM, tim Rowledge <[hidden email]> 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.


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 ?

Best,
Karl


I doubt this code was stuck in for the fun of it so I feel sure somebody must have had a use for it in the past. Does anyone remember anything about it?

Oh joy; power cut. Hopefully the UPS will last long enough to get this sent.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- Overdue for deincarnation.






Reply | Threaded
Open this post in threaded view
|

Re: HandMorph etc #grabTransform

timrowledge

> On 12-12-2015, at 2:53 AM, karl ramberg <[hidden email]> wrote:
>
>
>
> On Thu, Dec 10, 2015 at 11:47 PM, tim Rowledge <[hidden email]> 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; [hidden email]; http://www.rowledge.org/tim
Useful Latin Phrases:- Nihil curo de ista tua stulta superstitione = I'm not interested in your dopey religious cult.



Reply | Threaded
Open this post in threaded view
|

Re: HandMorph etc #grabTransform

Nicolai Hess-3-2


2015-12-14 2:19 GMT+01:00 tim Rowledge <[hidden email]>:

> On 12-12-2015, at 2:53 AM, karl ramberg <[hidden email]> wrote:
>
>
>
> On Thu, Dec 10, 2015 at 11:47 PM, tim Rowledge <[hidden email]> 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; [hidden email]; http://www.rowledge.org/tim
Useful Latin Phrases:- Nihil curo de ista tua stulta superstitione = I'm not interested in your dopey religious cult.






Reply | Threaded
Open this post in threaded view
|

Re: HandMorph etc #grabTransform

timrowledge
A solution to at least part of my last-month problem -
> > 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.

It seems that the test at the top of HandMorph>dropMorph:event: fails because the default implementation of #shouldDropOnMouseUp expects a non-nil result from #formerPosition. A TransformationMorph that has been added as a flexShell has no such property and so trying to drop (as part of a mouse-up) something wrapped in one will always fail.

My best suggestion is to over-ride shouldDropOnMouseUp in TransformationMorph as
^self hasProperty: #addedFlexAtGrab
It seem to work for my case so far, which is nice. Now maybe I can work out why it drops the damned morph in the wrong place...

Any other ideas on a good way to do this?

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- Talks to plants on their own level.