You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Yishay Weiss <yi...@hotmail.com> on 2018/12/19 09:55:24 UTC

DragEvent.clientY

Any idea what it’s used for? Is it supposed to be the same as MouseEvent.clientY ? If so, why do we have this sequence in DragEvent.createEvent() (event being MouseEvent)?

                                                                var localPoint:Point = new Point(event.screenX, event.screenY);
                                                                var clientPoint:Point = PointUtils.localToGlobal(localPoint, event.target);
                                                                de.clientX = clientPoint.x;
                                                                de.clientY = clientPoint.y;

I’d like to use it for SensitiveSingleSelectionDropTargetBead but the values don’t make sense to me. I don’t see it being used anywhere in the framework right now.

Re: DragEvent.clientY

Posted by Harbs <ha...@gmail.com>.
IIRC, that was something I fixed.

I’m pretty sure we can do away with DragEventBase and simplify DragEvent. I think that either Yishay or I will try that next week.

Harbs

> On Dec 21, 2018, at 9:59 AM, Alex Harui <ah...@adobe.com.INVALID> wrote:
> 
> I think with Google Closure Library, we never actually get a MouseEvent and get a BrowserEvent instead.  DragEventBase abstracts the platform class of the mouse event.
> 
> -Alex
> 
> On 12/20/18, 11:46 PM, "Harbs" <harbs.lists@gmail.com <ma...@gmail.com>> wrote:
> 
>    When I looked at the class, I didn’t understand why it didn’t *actually* subclass MouseEvent. What’s the purpose of DragEventBase?
> 
>> On Dec 21, 2018, at 9:01 AM, Alex Harui <ah...@adobe.com.INVALID> wrote:
>> 
>> Ah, ok, I didn't notice the IFrame.  The goal is to have DragEvent appear to subclass MouseEvent, so whatever values a MouseEvent would have, the DragEvent should have.
>> 
>> Thanks,
>> -Alex
>> 
>> On 12/20/18, 11:23 AM, "Harbs" <ha...@gmail.com> wrote:
>> 
>>> I think clientX/Y does depend on the target.  In the link [2], there is an example that you can play with, and clientX/Y is not global coordinates.  MDN is usually good doc, but I think the doc for clientX/Y is not well-written.
>> 
>>   It does not depend on the target. It’s global relative to the *window*. The example on that page is within an iframe, so it’s relative to that. I believe that in Royale the global space we should be concerned about is the application’s Window. That makes clientX/Y a good choice.
>> 
>>   https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F6073505%2Fwhat-is-the-difference-between-screenx-y-clientx-y-and-pagex-y&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=L8hujvkNXKWc0Z0sYT5MD7wspljqyzyxvSErjXEHfm0%3D&amp;reserved=0 <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F6073505%2Fwhat-is-the-difference-between-screenx-y-clientx-y-and-pagex-y&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=L8hujvkNXKWc0Z0sYT5MD7wspljqyzyxvSErjXEHfm0%3D&amp;reserved=0> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F6073505%2Fwhat-is-the-difference-between-screenx-y-clientx-y-and-pagex-y&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=L8hujvkNXKWc0Z0sYT5MD7wspljqyzyxvSErjXEHfm0%3D&amp;reserved=0 <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F6073505%2Fwhat-is-the-difference-between-screenx-y-clientx-y-and-pagex-y&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=L8hujvkNXKWc0Z0sYT5MD7wspljqyzyxvSErjXEHfm0%3D&amp;reserved=0>>
>> 
>>> On Dec 20, 2018, at 8:01 PM, Alex Harui <aharui@adobe.com.INVALID <ma...@adobe.com.INVALID>> wrote:
>>> 
>>> I think clientX/Y does depend on the target.  In the link [2], there is an example that you can play with, and clientX/Y is not global coordinates.  MDN is usually good doc, but I think the doc for clientX/Y is not well-written.
>>> 
>>> -Alex
>>> 
>>> On 12/20/18, 5:48 AM, "Yishay Weiss" <yishayjobs@hotmail.com <ma...@hotmail.com>> wrote:
>>> 
>>>  Actually, creating localX/localY in HTML is expensive so maybe not a PAYG solution.
>>> 
>>> 
>>> 
>>>  I suggest to just have clientX/Y mirror the mouse event and let listeners figure out what they need similar to what I did here [1].
>>> 
>>> 
>>> 
>>>  Thoughts?
>>> 
>>> 
>>> 
>>>  [1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-asjs%2Fblob%2Ff6733066124309c61fb054b10439cc3551ddfaed%2Fframeworks%2Fprojects%2FDragDrop%2Fsrc%2Fmain%2Froyale%2Forg%2Fapache%2Froyale%2Fhtml%2Fbeads%2FSensitiveSingleSelectionDropTargetBead.as%23L248&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=uvH3OZIDJ4BPnVFVZzNk0xgUfOO4yt33sUHs%2BP2WQqY%3D&amp;reserved=0 <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-asjs%2Fblob%2Ff6733066124309c61fb054b10439cc3551ddfaed%2Fframeworks%2Fprojects%2FDragDrop%2Fsrc%2Fmain%2Froyale%2Forg%2Fapache%2Froyale%2Fhtml%2Fbeads%2FSensitiveSingleSelectionDropTargetBead.as%23L248&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=uvH3OZIDJ4BPnVFVZzNk0xgUfOO4yt33sUHs%2BP2WQqY%3D&amp;reserved=0>
>>> 
>>> 
>>> 
>>>  ________________________________
>>>  From: Yishay Weiss <yishayjobs@hotmail.com <ma...@hotmail.com>>
>>>  Sent: Thursday, December 20, 2018 3:40:18 PM
>>>  To: dev@royale.apache.org <ma...@royale.apache.org>
>>>  Subject: RE: DragEvent.clientY
>>> 
>>> 
>>> 
>>>  The only place [1] in Flex code I see a similar logic is in DragProxy, where a change of targets transforms the localX/Y values. But I was referring to clientX/Y which should not depend on the target. As I understand [2] it, is just the position of the pointer in the browser window.
>>> 
>>> 
>>> 
>>>  It could be that clientX/Y isn’t necessary in DragEvent.DRAG_OVER and that we only need to set localX/Y. That should be enough for my purposes using locaToGlobal.
>>> 
>>> 
>>> 
>>>  I’ll change it to that and let me know if you have objections.
>>> 
>>> 
>>> 
>>>  [1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fflex-sdk%2Fblob%2Fba414443032b49c45ff11b61db452c8a8f428bd8%2Fframeworks%2Fprojects%2Fframework%2Fsrc%2Fmx%2Fmanagers%2FdragClasses%2FDragProxy.as%23L353&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=XRN%2BP9nMG8i0yxafE0TVUtMP7W%2FMKSvkkXANAqz5%2FUI%3D&amp;reserved=0 <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fflex-sdk%2Fblob%2Fba414443032b49c45ff11b61db452c8a8f428bd8%2Fframeworks%2Fprojects%2Fframework%2Fsrc%2Fmx%2Fmanagers%2FdragClasses%2FDragProxy.as%23L353&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=XRN%2BP9nMG8i0yxafE0TVUtMP7W%2FMKSvkkXANAqz5%2FUI%3D&amp;reserved=0>
>>> 
>>> 
>>> 
>>>  [2]  https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FMouseEvent%2FclientX&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=uD7MjMSkCtiDn%2BS1pnjrEkypzo5XaTy%2BkPSkZR77w14%3D&amp;reserved=0 <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FMouseEvent%2FclientX&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=uD7MjMSkCtiDn%2BS1pnjrEkypzo5XaTy%2BkPSkZR77w14%3D&amp;reserved=0>
>>> 
>>> 
>>> 
>>>  ________________________________
>>>  From: Alex Harui <ah...@adobe.com.INVALID>
>>>  Sent: Wednesday, December 19, 2018 7:21:26 PM
>>>  To: dev@royale.apache.org
>>>  Subject: Re: DragEvent.clientY
>>> 
>>>  I suggest looking at the Flex code.  Some of this may have been ported without considering whether it is truly needed or not.  The key factor to consider is the event target and who is consuming the event.  IIRC, in Flex, the event target could be something other than the source or destination component, like the drag indicator, drop indicator and other things, but the DragEvent listeners are trying to track and compute destinations.  clientX/Y generally maps back to localX/Y in the Flex DragEvent.  It looks like this code is always using stage/screen coordinates which may be more consistent than using the event target's clientX/Y which will change as you drag over various things on the way to the final drop point.
>>> 
>>>  -Alex
>>> 
>>>  On 12/19/18, 1:55 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:
>>> 
>>>      Any idea what it’s used for? Is it supposed to be the same as MouseEvent.clientY ? If so, why do we have this sequence in DragEvent.createEvent() (event being MouseEvent)?
>>> 
>>>                                                                      var localPoint:Point = new Point(event.screenX, event.screenY);
>>>                                                                      var clientPoint:Point = PointUtils.localToGlobal(localPoint, event.target);
>>>                                                                      de.clientX = clientPoint.x;
>>>                                                                      de.clientY = clientPoint.y;
>>> 
>>>      I’d like to use it for SensitiveSingleSelectionDropTargetBead but the values don’t make sense to me. I don’t see it being used anywhere in the framework right now.


Re: DragEvent.clientY

Posted by Alex Harui <ah...@adobe.com.INVALID>.
I think with Google Closure Library, we never actually get a MouseEvent and get a BrowserEvent instead.  DragEventBase abstracts the platform class of the mouse event.

-Alex

On 12/20/18, 11:46 PM, "Harbs" <ha...@gmail.com> wrote:

    When I looked at the class, I didn’t understand why it didn’t *actually* subclass MouseEvent. What’s the purpose of DragEventBase?
    
    > On Dec 21, 2018, at 9:01 AM, Alex Harui <ah...@adobe.com.INVALID> wrote:
    > 
    > Ah, ok, I didn't notice the IFrame.  The goal is to have DragEvent appear to subclass MouseEvent, so whatever values a MouseEvent would have, the DragEvent should have.
    > 
    > Thanks,
    > -Alex
    > 
    > On 12/20/18, 11:23 AM, "Harbs" <ha...@gmail.com> wrote:
    > 
    >> I think clientX/Y does depend on the target.  In the link [2], there is an example that you can play with, and clientX/Y is not global coordinates.  MDN is usually good doc, but I think the doc for clientX/Y is not well-written.
    > 
    >    It does not depend on the target. It’s global relative to the *window*. The example on that page is within an iframe, so it’s relative to that. I believe that in Royale the global space we should be concerned about is the application’s Window. That makes clientX/Y a good choice.
    > 
    >    https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F6073505%2Fwhat-is-the-difference-between-screenx-y-clientx-y-and-pagex-y&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=L8hujvkNXKWc0Z0sYT5MD7wspljqyzyxvSErjXEHfm0%3D&amp;reserved=0 <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F6073505%2Fwhat-is-the-difference-between-screenx-y-clientx-y-and-pagex-y&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=L8hujvkNXKWc0Z0sYT5MD7wspljqyzyxvSErjXEHfm0%3D&amp;reserved=0>
    > 
    >> On Dec 20, 2018, at 8:01 PM, Alex Harui <ah...@adobe.com.INVALID> wrote:
    >> 
    >> I think clientX/Y does depend on the target.  In the link [2], there is an example that you can play with, and clientX/Y is not global coordinates.  MDN is usually good doc, but I think the doc for clientX/Y is not well-written.
    >> 
    >> -Alex
    >> 
    >> On 12/20/18, 5:48 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:
    >> 
    >>   Actually, creating localX/localY in HTML is expensive so maybe not a PAYG solution.
    >> 
    >> 
    >> 
    >>   I suggest to just have clientX/Y mirror the mouse event and let listeners figure out what they need similar to what I did here [1].
    >> 
    >> 
    >> 
    >>   Thoughts?
    >> 
    >> 
    >> 
    >>   [1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-asjs%2Fblob%2Ff6733066124309c61fb054b10439cc3551ddfaed%2Fframeworks%2Fprojects%2FDragDrop%2Fsrc%2Fmain%2Froyale%2Forg%2Fapache%2Froyale%2Fhtml%2Fbeads%2FSensitiveSingleSelectionDropTargetBead.as%23L248&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=uvH3OZIDJ4BPnVFVZzNk0xgUfOO4yt33sUHs%2BP2WQqY%3D&amp;reserved=0
    >> 
    >> 
    >> 
    >>   ________________________________
    >>   From: Yishay Weiss <yi...@hotmail.com>
    >>   Sent: Thursday, December 20, 2018 3:40:18 PM
    >>   To: dev@royale.apache.org
    >>   Subject: RE: DragEvent.clientY
    >> 
    >> 
    >> 
    >>   The only place [1] in Flex code I see a similar logic is in DragProxy, where a change of targets transforms the localX/Y values. But I was referring to clientX/Y which should not depend on the target. As I understand [2] it, is just the position of the pointer in the browser window.
    >> 
    >> 
    >> 
    >>   It could be that clientX/Y isn’t necessary in DragEvent.DRAG_OVER and that we only need to set localX/Y. That should be enough for my purposes using locaToGlobal.
    >> 
    >> 
    >> 
    >>   I’ll change it to that and let me know if you have objections.
    >> 
    >> 
    >> 
    >>   [1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fflex-sdk%2Fblob%2Fba414443032b49c45ff11b61db452c8a8f428bd8%2Fframeworks%2Fprojects%2Fframework%2Fsrc%2Fmx%2Fmanagers%2FdragClasses%2FDragProxy.as%23L353&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=XRN%2BP9nMG8i0yxafE0TVUtMP7W%2FMKSvkkXANAqz5%2FUI%3D&amp;reserved=0
    >> 
    >> 
    >> 
    >>   [2]  https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FMouseEvent%2FclientX&amp;data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&amp;sdata=uD7MjMSkCtiDn%2BS1pnjrEkypzo5XaTy%2BkPSkZR77w14%3D&amp;reserved=0
    >> 
    >> 
    >> 
    >>   ________________________________
    >>   From: Alex Harui <ah...@adobe.com.INVALID>
    >>   Sent: Wednesday, December 19, 2018 7:21:26 PM
    >>   To: dev@royale.apache.org
    >>   Subject: Re: DragEvent.clientY
    >> 
    >>   I suggest looking at the Flex code.  Some of this may have been ported without considering whether it is truly needed or not.  The key factor to consider is the event target and who is consuming the event.  IIRC, in Flex, the event target could be something other than the source or destination component, like the drag indicator, drop indicator and other things, but the DragEvent listeners are trying to track and compute destinations.  clientX/Y generally maps back to localX/Y in the Flex DragEvent.  It looks like this code is always using stage/screen coordinates which may be more consistent than using the event target's clientX/Y which will change as you drag over various things on the way to the final drop point.
    >> 
    >>   -Alex
    >> 
    >>   On 12/19/18, 1:55 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:
    >> 
    >>       Any idea what it’s used for? Is it supposed to be the same as MouseEvent.clientY ? If so, why do we have this sequence in DragEvent.createEvent() (event being MouseEvent)?
    >> 
    >>                                                                       var localPoint:Point = new Point(event.screenX, event.screenY);
    >>                                                                       var clientPoint:Point = PointUtils.localToGlobal(localPoint, event.target);
    >>                                                                       de.clientX = clientPoint.x;
    >>                                                                       de.clientY = clientPoint.y;
    >> 
    >>       I’d like to use it for SensitiveSingleSelectionDropTargetBead but the values don’t make sense to me. I don’t see it being used anywhere in the framework right now.
    >> 
    >> 
    >> 
    >> 
    > 
    > 
    > 
    
    


Re: DragEvent.clientY

Posted by Harbs <ha...@gmail.com>.
When I looked at the class, I didn’t understand why it didn’t *actually* subclass MouseEvent. What’s the purpose of DragEventBase?

> On Dec 21, 2018, at 9:01 AM, Alex Harui <ah...@adobe.com.INVALID> wrote:
> 
> Ah, ok, I didn't notice the IFrame.  The goal is to have DragEvent appear to subclass MouseEvent, so whatever values a MouseEvent would have, the DragEvent should have.
> 
> Thanks,
> -Alex
> 
> On 12/20/18, 11:23 AM, "Harbs" <ha...@gmail.com> wrote:
> 
>> I think clientX/Y does depend on the target.  In the link [2], there is an example that you can play with, and clientX/Y is not global coordinates.  MDN is usually good doc, but I think the doc for clientX/Y is not well-written.
> 
>    It does not depend on the target. It’s global relative to the *window*. The example on that page is within an iframe, so it’s relative to that. I believe that in Royale the global space we should be concerned about is the application’s Window. That makes clientX/Y a good choice.
> 
>    https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F6073505%2Fwhat-is-the-difference-between-screenx-y-clientx-y-and-pagex-y&amp;data=02%7C01%7Caharui%40adobe.com%7Cb256f79f5e02413ec5f208d666b0ac3b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809306326176299&amp;sdata=wAYsjF2npgyibZApmnaucPv93FqFb4OJ0iq0mwfnMpA%3D&amp;reserved=0 <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F6073505%2Fwhat-is-the-difference-between-screenx-y-clientx-y-and-pagex-y&amp;data=02%7C01%7Caharui%40adobe.com%7Cb256f79f5e02413ec5f208d666b0ac3b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809306326176299&amp;sdata=wAYsjF2npgyibZApmnaucPv93FqFb4OJ0iq0mwfnMpA%3D&amp;reserved=0>
> 
>> On Dec 20, 2018, at 8:01 PM, Alex Harui <ah...@adobe.com.INVALID> wrote:
>> 
>> I think clientX/Y does depend on the target.  In the link [2], there is an example that you can play with, and clientX/Y is not global coordinates.  MDN is usually good doc, but I think the doc for clientX/Y is not well-written.
>> 
>> -Alex
>> 
>> On 12/20/18, 5:48 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:
>> 
>>   Actually, creating localX/localY in HTML is expensive so maybe not a PAYG solution.
>> 
>> 
>> 
>>   I suggest to just have clientX/Y mirror the mouse event and let listeners figure out what they need similar to what I did here [1].
>> 
>> 
>> 
>>   Thoughts?
>> 
>> 
>> 
>>   [1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-asjs%2Fblob%2Ff6733066124309c61fb054b10439cc3551ddfaed%2Fframeworks%2Fprojects%2FDragDrop%2Fsrc%2Fmain%2Froyale%2Forg%2Fapache%2Froyale%2Fhtml%2Fbeads%2FSensitiveSingleSelectionDropTargetBead.as%23L248&amp;data=02%7C01%7Caharui%40adobe.com%7Cb256f79f5e02413ec5f208d666b0ac3b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809306326176299&amp;sdata=4K1REyL0gm%2Br5pApE2Ysfb8j%2Bpvzz%2F%2BpXBgrVqYTUGE%3D&amp;reserved=0
>> 
>> 
>> 
>>   ________________________________
>>   From: Yishay Weiss <yi...@hotmail.com>
>>   Sent: Thursday, December 20, 2018 3:40:18 PM
>>   To: dev@royale.apache.org
>>   Subject: RE: DragEvent.clientY
>> 
>> 
>> 
>>   The only place [1] in Flex code I see a similar logic is in DragProxy, where a change of targets transforms the localX/Y values. But I was referring to clientX/Y which should not depend on the target. As I understand [2] it, is just the position of the pointer in the browser window.
>> 
>> 
>> 
>>   It could be that clientX/Y isn’t necessary in DragEvent.DRAG_OVER and that we only need to set localX/Y. That should be enough for my purposes using locaToGlobal.
>> 
>> 
>> 
>>   I’ll change it to that and let me know if you have objections.
>> 
>> 
>> 
>>   [1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fflex-sdk%2Fblob%2Fba414443032b49c45ff11b61db452c8a8f428bd8%2Fframeworks%2Fprojects%2Fframework%2Fsrc%2Fmx%2Fmanagers%2FdragClasses%2FDragProxy.as%23L353&amp;data=02%7C01%7Caharui%40adobe.com%7Cb256f79f5e02413ec5f208d666b0ac3b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809306326176299&amp;sdata=%2B04P9BOgeF0lCjWS7ObJq6Bfxs2gTpHgoZSjwF6y0CE%3D&amp;reserved=0
>> 
>> 
>> 
>>   [2]  https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FMouseEvent%2FclientX&amp;data=02%7C01%7Caharui%40adobe.com%7Cb256f79f5e02413ec5f208d666b0ac3b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809306326186309&amp;sdata=EOX9j18%2FV2HhKBzy%2B7Veugqv9ambtQcWNB6Lwh%2FN1Ck%3D&amp;reserved=0
>> 
>> 
>> 
>>   ________________________________
>>   From: Alex Harui <ah...@adobe.com.INVALID>
>>   Sent: Wednesday, December 19, 2018 7:21:26 PM
>>   To: dev@royale.apache.org
>>   Subject: Re: DragEvent.clientY
>> 
>>   I suggest looking at the Flex code.  Some of this may have been ported without considering whether it is truly needed or not.  The key factor to consider is the event target and who is consuming the event.  IIRC, in Flex, the event target could be something other than the source or destination component, like the drag indicator, drop indicator and other things, but the DragEvent listeners are trying to track and compute destinations.  clientX/Y generally maps back to localX/Y in the Flex DragEvent.  It looks like this code is always using stage/screen coordinates which may be more consistent than using the event target's clientX/Y which will change as you drag over various things on the way to the final drop point.
>> 
>>   -Alex
>> 
>>   On 12/19/18, 1:55 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:
>> 
>>       Any idea what it’s used for? Is it supposed to be the same as MouseEvent.clientY ? If so, why do we have this sequence in DragEvent.createEvent() (event being MouseEvent)?
>> 
>>                                                                       var localPoint:Point = new Point(event.screenX, event.screenY);
>>                                                                       var clientPoint:Point = PointUtils.localToGlobal(localPoint, event.target);
>>                                                                       de.clientX = clientPoint.x;
>>                                                                       de.clientY = clientPoint.y;
>> 
>>       I’d like to use it for SensitiveSingleSelectionDropTargetBead but the values don’t make sense to me. I don’t see it being used anywhere in the framework right now.
>> 
>> 
>> 
>> 
> 
> 
> 


Re: DragEvent.clientY

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Ah, ok, I didn't notice the IFrame.  The goal is to have DragEvent appear to subclass MouseEvent, so whatever values a MouseEvent would have, the DragEvent should have.

Thanks,
-Alex

On 12/20/18, 11:23 AM, "Harbs" <ha...@gmail.com> wrote:

    > I think clientX/Y does depend on the target.  In the link [2], there is an example that you can play with, and clientX/Y is not global coordinates.  MDN is usually good doc, but I think the doc for clientX/Y is not well-written.
    
    It does not depend on the target. It’s global relative to the *window*. The example on that page is within an iframe, so it’s relative to that. I believe that in Royale the global space we should be concerned about is the application’s Window. That makes clientX/Y a good choice.
    
    https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F6073505%2Fwhat-is-the-difference-between-screenx-y-clientx-y-and-pagex-y&amp;data=02%7C01%7Caharui%40adobe.com%7Cb256f79f5e02413ec5f208d666b0ac3b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809306326176299&amp;sdata=wAYsjF2npgyibZApmnaucPv93FqFb4OJ0iq0mwfnMpA%3D&amp;reserved=0 <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F6073505%2Fwhat-is-the-difference-between-screenx-y-clientx-y-and-pagex-y&amp;data=02%7C01%7Caharui%40adobe.com%7Cb256f79f5e02413ec5f208d666b0ac3b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809306326176299&amp;sdata=wAYsjF2npgyibZApmnaucPv93FqFb4OJ0iq0mwfnMpA%3D&amp;reserved=0>
    
    > On Dec 20, 2018, at 8:01 PM, Alex Harui <ah...@adobe.com.INVALID> wrote:
    > 
    > I think clientX/Y does depend on the target.  In the link [2], there is an example that you can play with, and clientX/Y is not global coordinates.  MDN is usually good doc, but I think the doc for clientX/Y is not well-written.
    > 
    > -Alex
    > 
    > On 12/20/18, 5:48 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:
    > 
    >    Actually, creating localX/localY in HTML is expensive so maybe not a PAYG solution.
    > 
    > 
    > 
    >    I suggest to just have clientX/Y mirror the mouse event and let listeners figure out what they need similar to what I did here [1].
    > 
    > 
    > 
    >    Thoughts?
    > 
    > 
    > 
    >    [1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-asjs%2Fblob%2Ff6733066124309c61fb054b10439cc3551ddfaed%2Fframeworks%2Fprojects%2FDragDrop%2Fsrc%2Fmain%2Froyale%2Forg%2Fapache%2Froyale%2Fhtml%2Fbeads%2FSensitiveSingleSelectionDropTargetBead.as%23L248&amp;data=02%7C01%7Caharui%40adobe.com%7Cb256f79f5e02413ec5f208d666b0ac3b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809306326176299&amp;sdata=4K1REyL0gm%2Br5pApE2Ysfb8j%2Bpvzz%2F%2BpXBgrVqYTUGE%3D&amp;reserved=0
    > 
    > 
    > 
    >    ________________________________
    >    From: Yishay Weiss <yi...@hotmail.com>
    >    Sent: Thursday, December 20, 2018 3:40:18 PM
    >    To: dev@royale.apache.org
    >    Subject: RE: DragEvent.clientY
    > 
    > 
    > 
    >    The only place [1] in Flex code I see a similar logic is in DragProxy, where a change of targets transforms the localX/Y values. But I was referring to clientX/Y which should not depend on the target. As I understand [2] it, is just the position of the pointer in the browser window.
    > 
    > 
    > 
    >    It could be that clientX/Y isn’t necessary in DragEvent.DRAG_OVER and that we only need to set localX/Y. That should be enough for my purposes using locaToGlobal.
    > 
    > 
    > 
    >    I’ll change it to that and let me know if you have objections.
    > 
    > 
    > 
    >    [1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fflex-sdk%2Fblob%2Fba414443032b49c45ff11b61db452c8a8f428bd8%2Fframeworks%2Fprojects%2Fframework%2Fsrc%2Fmx%2Fmanagers%2FdragClasses%2FDragProxy.as%23L353&amp;data=02%7C01%7Caharui%40adobe.com%7Cb256f79f5e02413ec5f208d666b0ac3b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809306326176299&amp;sdata=%2B04P9BOgeF0lCjWS7ObJq6Bfxs2gTpHgoZSjwF6y0CE%3D&amp;reserved=0
    > 
    > 
    > 
    >    [2]  https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FMouseEvent%2FclientX&amp;data=02%7C01%7Caharui%40adobe.com%7Cb256f79f5e02413ec5f208d666b0ac3b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809306326186309&amp;sdata=EOX9j18%2FV2HhKBzy%2B7Veugqv9ambtQcWNB6Lwh%2FN1Ck%3D&amp;reserved=0
    > 
    > 
    > 
    >    ________________________________
    >    From: Alex Harui <ah...@adobe.com.INVALID>
    >    Sent: Wednesday, December 19, 2018 7:21:26 PM
    >    To: dev@royale.apache.org
    >    Subject: Re: DragEvent.clientY
    > 
    >    I suggest looking at the Flex code.  Some of this may have been ported without considering whether it is truly needed or not.  The key factor to consider is the event target and who is consuming the event.  IIRC, in Flex, the event target could be something other than the source or destination component, like the drag indicator, drop indicator and other things, but the DragEvent listeners are trying to track and compute destinations.  clientX/Y generally maps back to localX/Y in the Flex DragEvent.  It looks like this code is always using stage/screen coordinates which may be more consistent than using the event target's clientX/Y which will change as you drag over various things on the way to the final drop point.
    > 
    >    -Alex
    > 
    >    On 12/19/18, 1:55 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:
    > 
    >        Any idea what it’s used for? Is it supposed to be the same as MouseEvent.clientY ? If so, why do we have this sequence in DragEvent.createEvent() (event being MouseEvent)?
    > 
    >                                                                        var localPoint:Point = new Point(event.screenX, event.screenY);
    >                                                                        var clientPoint:Point = PointUtils.localToGlobal(localPoint, event.target);
    >                                                                        de.clientX = clientPoint.x;
    >                                                                        de.clientY = clientPoint.y;
    > 
    >        I’d like to use it for SensitiveSingleSelectionDropTargetBead but the values don’t make sense to me. I don’t see it being used anywhere in the framework right now.
    > 
    > 
    > 
    > 
    
    


Re: DragEvent.clientY

Posted by Harbs <ha...@gmail.com>.
> I think clientX/Y does depend on the target.  In the link [2], there is an example that you can play with, and clientX/Y is not global coordinates.  MDN is usually good doc, but I think the doc for clientX/Y is not well-written.

It does not depend on the target. It’s global relative to the *window*. The example on that page is within an iframe, so it’s relative to that. I believe that in Royale the global space we should be concerned about is the application’s Window. That makes clientX/Y a good choice.

https://stackoverflow.com/questions/6073505/what-is-the-difference-between-screenx-y-clientx-y-and-pagex-y <https://stackoverflow.com/questions/6073505/what-is-the-difference-between-screenx-y-clientx-y-and-pagex-y>

> On Dec 20, 2018, at 8:01 PM, Alex Harui <ah...@adobe.com.INVALID> wrote:
> 
> I think clientX/Y does depend on the target.  In the link [2], there is an example that you can play with, and clientX/Y is not global coordinates.  MDN is usually good doc, but I think the doc for clientX/Y is not well-written.
> 
> -Alex
> 
> On 12/20/18, 5:48 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:
> 
>    Actually, creating localX/localY in HTML is expensive so maybe not a PAYG solution.
> 
> 
> 
>    I suggest to just have clientX/Y mirror the mouse event and let listeners figure out what they need similar to what I did here [1].
> 
> 
> 
>    Thoughts?
> 
> 
> 
>    [1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-asjs%2Fblob%2Ff6733066124309c61fb054b10439cc3551ddfaed%2Fframeworks%2Fprojects%2FDragDrop%2Fsrc%2Fmain%2Froyale%2Forg%2Fapache%2Froyale%2Fhtml%2Fbeads%2FSensitiveSingleSelectionDropTargetBead.as%23L248&amp;data=02%7C01%7Caharui%40adobe.com%7C7ce6f50b02f6488dd29508d66681d291%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809105101243093&amp;sdata=6hHORoj6%2ByVaFKzZqy7KqmoX1MGTgcdgowx9YRKnU60%3D&amp;reserved=0
> 
> 
> 
>    ________________________________
>    From: Yishay Weiss <yi...@hotmail.com>
>    Sent: Thursday, December 20, 2018 3:40:18 PM
>    To: dev@royale.apache.org
>    Subject: RE: DragEvent.clientY
> 
> 
> 
>    The only place [1] in Flex code I see a similar logic is in DragProxy, where a change of targets transforms the localX/Y values. But I was referring to clientX/Y which should not depend on the target. As I understand [2] it, is just the position of the pointer in the browser window.
> 
> 
> 
>    It could be that clientX/Y isn’t necessary in DragEvent.DRAG_OVER and that we only need to set localX/Y. That should be enough for my purposes using locaToGlobal.
> 
> 
> 
>    I’ll change it to that and let me know if you have objections.
> 
> 
> 
>    [1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fflex-sdk%2Fblob%2Fba414443032b49c45ff11b61db452c8a8f428bd8%2Fframeworks%2Fprojects%2Fframework%2Fsrc%2Fmx%2Fmanagers%2FdragClasses%2FDragProxy.as%23L353&amp;data=02%7C01%7Caharui%40adobe.com%7C7ce6f50b02f6488dd29508d66681d291%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809105101243093&amp;sdata=NBdr%2BBL%2BEZ1YTiveWdge9vLGUZlVXLvWuW6z1BmQwTo%3D&amp;reserved=0
> 
> 
> 
>    [2]  https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FMouseEvent%2FclientX&amp;data=02%7C01%7Caharui%40adobe.com%7C7ce6f50b02f6488dd29508d66681d291%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809105101243093&amp;sdata=Iwd5nZJ3xhoGq9ff6A40OFhFuA5pocxU%2FSCD9duLFv0%3D&amp;reserved=0
> 
> 
> 
>    ________________________________
>    From: Alex Harui <ah...@adobe.com.INVALID>
>    Sent: Wednesday, December 19, 2018 7:21:26 PM
>    To: dev@royale.apache.org
>    Subject: Re: DragEvent.clientY
> 
>    I suggest looking at the Flex code.  Some of this may have been ported without considering whether it is truly needed or not.  The key factor to consider is the event target and who is consuming the event.  IIRC, in Flex, the event target could be something other than the source or destination component, like the drag indicator, drop indicator and other things, but the DragEvent listeners are trying to track and compute destinations.  clientX/Y generally maps back to localX/Y in the Flex DragEvent.  It looks like this code is always using stage/screen coordinates which may be more consistent than using the event target's clientX/Y which will change as you drag over various things on the way to the final drop point.
> 
>    -Alex
> 
>    On 12/19/18, 1:55 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:
> 
>        Any idea what it’s used for? Is it supposed to be the same as MouseEvent.clientY ? If so, why do we have this sequence in DragEvent.createEvent() (event being MouseEvent)?
> 
>                                                                        var localPoint:Point = new Point(event.screenX, event.screenY);
>                                                                        var clientPoint:Point = PointUtils.localToGlobal(localPoint, event.target);
>                                                                        de.clientX = clientPoint.x;
>                                                                        de.clientY = clientPoint.y;
> 
>        I’d like to use it for SensitiveSingleSelectionDropTargetBead but the values don’t make sense to me. I don’t see it being used anywhere in the framework right now.
> 
> 
> 
> 


Re: DragEvent.clientY

Posted by Alex Harui <ah...@adobe.com.INVALID>.
I think clientX/Y does depend on the target.  In the link [2], there is an example that you can play with, and clientX/Y is not global coordinates.  MDN is usually good doc, but I think the doc for clientX/Y is not well-written.

-Alex

On 12/20/18, 5:48 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:

    Actually, creating localX/localY in HTML is expensive so maybe not a PAYG solution.
    
    
    
    I suggest to just have clientX/Y mirror the mouse event and let listeners figure out what they need similar to what I did here [1].
    
    
    
    Thoughts?
    
    
    
    [1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-asjs%2Fblob%2Ff6733066124309c61fb054b10439cc3551ddfaed%2Fframeworks%2Fprojects%2FDragDrop%2Fsrc%2Fmain%2Froyale%2Forg%2Fapache%2Froyale%2Fhtml%2Fbeads%2FSensitiveSingleSelectionDropTargetBead.as%23L248&amp;data=02%7C01%7Caharui%40adobe.com%7C7ce6f50b02f6488dd29508d66681d291%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809105101243093&amp;sdata=6hHORoj6%2ByVaFKzZqy7KqmoX1MGTgcdgowx9YRKnU60%3D&amp;reserved=0
    
    
    
    ________________________________
    From: Yishay Weiss <yi...@hotmail.com>
    Sent: Thursday, December 20, 2018 3:40:18 PM
    To: dev@royale.apache.org
    Subject: RE: DragEvent.clientY
    
    
    
    The only place [1] in Flex code I see a similar logic is in DragProxy, where a change of targets transforms the localX/Y values. But I was referring to clientX/Y which should not depend on the target. As I understand [2] it, is just the position of the pointer in the browser window.
    
    
    
    It could be that clientX/Y isn’t necessary in DragEvent.DRAG_OVER and that we only need to set localX/Y. That should be enough for my purposes using locaToGlobal.
    
    
    
    I’ll change it to that and let me know if you have objections.
    
    
    
    [1] https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fflex-sdk%2Fblob%2Fba414443032b49c45ff11b61db452c8a8f428bd8%2Fframeworks%2Fprojects%2Fframework%2Fsrc%2Fmx%2Fmanagers%2FdragClasses%2FDragProxy.as%23L353&amp;data=02%7C01%7Caharui%40adobe.com%7C7ce6f50b02f6488dd29508d66681d291%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809105101243093&amp;sdata=NBdr%2BBL%2BEZ1YTiveWdge9vLGUZlVXLvWuW6z1BmQwTo%3D&amp;reserved=0
    
    
    
    [2]  https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FMouseEvent%2FclientX&amp;data=02%7C01%7Caharui%40adobe.com%7C7ce6f50b02f6488dd29508d66681d291%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809105101243093&amp;sdata=Iwd5nZJ3xhoGq9ff6A40OFhFuA5pocxU%2FSCD9duLFv0%3D&amp;reserved=0
    
    
    
    ________________________________
    From: Alex Harui <ah...@adobe.com.INVALID>
    Sent: Wednesday, December 19, 2018 7:21:26 PM
    To: dev@royale.apache.org
    Subject: Re: DragEvent.clientY
    
    I suggest looking at the Flex code.  Some of this may have been ported without considering whether it is truly needed or not.  The key factor to consider is the event target and who is consuming the event.  IIRC, in Flex, the event target could be something other than the source or destination component, like the drag indicator, drop indicator and other things, but the DragEvent listeners are trying to track and compute destinations.  clientX/Y generally maps back to localX/Y in the Flex DragEvent.  It looks like this code is always using stage/screen coordinates which may be more consistent than using the event target's clientX/Y which will change as you drag over various things on the way to the final drop point.
    
    -Alex
    
    On 12/19/18, 1:55 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:
    
        Any idea what it’s used for? Is it supposed to be the same as MouseEvent.clientY ? If so, why do we have this sequence in DragEvent.createEvent() (event being MouseEvent)?
    
                                                                        var localPoint:Point = new Point(event.screenX, event.screenY);
                                                                        var clientPoint:Point = PointUtils.localToGlobal(localPoint, event.target);
                                                                        de.clientX = clientPoint.x;
                                                                        de.clientY = clientPoint.y;
    
        I’d like to use it for SensitiveSingleSelectionDropTargetBead but the values don’t make sense to me. I don’t see it being used anywhere in the framework right now.
    
    
    


RE: DragEvent.clientY

Posted by Yishay Weiss <yi...@hotmail.com>.
Actually, creating localX/localY in HTML is expensive so maybe not a PAYG solution.



I suggest to just have clientX/Y mirror the mouse event and let listeners figure out what they need similar to what I did here [1].



Thoughts?



[1] https://github.com/apache/royale-asjs/blob/f6733066124309c61fb054b10439cc3551ddfaed/frameworks/projects/DragDrop/src/main/royale/org/apache/royale/html/beads/SensitiveSingleSelectionDropTargetBead.as#L248



________________________________
From: Yishay Weiss <yi...@hotmail.com>
Sent: Thursday, December 20, 2018 3:40:18 PM
To: dev@royale.apache.org
Subject: RE: DragEvent.clientY



The only place [1] in Flex code I see a similar logic is in DragProxy, where a change of targets transforms the localX/Y values. But I was referring to clientX/Y which should not depend on the target. As I understand [2] it, is just the position of the pointer in the browser window.



It could be that clientX/Y isn’t necessary in DragEvent.DRAG_OVER and that we only need to set localX/Y. That should be enough for my purposes using locaToGlobal.



I’ll change it to that and let me know if you have objections.



[1] https://github.com/apache/flex-sdk/blob/ba414443032b49c45ff11b61db452c8a8f428bd8/frameworks/projects/framework/src/mx/managers/dragClasses/DragProxy.as#L353



[2]  https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/clientX



________________________________
From: Alex Harui <ah...@adobe.com.INVALID>
Sent: Wednesday, December 19, 2018 7:21:26 PM
To: dev@royale.apache.org
Subject: Re: DragEvent.clientY

I suggest looking at the Flex code.  Some of this may have been ported without considering whether it is truly needed or not.  The key factor to consider is the event target and who is consuming the event.  IIRC, in Flex, the event target could be something other than the source or destination component, like the drag indicator, drop indicator and other things, but the DragEvent listeners are trying to track and compute destinations.  clientX/Y generally maps back to localX/Y in the Flex DragEvent.  It looks like this code is always using stage/screen coordinates which may be more consistent than using the event target's clientX/Y which will change as you drag over various things on the way to the final drop point.

-Alex

On 12/19/18, 1:55 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:

    Any idea what it’s used for? Is it supposed to be the same as MouseEvent.clientY ? If so, why do we have this sequence in DragEvent.createEvent() (event being MouseEvent)?

                                                                    var localPoint:Point = new Point(event.screenX, event.screenY);
                                                                    var clientPoint:Point = PointUtils.localToGlobal(localPoint, event.target);
                                                                    de.clientX = clientPoint.x;
                                                                    de.clientY = clientPoint.y;

    I’d like to use it for SensitiveSingleSelectionDropTargetBead but the values don’t make sense to me. I don’t see it being used anywhere in the framework right now.



RE: DragEvent.clientY

Posted by Yishay Weiss <yi...@hotmail.com>.

The only place [1] in Flex code I see a similar logic is in DragProxy, where a change of targets transforms the localX/Y values. But I was referring to clientX/Y which should not depend on the target. As I understand [2] it, is just the position of the pointer in the browser window.



It could be that clientX/Y isn’t necessary in DragEvent.DRAG_OVER and that we only need to set localX/Y. That should be enough for my purposes using locaToGlobal.



I’ll change it to that and let me know if you have objections.



[1] https://github.com/apache/flex-sdk/blob/ba414443032b49c45ff11b61db452c8a8f428bd8/frameworks/projects/framework/src/mx/managers/dragClasses/DragProxy.as#L353



[2]  https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/clientX



________________________________
From: Alex Harui <ah...@adobe.com.INVALID>
Sent: Wednesday, December 19, 2018 7:21:26 PM
To: dev@royale.apache.org
Subject: Re: DragEvent.clientY

I suggest looking at the Flex code.  Some of this may have been ported without considering whether it is truly needed or not.  The key factor to consider is the event target and who is consuming the event.  IIRC, in Flex, the event target could be something other than the source or destination component, like the drag indicator, drop indicator and other things, but the DragEvent listeners are trying to track and compute destinations.  clientX/Y generally maps back to localX/Y in the Flex DragEvent.  It looks like this code is always using stage/screen coordinates which may be more consistent than using the event target's clientX/Y which will change as you drag over various things on the way to the final drop point.

-Alex

On 12/19/18, 1:55 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:

    Any idea what it’s used for? Is it supposed to be the same as MouseEvent.clientY ? If so, why do we have this sequence in DragEvent.createEvent() (event being MouseEvent)?

                                                                    var localPoint:Point = new Point(event.screenX, event.screenY);
                                                                    var clientPoint:Point = PointUtils.localToGlobal(localPoint, event.target);
                                                                    de.clientX = clientPoint.x;
                                                                    de.clientY = clientPoint.y;

    I’d like to use it for SensitiveSingleSelectionDropTargetBead but the values don’t make sense to me. I don’t see it being used anywhere in the framework right now.



Re: DragEvent.clientY

Posted by Alex Harui <ah...@adobe.com.INVALID>.
I suggest looking at the Flex code.  Some of this may have been ported without considering whether it is truly needed or not.  The key factor to consider is the event target and who is consuming the event.  IIRC, in Flex, the event target could be something other than the source or destination component, like the drag indicator, drop indicator and other things, but the DragEvent listeners are trying to track and compute destinations.  clientX/Y generally maps back to localX/Y in the Flex DragEvent.  It looks like this code is always using stage/screen coordinates which may be more consistent than using the event target's clientX/Y which will change as you drag over various things on the way to the final drop point.

-Alex

On 12/19/18, 1:55 AM, "Yishay Weiss" <yi...@hotmail.com> wrote:

    Any idea what it’s used for? Is it supposed to be the same as MouseEvent.clientY ? If so, why do we have this sequence in DragEvent.createEvent() (event being MouseEvent)?
    
                                                                    var localPoint:Point = new Point(event.screenX, event.screenY);
                                                                    var clientPoint:Point = PointUtils.localToGlobal(localPoint, event.target);
                                                                    de.clientX = clientPoint.x;
                                                                    de.clientY = clientPoint.y;
    
    I’d like to use it for SensitiveSingleSelectionDropTargetBead but the values don’t make sense to me. I don’t see it being used anywhere in the framework right now.