> 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 <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%7C7ce6f50b02f6488dd29508d66681d291%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809105101243093&amp;sdata=6hHORoj6%2ByVaFKzZqy7KqmoX1MGTgcdgowx9YRKnU60%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%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 <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