From: Johannes Dewender Date: Tue, 18 Mar 2014 21:26:04 +0000 (+0100) Subject: 0002434: neatogen: fix spline not being created X-Git-Tag: 2.38.0~21^2~1^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5456b3fb8c9c51d8680b157e6bec1626cf129874;p=graphviz 0002434: neatogen: fix spline not being created We try to make a multi spline when there are multiple edges between two nodes. We only make create this multi spline for the leader of these edges. If the leader already has a spline set and we are supposed to use given splines (Nop > 1), then no multi spline will be created at all, also not for other splines. So we don't include these splines in the search for equivalent edges. --- diff --git a/lib/neatogen/neatosplines.c b/lib/neatogen/neatosplines.c index 80d4198e7..cbf2d3aff 100644 --- a/lib/neatogen/neatosplines.c +++ b/lib/neatogen/neatosplines.c @@ -714,11 +714,21 @@ splineEdges(graph_t * g, int (*edgefn) (graph_t *, expand_t*, int), map = dtopen(&edgeItemDisc, Dtoset); for (n = agfstnode(g); n; n = agnxtnode(g, n)) { for (e = agfstout(g, n); e; e = agnxtout(g, e)) { - edge_t *leader = equivEdge(map, e); - if (leader != e) { - ED_count(leader)++; - ED_to_virt(e) = ED_to_virt(leader); - ED_to_virt(leader) = e; + if (!(Nop > 1 && ED_spl(e))) { + /* with nop > 1 (use given edges) + * and a given edge, no edges are created + * so other edges being equivalent to this + * also wouldn't be created + */ + edge_t *leader = equivEdge(map, e); + if (leader != e) { + fprintf(stderr, "leader != e\n"); + ED_count(leader)++; + ED_to_virt(e) = ED_to_virt(leader); + ED_to_virt(leader) = e; + } + } else { + ED_count(e)++; } } }