mnogueron / react-easy-panzoom

Wrapper to enable pan and zoom features for any React component
MIT License
79 stars 17 forks source link

Explicitly set the scale? #40

Open eanplatter opened 4 years ago

eanplatter commented 4 years ago

Hello, I was wondering if there was a way to explicitly set the scale in the state from outside. I am attempting to create a menu button that will Zoom to 75%, which can be kind tricky using the zoomOut / zoomIn methods. Something like panZoom.current.setScale(0.75)? Apologies if this is documented somewhere already 🙊

eanplatter commented 4 years ago

I made a proposal for this functionality here: https://github.com/mnogueron/react-easy-panzoom/pull/41