-
-
Notifications
You must be signed in to change notification settings - Fork 982
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
onTouchesMove reports invalid absolute position values during pinch gesture #3073
Comments
I'd like to add something to this issue after some testing from my part, scaling the item affects the values reported as already mentioned however modifying width and height properties reports correct values. |
Hey, thanks for your report. I've pushed the code that should fix the issue. |
@coado Thank you for your work, I wonder, was this an Android only issue? As I mentioned I don't have an iPhone. |
Yes, that was something specific to android implementation. The iOS handles that out of the box. |
## Description The PR fixes the issue mentioned [here](#3073) about the incorrect absolute positions on touch events. The view transformations should not affect the absolute position of the touch, so the source event should also be passed to gesture handlers and used for calculations. It applies to `ACTION_DOWN`, `ACTION_MOVE`, and `ACTION_UP` motion events. <!-- Description and motivation for this PR. Include 'Fixes #<number>' if this is fixing some issue. --> ## Test plan I've checked on android device for repro provided in the above-mentioned issue with some scroll offset. <!-- Describe how did you test this change here. -->
Description
Hi there and thank you all for your open source efforts, I'm currently creating a zoomable image component and in order to achieve this behavior I need the absolute position (absoluteX and absoluteY values) of both fingers on the screen, however I'm getting the following issues.
If the element to pinch is NOT scaled, the values reported by
onTouchesDown
andonTouchesMove
for both pointers are all correct.if the element to pinch is scaled, the values reported by
onTouchesDown
andonTouchesMove
are all incorrect, for some reason one of the pointers is able to report the correct value for the x axis.Some other things to note about this problem, if both fingers are moved in the same horizontal direction both pointers will report valid values on the x axis.
If you keep one finger stand still at the screen and start moving the other, you will be able to see the values reported for the stand still finger will start to increase.
I can not tell whether this problem happens on iOS as I don't own an Apple device.
Steps to reproduce
onUpdate
callbackonUpdate
callbackSnack or a link to a repository
https://snack.expo.dev/@glazzes/d545df
Gesture Handler version
2.16.1
React Native version
0.74.1
Platforms
Android
JavaScript runtime
Hermes
Workflow
Expo managed workflow
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
Real device
Device model
Alcatel 5044R (Android 7)
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: