Lars Clausen wrote:
On Mon, 2005-03-14 at 15:21 +0100, Grégoire Dooms wrote:Hmm. Not sure about this. I think compositionality is a good thing
Hello,
Here is a context diff against CVS HEAD.
I implemented auto gap + absolute gap for lines and beziers.
It works like a charm (AFAIK :-).
I added the properties GUI (could be prettier).
Works nicely, indeed. Thank you very much for working on this! There's a few things I'd like to see changed, though.
Most importantly, the autogap feature should be dependent on which
connectionpoint you connect to -- it doesn't make a lot of sense unless
you're connected to a central connection point (a bit of sense, though,
but it looks weird). Making it depend on the CP will also remove those
options from the properties dialog, always a good thing.
To move the head, move the second handle of the connected point. The auto-gap feature on bezier conserves the slope at the endpoint (this was my first proposition in a former mail). I chose this one after observing the behavior of bezier connected to an object when you drag the other point: they don't move around the connected point, they also conserve their slope.We'll then need a flag on CPs to say that they autogap (are interior). I'm thinking the Element class should automatically add this. For now, we can just set it explicitly on the objects that have an interior CP. Hmmm... CPs don't have flags as such yet, but they have the directions 4-bit which is kinda flaglike. Nah, it's gotta be a new field flags.
For submitting patches, it'd be nice if you use the -u (unified) flag and did not compress it (unless it's >40K large).
The only thing missing for a very nice way to output a graph from graphviz is the central connection point on the text object.
I also attach an example dia file.
The bezier autogap is significantly different from the line autogap, in
that it doesn't move the head around the object.
There are a few bugs left.I'd like to see the other simple lines (polyline, zigzagline in particular) have gaps too. And if the gap stuff is moved to the Connection/Orthconn classes, it'll suddenly apply to a whole lot of other objects. See how autorouting is handled in OrthConn for examples on how to do this. But this is second priority, first is proper gap defs for simple lines.
-- Grégoire Dooms