On Fri, Sep 30, 2011 at 11:04 AM, Martin Owens <doctormo@...400...> wrote:
On Fri, 2011-09-30 at 01:55 -0700, Jon Cruz wrote:
When the connectors were being worked out, I was told that most of the could would be able to handle multiple potential connection points in general, but the code to get them in as source was not done.
The code had a few errors which prevented multiple connectors working, but on the whole that's to be expected when the logic was never tested. I can say however that it did appear to be leaning heavily towards multiple points, although there is a lot of code which didn't seem to do anything, or at least nothing I could activate.
It might be worth looking into, since it sounds like you're on track with at least some other of the connectors cleanup.
The text of a path stuff is interesting, but what the connector work needs is relative coords. So I cheated by using the center points in child objects of groups. At the moment I detect only rectangles inside a group, but I think a better solution would be to use an inkscape attribute on the object probably loaded in sp_item or sp_object.
The only difficulty is having groups where some of the child objects are deliberately invisible to the renderer but are used as connector points for functionality. Mixing on canvas elements and editor information is something I don't like, but this solution was too interesting not to try.
Not sure if the connector code can be cleaned up, it's hard to know what we have and what we want it to continue to do.
At one point we already had connector code to add/move/remove additional connector points. However, it ended up either getting commented out or removed because it didn't work how it should. Specifically, the student who created it did not follow how other tools work, when you clicked it would not set the point, if I recall correctly you had to hit the Enter key. So it was actually really straightforward stuff that just never fixed. I seem to recall telling them to disable it prior to a release on the sole basis that it was unintuitive and it didn't work like every other tool in Inkscape.
I'm not sure if resurrecting that code and fixing it up or a modified version of your new approach is the right way to go. Did you happen to notice a bunch of commented out code when browsing through the connector stuff? If it was deleted, it's still somewhere in the revision history at least to see which might be better.
Cheers, Josh