Sticky zero width, height in viewBox attribute

Bug #1473955 reported by su_v
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Tavmjong Bah

Bug Description

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 > Page'
4) set Width in 'Custom size' to '0'
5) set Width in 'Custom size' 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.

Tags: ui viewbox

Related branches

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

Result of 'steps to reproduce' (with Inkscape 0.91 r13725)

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

Fix committed to trunk in rev 14243.

Changed in inkscape:
assignee: nobody → Tavmjong Bah (tavmjong-free)
importance: Undecided → Medium
milestone: none → 0.92
status: New → Fix Committed
Revision history for this message
su_v (suv-lp) wrote :

Diff to backport r14243 to <lp:inkscape/0.91.x> - please review/test.

tags: added: backport-proposed
Revision history for this message
su_v (suv-lp) wrote :

Fix backported to 0.91.x in rev 13806.

Changed in inkscape:
milestone: 0.92 → 0.91.1
tags: removed: backport-proposed
jazzynico (jazzynico)
Changed in inkscape:
milestone: 0.91.1 → 0.92
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.