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 <aha...@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.li...@gmail.com > <mailto:harbs.li...@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 <aha...@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" <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&data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&sdata=L8hujvkNXKWc0Z0sYT5MD7wspljqyzyxvSErjXEHfm0%3D&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&data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&sdata=L8hujvkNXKWc0Z0sYT5MD7wspljqyzyxvSErjXEHfm0%3D&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&data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&sdata=L8hujvkNXKWc0Z0sYT5MD7wspljqyzyxvSErjXEHfm0%3D&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&data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&sdata=L8hujvkNXKWc0Z0sYT5MD7wspljqyzyxvSErjXEHfm0%3D&reserved=0>> >> >>> On Dec 20, 2018, at 8:01 PM, Alex Harui <aha...@adobe.com.INVALID >>> <mailto: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 >>> <mailto: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&data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&sdata=uvH3OZIDJ4BPnVFVZzNk0xgUfOO4yt33sUHs%2BP2WQqY%3D&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&data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&sdata=uvH3OZIDJ4BPnVFVZzNk0xgUfOO4yt33sUHs%2BP2WQqY%3D&reserved=0> >>> >>> >>> >>> ________________________________ >>> From: Yishay Weiss <yishayj...@hotmail.com <mailto:yishayj...@hotmail.com>> >>> Sent: Thursday, December 20, 2018 3:40:18 PM >>> To: dev@royale.apache.org <mailto: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&data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&sdata=XRN%2BP9nMG8i0yxafE0TVUtMP7W%2FMKSvkkXANAqz5%2FUI%3D&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&data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&sdata=XRN%2BP9nMG8i0yxafE0TVUtMP7W%2FMKSvkkXANAqz5%2FUI%3D&reserved=0> >>> >>> >>> >>> [2] >>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FMouseEvent%2FclientX&data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&sdata=uD7MjMSkCtiDn%2BS1pnjrEkypzo5XaTy%2BkPSkZR77w14%3D&reserved=0 >>> >>> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FMouseEvent%2FclientX&data=02%7C01%7Caharui%40adobe.com%7Cf08be3dd128e4289079108d66718653e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636809751855302637&sdata=uD7MjMSkCtiDn%2BS1pnjrEkypzo5XaTy%2BkPSkZR77w14%3D&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.