-
-
Notifications
You must be signed in to change notification settings - Fork 972
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
Focal and anchor points are not in the coordinate space of the view on web #2929
Labels
Comments
This was referenced Jun 3, 2024
m-bert
added a commit
that referenced
this issue
Jun 4, 2024
## Description Fixing #2929 required adding additional information to `TrackerElement`. If we were to leave current structure of `PointerTracker`, we would have to add few more methods. After refactoring, there are only 2 that were not present before: - `getLastViewRelativeCoords` - `getViewRelativeCoordsSum` I'd like to make similar changes to our handlers in the future (i.e. use `coords` object instead of `lastX` and `lastY` variables). ## Test plan Tested on example app.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
On Android and iOS the focal (for pinch) and anchor (for rotation) points are always in the coordinate space of the view, while on web they are not. It looks like they are in the window coordinate space, though I didn't investigate it that thoroughly.
Untitled.mov
Steps to reproduce
The above snippet will render a red point at the relevant point (replace pinch/rotation in detector prop to see the other gesture). It should only change based on the position of the pointer relevant to the blue square, but it's also dependent on its position on the screen and that causes it to move outside the view.
Snack or a link to a repository
https://github.com/software-mansion/react-native-gesture-handler ❤️
Gesture Handler version
main
branchReact Native version
0.74.1
Platforms
Web
JavaScript runtime
None
Workflow
Expo managed workflow
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
None
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: