From 0477ff3b909652fc7b4cca622ac95c7d4070723b Mon Sep 17 00:00:00 2001 From: erg Date: Wed, 1 Apr 2009 20:26:28 +0000 Subject: [PATCH] Fix neato spline code to revert to line segments if the nodes overlap --- lib/neatogen/neatosplines.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/neatogen/neatosplines.c b/lib/neatogen/neatosplines.c index 6a816a931..9870585e4 100644 --- a/lib/neatogen/neatosplines.c +++ b/lib/neatogen/neatosplines.c @@ -755,6 +755,7 @@ static int _spline_edges(graph_t * g, expand_t* pmargin, int edgetype) path *P = NULL; int useEdges = (Nop > 1); router_t* rtr = 0; + int legal; /* build configuration */ if (edgetype != ET_LINE) { @@ -773,7 +774,7 @@ static int _spline_edges(graph_t * g, expand_t* pmargin, int edgetype) } npoly = i; if (obs) { - if (Plegal_arrangement(obs, npoly)) { + if ((legal = Plegal_arrangement(obs, npoly))) { if (edgetype != ET_ORTHO) vconfig = Pobsopen(obs, npoly); } else if (Verbose) @@ -784,7 +785,7 @@ static int _spline_edges(graph_t * g, expand_t* pmargin, int edgetype) /* route edges */ if (Verbose) fprintf(stderr, "Creating edges using %s\n", - (edgetype == ET_ORTHO) ? "orthogonal lines" : + (legal && (edgetype == ET_ORTHO)) ? "orthogonal lines" : (vconfig ? (edgetype == ET_SPLINE ? "splines" : "polylines") : "line segments")); if (vconfig) { @@ -796,7 +797,7 @@ static int _spline_edges(graph_t * g, expand_t* pmargin, int edgetype) } } #ifdef ORTHO - else if (edgetype == ET_ORTHO) { + else if (legal && (edgetype == ET_ORTHO)) { orthoEdges (g, 0); useEdges = 1; } -- 2.40.0