1
Vote

Considering the viewbox in the SVG

description

Hello,

I'm trying to show an SVG within certain bounds. But depending on the SVG the icon should sometimes appear smaller than other icons - only the SVG itself knows how large it actually is. My goal is to render SVGs onto the face of buttons, so the button defines the maximum size of the SVG only. I would expect that the SVG would size according to the viewbox specified in the SVG.

An example:
The viewbox attribute in the SVG is a rectangle (x=-10, y=-10, width=40, height=40).
Graphical elements are placed inside a region (x=0, y=0, width=20, height=20).
I would expect that the finally rendered image contains a margin around the actual drawing that is 50% of the width of the drawing on the left and right side and 50% of the height of the drawing on the top and buttom side.

Is there a way to accomplish that? Your library is really nice and I've been using it for some time know, but this detail is a real showstopper (for me) at the moment :-/

It would be great, if you could give me a hint how I can get it working correctly.

Thank you very much!

Best Regards,
Ravenpride

comments