
Hey devs,
I've been tracking this bug: https://bugs.launchpad.net/inkscape/+bug/1107924
Dragging symbols to the document 'pastes' them in. The 'use' element created points to the symbol definition. But it also adds width="1" height="1" to the element which is erronious. sp-use.cpp sets width and height to 100% (1.0 + SVGLength::PERCENT) and I thought that might be the culprit, but it's not effecting these use elements.
So I traced the copy process, outputting the xml at each step through the copy process. The use element created and passed around never has a width and height attribute and setting one gets overridden.
So I'm at a loss, the element from the paste process acquires attributes by some magic I can't yet trace. Any help understanding what's going on would be great.
Best Regards, Martin Owens

Update:
Got the width/height bug sorted today.
You can see from the patch diff here: http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/12289 that the problem was caused by the sp-use code saving width and height attributes as doubles instead of lengths with units.
I had a look and I noticed that some other attributes are doing the same thing. For instance sp-rect saves doubles instead of lengths for width and height and I'm not sure why. I checked the svg spec for both attributes and units are allows there.
Does anyone know any reason to use doubles over lengths?
Should a new convenience function be made in xml/repr-utils.cpp ? something like sp_repr_set_svg_length to go with sp_repr_set_svg_double? It would mean including svg/svg.h in xml/repr-utils and resisted in case there is a separation I should be honoring.
Examples of SVGLength being saved into the document is limited to sp-root.cpp. The comment there suggests everything else uses absolute values. Not sure what to make of it.
Martin,
On Sat, 2013-04-20 at 00:59 -0400, Martin Owens wrote:
Hey devs,
I've been tracking this bug: https://bugs.launchpad.net/inkscape/+bug/1107924
Dragging symbols to the document 'pastes' them in. The 'use' element created points to the symbol definition. But it also adds width="1" height="1" to the element which is erronious. sp-use.cpp sets width and height to 100% (1.0 + SVGLength::PERCENT) and I thought that might be the culprit, but it's not effecting these use elements.
So I traced the copy process, outputting the xml at each step through the copy process. The use element created and passed around never has a width and height attribute and setting one gets overridden.
So I'm at a loss, the element from the paste process acquires attributes by some magic I can't yet trace. Any help understanding what's going on would be great.
Best Regards, Martin Owens
participants (1)
-
Martin Owens