Comment 41 for bug 168261

Revision history for this message
Frederik Elwert (frederik-elwert) wrote :

Originator: NO

Opera behaves the same. If width and height are specified in pixel, these
are fixed dimensions, so the image will not scale. If a viewBox is set, and
width and height are omitted or 100%, then the image will scale to fit (the
preserveAspectRatio property can fine-tune the scaling behaviour).

The first part would be Inkscape's: Just set the viewBox, as it doesn't
hurt, but helps a lot on the web. The viewBox should be always updated when
page dimensions change.

I'm not really sure if the browsers' current behaviour is correct or not,
i.e., if images with dimensions given in absolute units are supposed to
scale. But maybe Inkscape could provide a new unit "user space units" or
thelike in the document properties dialogue. When set to this unit, width
and height are omitted or set to 100%, and the user space coordinates as
defined by the viewBox attribute are used for all dimensions, especially
for the canvas size. This would allow Inkscape to deal with documents that
have no width or height. Inkscape's current behaviour, to set the canvas
dimensions to default and fit the drawing into this canvas, is at least not
very helpful when working with images for the web.