Comment 0 for bug 1473955

Revision history for this message
su_v (suv-lp) wrote :

When changing the page width and/or height via 'Document Properties > Page > Custom Size' and entering a value of '0' (zero) as intermediary step, the corresponding '0' in the document's 'viewBox' attribute gets "sticky" i.e. does not update if the page width or height is set to a positive value later on.

Viewing such a file in other SVG viewers (e.g. web browsers) causes the content to be not rendered visible:
«A negative value for <width> or <height> is an error (see Error processing). A value of zero disables rendering of the element.»
http://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute

Side-effect: python-based extensions will fail with a ZeroDivisionError in getDocumentUnit() when applied in such a document (this failure was originally reported on irc by Qcoder00).

Steps to reproduce:
1) launch inkscape (default prefs, default new document)
2) draw a large rectangle (e.g. as large as the page)
3) open 'File > Document Properties'
4) set width to '0'
5) set width to '210' (same as before)
6) save
7) view the file e.g. in Firefox

Expected result:
The rectangle drawn on the page is visible in the browser.

Actual result:
The browser displays an "empty" file (rendering is disabled).

Reproduced with Inkscape 0.91 r13725 and 0.91+devel r14242 on OS X 10.7.5.