Re: Border floating connections



On 17 Sep 2003, Wynand Winterbach wrote:
I started using DIA for graph theory related figures, and it's helped a
lot.

However, there is one feature that I've always longed for. I'll explain
as follows:

the edges that are drawn should preferably be connected to the center of
a vertex, and this is easily achieved by defining a custom shape;
however, this only works for when the lines don't have arrow tips on
them, so of course what does happen when we do have arrows, is a
situation as follows (where the O's represent vertices, and there is a
line from left to right)...

      \
O------0
      /

instead of

     \
O----->0
     /

The solution is that either:

a) the edges still get connected to the center of the vertex, but a line
must be coded which "knows" where the object that it is pointing to has
its border, so that it can correctly draw the arrow tip.

b) the whole border of a vertex should be able to serve as a connection
point - this would mean that the exact point of connection would move
smoothly along the border as the other side of the line gets moved.

Is there any way to implement this currently? If so, I'd like to give it
a bash.

There's actually some code in there that does that.  Take a look at
objects/standard/line.c, it has some commented out sections about 'line
gaps'.  It essentially allows a gap between the connection point and the
drawn end of the line, specified either as a absolute distance, a
percentage, or just as 'to the edge'.  I haven't set that as generally
available, since the interface is rough and fairly incomplete, but if you
want to play with it -- possibly make it work with other connectors than
lines -- that'd be great.  

I'm thinking the main use of it will be to allow exactly what you describe
in a), that the middle of an object (or the entire object) is a connection
point, but the connector just automatically stops at the end.  The
possibility of having other kinds of gaps could be useful sometimes, but is
not as essential.

-Lars

-- 
Lars Clausen (http://shasta.cs.uiuc.edu/~lrclause)| HÃrdgrim of Numenor
"I do not agree with a word that you say, but I   |----------------------------
will defend to the death your right to say it."   | Where are we going, and
    --Evelyn Beatrice Hall paraphrasing Voltaire  | what's with the handbasket?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]