-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Pinchin/Pinchout does not detect correctly after firing #1141
Comments
Having the same problem. Is there a way to signal an end to the first gesture once it detects the opposite gesture being done? |
|
As the above comment illustrates, I got it to work pretty reliably by doing the following: let lastScale = 1;
....
mc.on('pinchout pinchin', e => {
if (e.scale < lastScale) {
// zoom in
handlePinchZoom(1);
} else if (e.scale > lastScale) {
// zoom out
handlePinchZoom(-1);
}
lastScale = e.scale;
});
mc.on('pinchend', e => {
lastScale = 1;
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So what happens is, if you trigger a pinchin first (pulling two fingers together), then you start pinching out (pulling two fingers away) it'll continue triggering pinchin. Vice versa for pinchout.
The text was updated successfully, but these errors were encountered: