On Tue, 2013-10-01 at 02:16 +0200, Krzysztof KosiĆski wrote:
2013/9/30 Markus Engel <p637777@...1081...>:
It would be very nice if Inkscape could directly create the SVG circle and ellipse elements rather than use the SVG path element.
The problem here is that then it must be possible to convert between circles and ellipses and paths in both directions. This probably adds lots of buttons and menu entries to the UI.
Not really. The UI can work like it does at present, but the same SPObject subclass must handle more than one type of XML node, and it should change the XML element name as appropriate in response to tweaking the controls.
Right now there are three classes: SPCircle, SPEllipse, and SPArc, each derived from SPGenericEllipse. To get the GUI to work with each of the derived classes is simple (almost everything needed is already in the SPGenericEllipse class). I have a private build that implements this.
The problem is to be able to change on the fly the SVG element type. One approach I am thinking about is to get rid of the three derived classes and handle the element type directly in SPGenericEllipse.
An SVG circle would be written out if rx==ry and end==start and there is no LPE. An SVG ellipse would be written out if rx!=ry and end==start and there is no LPE. An SVG path of sodipodi:type arc would be written out if end!=start or if there is an LPE.
A user option could be provided to force a path to always be written out.
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.
Tav
Note to self: see sp_item_list_to_curves in path-chemistry.cpp for changing element type.