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

feature: align cover svg to viewer #167

Closed wolasss closed 4 years ago

wolasss commented 4 years ago

These changes allow to call:

viewer.fitToViewer(ALIGN_COVER, ALIGN_COVER) so that the svg will always take the whole viewport and match the viewport by the short edge.

Please review and let me know if there is something else I must add

wolasss commented 4 years ago

It fixes https://github.com/chrvadala/react-svg-pan-zoom/issues/29

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.7%) to 39.652% when pulling a31979ef87eb93c780f6bcafe186dc0df3d34715 on wolasss:master into 1b3bb5efa95edfec1ac8b4ac82dec052f2cf3a9d on chrvadala:master.

wolasss commented 4 years ago

@chrvadala hey, any chances this will be merged soon? :)

chrvadala commented 4 years ago

Hi, thanks for your contributions. I added few feedbacks inline; moreover, can you provide some unit tests?

Finally, let me to suggest you to align your PR with the add-test branch https://github.com/chrvadala/react-svg-pan-zoom/tree/add-tests, because I'll merge it in the next few days

quick update: add-tests is merged! you can sync your branch with master

wolasss commented 4 years ago

Ok, thanks, I'll address all the issues after the weekend

wolasss commented 4 years ago

@chrvadala I added some unit tests - for two scenarios where rect > viewport and the opposite. Both cases seem to be working fine. I also removed the package-lock.json and removed the blank lines.

chrvadala commented 4 years ago

Released with version 3.8.0 Thanks for your contribution, I added you in contributors list