chrvadala / react-svg-pan-zoom

:eyes: A React component that adds pan and zoom features to SVG
https://chrvadala.github.io/react-svg-pan-zoom/
MIT License
681 stars 127 forks source link

fitSelection centered #159

Open krnlde opened 4 years ago

krnlde commented 4 years ago

Bug reports:

Currently fitSelection always fits the selection to the top left of the viewport. It should behave similar to fitToViewer where you are able to pass the preferences as parameters. Right now there is no way to enforce that other than calculating it myself.

chrvadala commented 4 years ago

Thanks for your suggestion. Probably some lines of code can be copied from fitToViewer function. I'll include this feature in a future version (anyway any PR is appreciated).

wsd1 commented 4 years ago

Adjust your 'fitSelection' area equal to viewport's width/height ratio. This may be a workaround.

Rehre commented 3 years ago

any update on this ? or is there any workaround that we can do first ?