Hi,
This week, again I feel I spent way too much time in gdb I moved the code from using SPKnot for handles to ui/tool/ControlPoint. I did this not for dragging (SPKnot has built-in dragging) but for the selection feature of SelectableControlPoint s.
Connector creation by dragging or clicking both ends works now, live preview works, saving connectors works.
Remaining are a couple of segfaults: One when closing inkscape without saving just after a Connector has been created while the connector tool is still active, and one when I try to drag an endpoint of the connector. This one is actually quite tricky, I have not yet been able to track down its cause properly. Another issue is that when a Connector is created with two clicks (but *not* when it is created via dragging), I have a leftover SPPoint at its start. I think I know where this comes from, but I have not yet found out how to properly delete a SVG object in inkscape without segfaulting. And finally, though I can save SPPoints and SPConnectors just fine to SVG, I can't load them yet.
I would appreciate some eyes on the connector creation code in SPConnector.cpp with respect to the SPPoint dragging segfaults. I am not very confident of my work in ref/unrefing things in the connector context.
The code can be found at [0]. To compile it, add -std=c++11 to your CPPFLAGS. It still needs that for a little variadic template I wrote. I will change this to a bunch of non-variadic ones for pre-C++11 before integrating.
Best regards, Sebastian
[0] https://code.launchpad.net/~h-e-6/inkscape/connector-wip
On Sat, 2013-08-10 at 00:10 +0200, jaseg wrote:
Hi,
This week, again I feel I spent way too much time in gdb I moved the code from using SPKnot for handles to ui/tool/ControlPoint. I did this not for dragging (SPKnot has built-in dragging) but for the selection feature of SelectableControlPoint s.
Connector creation by dragging or clicking both ends works now, live preview works, saving connectors works.
Remaining are a couple of segfaults: One when closing inkscape without saving just after a Connector has been created while the connector tool is still active, and one when I try to drag an endpoint of the connector. This one is actually quite tricky, I have not yet been able to track down its cause properly. Another issue is that when a Connector is created with two clicks (but *not* when it is created via dragging), I have a leftover SPPoint at its start. I think I know where this comes from, but I have not yet found out how to properly delete a SVG object in inkscape without segfaulting. And finally, though I can save SPPoints and SPConnectors just fine to SVG, I can't load them yet.
Any progress fixing these things?
If I draw a single connector via dragging, I segfault dragging the start handle. The loop inside ControlPointSelection::_pointDragged is not terminating properly. The length of _points is one but it is entering the loop a second time. The only thing I can think of is that something is invalidating the iterator but I don't see anything obviously wrong.
I would appreciate some eyes on the connector creation code in SPConnector.cpp with respect to the SPPoint dragging segfaults. I am not very confident of my work in ref/unrefing things in the connector context.
The code can be found at [0]. To compile it, add -std=c++11 to your CPPFLAGS. It still needs that for a little variadic template I wrote. I will change this to a bunch of non-variadic ones for pre-C++11 before integrating.
Best regards, Sebastian
[0] https://code.launchpad.net/~h-e-6/inkscape/connector-wip
On Sat, 2013-08-10 at 00:10 +0200, jaseg wrote:
And finally, though I can save SPPoints and SPConnectors just fine to SVG, I can't load them yet.
I see one possible problem with the loading code. When inkscape:connector-end or inkscape:connector-start are read in, the subroutine SPConnector::setEnd(int idx, SPPoint *end) is called. This calls SPConnector::redraw() which causes the path to be updated. Updating the path while still in the process of reading it in is probably not a good idea. If I comment out the redraw(), the path is read in correctly (but the points are not displayed).
Tav
participants (2)
-
jaseg
-
Tavmjong Bah