-
Notifications
You must be signed in to change notification settings - Fork 90
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
Zooming #98
Comments
Hey @stevenpetryk Thanks for this great lib! Can we create this feature using something like this package? Or should we roll out our own gestures logic? |
@Technologeek you can definitely roll your own with that! (I personally would use However, worth pointing out that I am planning on building this today during Hacky Hour on the Mafs Discord (feel free to join 😄) |
Haha alright! I guess I will pick some other issue for the weekend duties. I will join indeed thanks! |
Closes #98. Allows zooming via: - Pinch on mobile devices (this was a tough one because it required simultaneous zooming and panning, but only if `pan` hasn't been set to false). - Scrolling on desktop (but to avoid interrupting scrolling, there is a 500ms timeout where Mafs waits for scroll idle). - Pinching on desktop (like with a trackpad). This introduces a new matrix into Mafs' pile of matrices, `camera`, which is used to transform `(xMin, yMin)` and `(xMax, yMax)`. This counterintuitively means that translations and scaling are reversed—if `camera` has a scale of 2, that's equivalent to being "zoomed 0.5x".
@Technologeek v0.15.1 now has zooming (docs). Enjoy! |
Let's let people pinch that canvas!
The text was updated successfully, but these errors were encountered: