Comment 94 for bug 168261

Revision history for this message
jtakalai (jutakala) wrote :

As I see it, if you say 'width="48px" height="48px"' is your SVG, then it's 48 pixels or nothing. I mean, SVGs and HTML and whatnot should live in the same DOM, it's not like you save a raster image (even though they also have dpi's, but no one really cares about them...), so if you specify a new width and height via CSS, they just replace those and thus the image gets clipped.

I'm not sure what the idea of viewboxes are, but since they seem to define a "viewing region" in the picture's coordinates (even though they are pixels) and not its "width" and "height" in real browser pixels like CSS does, it seems semantically like the option Inkscape should use.

From http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute:

<quote>
It is often desirable to specify that a given set of graphics stretch to fit a particular container element. The viewBox attribute provides this capability.
All elements that establish a new viewport -- have attribute viewBox. The value of the viewBox attribute is a -- rectangle in user space which should be mapped to the bounds of the viewport established by the given element.
</quote>

this clearly states in my opinion that Inkscape should give the "picture coordinates" in viewBox, and CSS can then specify the width and height in the browser.

-- sigs