-
Notifications
You must be signed in to change notification settings - Fork 11
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
Smooth pinch with ResumableZoom #10
Comments
Hello there 👋, thank you for your kind comments and this awesome contribution, here's what I come up with about the issues you've described. The JitteringI tried simulating the problem with the focal point lack of decimal places by using Math.round, floor and ceil and they are responsible for the jittering as you mentioned, for this issue I'm tied to whatever Software Mansion decides to do about it, there's nothing I can do about it, however I can probably come up with a workaround using the pan gesture in the meantime. Could you please create a pan gesture which uses const pan = Gesture.Pan()
.minPointers(2)
.maxPointer(2)
.onPanUpdate(e => {
console.log(e.x, e.y);
}); Jump at the end of the pinch gestureObservationsYou're right about assuming its caused by a single pointer triggering undesired updates, however the gesture triggering such updates is actually the pan gesture, however this activation's behaviour is abnormal because of the conditions that trigger it, from my perspective a couple of What is the root cause of this issue?All gestures are disabled automatically at the very beginning of SolutionDisabling pan gesture at the beginning of pinch gesture so they can not collide with each other when pinch gesture ends, disabling pan gesture makes no effect to "pan with pinch feature" as pan gesture is not responsible for it. following this action seems to fix the jump issue as I have not been able to replicate it anymore. I'm not able to obtain a single pointer with the pinch gesture, however I will add the pointer check to prevent any strange and undesired issues. I'll work on it tomorrow morning to ensure it works properly this time. |
Disable pan gesture at the beginning of pinch gesture instead of the end this change has been applied to both ResumableZoom and CropZoom refs #10
After many unsuccessful attempts to implement a workaround for this feature I could not make it work.
Best I can do at this point is to make panWithPinch an opt in feature for iOS users and warn them in the documentation until a release of Gesture Handler with your fix comes out. You can test again whether the jump issue has gone away with the new version 1.0.2. |
Description
Hey, first of all wanted to say that you've done a fantastic job with this library 🙇♂️
Tried the
ResumableZoom
component and it works well, there's only two places where it "jitters" on iOS device. Did some investigation and here's what I found:focalX
&focalY
values on RNGH side Pinch gesture focalX & focalY truncated on iOS software-mansion/react-native-gesture-handler#2833e.numberOfPointers === 2
The text was updated successfully, but these errors were encountered: