Open drewcovi opened 5 years ago
@victorsosa any idea what might be going on here? should this plugin get updated to create a container and manually respect the preserveAspectRatio settings?
@drewcovi no idea; viewbox and preserveaspectratio parameters? please show me where are those?? or how to use them
They’re properties on any given svg element including the Nativescript svg included in this plugin. They’re used to ensure proportional scaling. I’ll hunt down an example of how this was done in React Native land.
the nativescript.svg stretches to fill the width of the container and height
that's true
@victorsosa darn. it looks like the most routinely maintained library for React Native doesn't use SVGKit, but the approach is still the same. I believe in nativescript one could simply create a parent view that handles centering/scaling.
This is a consequence of SVGKFastImageView (which if it inherits some of imageview I believe defaults to scaling regardless of aspect ratio).
@victorsosa seems this is a known issue in SVGKit https://github.com/SVGKit/SVGKit/issues/261
Is there any way to enforce aspect ratio in iOS? At present, the nativescript.svg stretches to fill the width of the container and height, completely ignoring both viewbox and preserveaspectratio parameters.