-
Notifications
You must be signed in to change notification settings - Fork 21
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
hit testing appears to be broken #23
Comments
We are in the middle of changing the hit testing, I'll add your test file to the test suite to confirm the new stuff works properly during the merge |
also, be sure you are using |
Thanks for the feedback. I'm not sure that's applicable in this case. The Do you have any idea when the hit testing rewrite will be finished? |
I don't have an ETA right now, best guess is a couple of weeks. Try out @adamgit transforms branch and see if you get better results. |
I'm trying to use SVGKit to load an .svg file with named objects in it, and then use hit testing to figure out which object the user has touched. What led me here was this blog post by adamgit and a brief discussion in the comments section.
At any rate, I tried adding a
UITouchGestureRecognizer
to the sample iPad project and identifying the touched object with the following codeIt turns out that the accuracy of the hit testing depends on the zoom level. On my simple test file, which contains a blue rectangle and a red rectangle, it works pretty well at the default zoom level, but is still slightly off. However, zooming in/out messes things up a whole lot.
A more complex file, however, does not work accurately even at the default zoom level, but does improve as I zoom in.
I noticed that adamgit has commited a number of changes that remain to be merged with the master branch, including a modification of the
hitTest:
method inCAShapeLayerWithHitTest
. Pasting the changes into the appropriate file in XCode (yeah, I'm not quite there yet with git/github), results in hit testing not working at all at any zoom level. Could be that I missed related code changes in other files.The text was updated successfully, but these errors were encountered: