
On Thu, 2013-10-03 at 21:09 +0200, Krzysztof KosiĆski wrote:
2013/10/3 Tavmjong Bah <tavmjong@...8...>:
Currently there is no such code in Inkscape, but allowing this would not be too intrusive. In fact, I think it can already be done by using Inkscape::XML::Node::setCodeUnsafe().
I don't understand how using Inkscape::XML::NOde::setCodeUnsafe() would help.
IIRC, this function allows you to change the element name without removing it from the XML tree.
I've got the code to auto-convert between SVG circle, ellipse, and path (arc) mostly working using setCodeUnsafe(). I've got two problems left:
1. The XML dialog does not update the element type. The actual XML tree is changed. I don't know how to signal the XML dialog to reload the XML tree (switching between two different desktops does result in an update). It seems I need an _observer.notifyElementChanged signal but how to actually do this is hurting my grey cells. Any hints would be appreciated.
2. There is a bug with adding an LPE to a circle/ellipse. The element is converted to a path and the 'd' data is added but none of the other attributes are saved. This shouldn't be too hard to fix.
Tav