Android-Material-Icon-Generator icon indicating copy to clipboard operation
Android-Material-Icon-Generator copied to clipboard

Use viewBox instead of width, height, x and y

Open anehx opened this issue 9 years ago • 3 comments

I noticed that the generated SVG file is using static width, height, x and y.

Consider using viewBox="0 0 48 48" instead, since this makes the svg reusable for other icon generators such as splicon which is what I'm using..

anehx avatar Nov 24 '16 08:11 anehx

Cool, thanks for the tip! :+1:

To clarify, judging from this article, the created SVG files are setting the viewPort via width and height, but are missing a viewBox. So the fix here would be to include both, width + height and a viewBox, correct?

Maddoc42 avatar Nov 24 '16 12:11 Maddoc42

If you set a correct viewBox you don't have to set width and height too, since it will take the initial size from the viewBox.

By the way, very nice generator! Good job!

anehx avatar Nov 25 '16 09:11 anehx

All right, really thanks! :+1: :+1:

This should be a simple enough fix. Maybe paper.js has native support for this, otherwise it requires digging through the created SVG file. I'll leave this open for a bit until the holidays if anyone is interested :santa:

Maddoc42 avatar Nov 25 '16 13:11 Maddoc42