-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finding the tap location inside a group #502
Comments
Hi Aurelius, It looks like a bug, because tap location should be relative to a tapped node. Could you please attach some sample to reproduce it? |
Here's some code that does a pretty good job, except that it doesn't handle window resizing yet. Currently I've just turned off resizing. It would also be fine if I could constrain the aspect ratio of the window. If this is a suitable amount of complexity for your users, please feel free to close this issue, but if you can simplify it, that would be great. Either way, I can proceed.
|
btw if you do wrap this up in Macaw, would be cool to offer all data - x, y, relatve x, y, and percentage of width height x y. |
Hi Aurelius, Thank you for the sample. I reproduced this issue and it's sad that we had absolute location in events, because it should be relative and now we can break some apps by fixing this issue. Probably we need to provide both absolute and relative locations now, need to think. Anyway you can use your workaround for now and I'll let you know once we add relative coordinates as well. |
Fix #502: Finding the tap location inside a group
Nice! |
The event location that is returned onTap or onTouchPressed seems to be relative to the entire window. Is there a way I can easily deduce the location of a tap within a button (clickable area). I want to be able to map the height location of the tap within the button to a variable from 0-1.
This might be less difficult on iOS because of a fixed screen size, but with a Mac app that can scale, it gets difficult because the numbers change when the window is resized.
My apologies if this is an easy one. :)
The text was updated successfully, but these errors were encountered: