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

Reset pinch offset, change pinch sensitivity and change unpinching behaviour #670

Open
ElectricPulse opened this issue Jun 20, 2024 Discussed in #669 · 0 comments
Open

Comments

@ElectricPulse
Copy link

Discussed in #669

Originally posted by ElectricPulse June 18, 2024
I am working on a custom html canvas library. I wanted to use react-use-gesture for the zooming, dragging on the canvas.

For zooming I used the usePinch hook which crucially provides event.origin (which useWheel doesn't). usePinch with a wheel needs to know the actual offset and spins off to crazy numbers if improper scaleBounds are set. Letting usePinch control the offset state causes a couple implementation issues.

  1. I need a reset view button -> I need to be able to reset pinch offset.
  2. I need to change the sensitivity of the pinch (this can't be done in the handler)
  3. I also don't want the behaviour where zoom is reset upon the first unpinch when zoomed in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant