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" <harbs.li...@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 <aha...@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" <yishayj...@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 <yishayj...@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 <aha...@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" <yishayj...@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.
    > 
    > 
    > 
    > 
    
    

Reply via email to