question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Any way to set preserveAspectRatio?

See original GitHub issue

preserveAspectRatio 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:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tjl9tqcommented, Feb 10, 2021

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

0reactions
angelporocommented, Oct 25, 2021

or need add

rendererSettings={{
              clearCanvas: false,
              hideOnTransparent: true,
              progressiveLoad: true,
             preserveAspectRatio: 'none meet',
            }}
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found