Any way to set preserveAspectRatio?
See original GitHub issuepreserveAspectRatio on the svg seems to default to xMidyMid meet and there doesn’t seem to be any way to change it. (Or at least i can’t find any way). Could a way to set it be added?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
preserveAspectRatio - SVG: Scalable Vector Graphics | MDN
The preserveAspectRatio attribute indicates how an element with a viewBox providing a given aspect ratio must fit into a viewport with a ...
Read more >Understanding SVG preserveAspectRatio - DigitalOcean
Learn how to scale your SVG images using the preserveAspectRatio attribute. You'll learn about the meet and slice values as well as the ......
Read more >Setting SVG preserveAspectRatio attribute dynamically
In JS you can use direct assignment for svg.preserveAspectRatio.baseVal.align . Instead a preserveAspectRatio="none" in HTML you can write svg.
Read more >Dynamically Changing preserveAspectRatio — Using SVG ...
In Chapter 10, we look at preserveAspectRatio again, for images. We can, of course, adapt the form and script from Example 8-X1 to...
Read more >Allow to set or override "preserveAspectRatio" attribute #273
Let's say I have an SVG with content that's 64x64 pixels, but the outer element (in this case the <svg> -tag containing the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

So the way I ended up doing it, is I directly went into the dom after mounting the component with document selectors and manually changed the attribute myself. Not the cleanest solution, but the best I could come up with
or need add