Skip to content
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

fix: handle zero touch coordinates #256

Merged
merged 3 commits into from
Nov 19, 2024
Merged

Conversation

ioannisj
Copy link
Contributor

💡 Motivation and Context

Closes #254

The likely cause of zeroed-out coordinates is that we were accessing UITouch asynchronously. I was able to replicate locally by adding a conditional breakpoint checking for zero location. Every touch event that hit the breakpoint had its associated touch.view, touch.window and touch.gestureRecognizers erased.

I think the system may be releasing or erasing this info by the time we handle it, so I changed to collect the necessary info on main thread, and then process async. I kept a failsafe check before capturing in place just in case.

💚 How did you test it?

Locally with sample projects

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

@ioannisj ioannisj requested a review from a team November 19, 2024 08:23
Copy link
Member

@marandaneto marandaneto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice finding.

@ioannisj ioannisj merged commit d7ee960 into main Nov 19, 2024
6 checks passed
@ioannisj ioannisj deleted the fix/zero-touch-coordinates branch November 19, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter out 0,0 touches
2 participants