seekshiva / react-native-remote-svg

Adds support for loading svg images in React Native
MIT License
184 stars 71 forks source link

Fix for resizing SVGs which don't have viewBox #46

Open Meghpal opened 5 years ago

Meghpal commented 5 years ago

Potential fix for issue #3

As I understood, the SVGs that do not have viewBox cause the image clipping problem. If we add a viewBox that is the same height and width as the SVG, it is possible to resize it with styles. (Assumption: No viewBox must mean the \<svg> tag should be having a height and width)

Tested with: 1) API: https://restcountries.eu SVG flags 2) The SVG in the aforementioned issue.

Can you please review the fix and see if it's worth anything?