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

usePinch 'origin' is always [0, 0] #92

Closed
patrickherrmann opened this issue Oct 4, 2019 · 2 comments
Closed

usePinch 'origin' is always [0, 0] #92

patrickherrmann opened this issue Oct 4, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@patrickherrmann
Copy link

patrickherrmann commented Oct 4, 2019

Repro: https://codesandbox.io/embed/react-use-gesture-template-zk203
(Note console.log(origin) always outputs [0, 0])

Not sure if I understand this property, but I'd expect origin to be the coordinates where the pinch started, and possibly see it drift if the pinch gesture is not perfectly symmetrical. Is that the right assumption?

Edit: I'm realizing now that it's because I'm using a trackpad, not touching the actual screen.
Is there a way to get the cursor position during pinch? This would be useful in order to zoom in on the right spot.

@dbismut
Copy link
Collaborator

dbismut commented Oct 4, 2019

Hey @patrickherrmann, I've just released 6.0.3 which sets origin to cursor position when using trackpad. It should work with wheel zoom (ie Mac trackpad and Chrome) or gesture events (ie Mac trackpad and Safari).

@dbismut dbismut added the enhancement New feature or request label Oct 4, 2019
@patrickherrmann
Copy link
Author

That works beautifully, thanks for the extremely fast release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants