-
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
Add method to MacawView to find node at specified location #285
Comments
Hey Adrian, Yes, that's how move events work. When you touch one node and move your finger, all move events will be delivered to this first node. If you want to detect node under the finger then you need to add listener on MacawView and found which node selected manually. |
Thank you for the quick response, great work you are doing here Use case is that I want to highlight different nodes as I drag along. I now added the following to the MacawView
This is not perfect and mostly works because I have an exported SVG from Sketch with proper IDs to discard unwanted events on nodes. For me right now its enough, touch locations are captured on the parent UIView anyways. But due to the private nature of involved properties I had to modify MacawView at source level. Or maybe a general hit test function could be published similar to mine above? |
Yep, good point. We need to add such a public function to |
Fix #285: Add method to MacawView to find node at specified location
I am rolling my own scrollView with a Macaw view at its center and do not yet understand everything about events in swift. It's possible I broke something somewhere UIView related:
When I set a onTouchesMoved handler on multiple node elements only the one on the first node touched will be triggered.
Is there a way to get this right so that I can get a continuous stream of nodes that are under the finger's location?
Or am I doing something wrong and that should work out of the box? I used the PeriodicTable example and could not get it to work there either
The text was updated successfully, but these errors were encountered: