Home > Back-end >  SVG with square viewBox overflowing viewPort
SVG with square viewBox overflowing viewPort

Time:03-05

A have a non-squared svg and need a square (unit) viewBox that may be overflowing the viewPort. What can I do? I tried all options of preserveAspectRatio, which didn't work. Any other ideas would be much appreciated.

This is how it should be looking...

enter image description here

CodePudding user response:

You want

preserveAspectRatio="xMidYMid slice"

slice ensures that the all the viewport is visible within the viewBox.

  • Related