ngneat / svg-icon

👻 A lightweight library that makes it easier to use SVG icons in your Angular Application
https://netbasal.com
MIT License
260 stars 35 forks source link

Let us define our own preserveAspectRatio for SVGs #97

Closed jep-a closed 2 years ago

jep-a commented 2 years ago

I'm submitting a...

Feature Request

Current behavior

The preserveAspectRatio attribute of all SVGs are always overriden to be xMidYMid meet in registry.ts#L45

Expected behavior/Proposed solution

An input on the component to set this attribute would be nice. It could also default to that value this library sets it to so there's no breaking changes.

Minimal reproduction of the problem with instructions

Generate an SVG with a preserveAspectRatio value that is not xMidYMid meet and it will always be set to xMidYMid meet

What is the motivation / use case for changing the behavior?

I'd like to output an SVG with a custom preserveAspectRatio to render it/align it differently but cannot

NetanelBasal commented 2 years ago

You're welcome to create a PR

NetanelBasal commented 2 years ago

Added in v5