Comment 4 for bug 1430873

Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

 OK, this bug reveals all kinds of nastiness.

1. We shouldn't be setting the 'viewBox' if it is not already set. Inkscape normally does not change existing elements unless an element is actually edited inside Inkscape.

2. Setting 'viewBox' triggers an unnecessary rewriting of all the child elements. There is no reason to do this.

3. During rewriting an element with an SVGLength, only the 'computed' value is rewritten (which in the case of percent, is the percent value as the actual "computed" value is determined at rendering time). This leaves the 'unit' and 'value' parts incorrect which causes the "computed" value to be misinterpreted.

4. Changing the code to write out the 'value' and 'unit' in addition to the 'computed' value works for rendering an element but in editing an element (dragging a node), again only the 'computed' value is written leading to incorrect 'unit' and 'value' parts.