From: erg Date: Thu, 14 May 2009 15:47:20 +0000 (+0000) Subject: Add extra field to splineInfo to better handle possibly swapped edges X-Git-Tag: LAST_LIBGRAPH~32^2~2072 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50b768e6a951c9fdb8b96c4014936378612ed451;p=graphviz Add extra field to splineInfo to better handle possibly swapped edges --- diff --git a/lib/common/splines.c b/lib/common/splines.c index 979e81e83..8cb48a8b4 100644 --- a/lib/common/splines.c +++ b/lib/common/splines.c @@ -69,7 +69,10 @@ arrow_clip(edge_t * fe, node_t * hn, for (e = fe; ED_to_orig(e); e = ED_to_orig(e)); - j = info->swapEnds(e); + if (info->ignoreSwap) + j = 0; + else + j = info->swapEnds(e); arrow_flags(e, &sflag, &eflag); if (info->splineMerge(hn)) eflag = ARR_NONE; @@ -249,7 +252,7 @@ clip_and_install(edge_t * fe, node_t * hn, pointf * ps, int pn, for (orig = fe; ED_edge_type(orig) != NORMAL; orig = ED_to_orig(orig)); /* may be a reversed flat edge */ - if ((ND_rank(tn) == ND_rank(hn)) && (ND_order(tn) > ND_order(hn))) { + if (!info->ignoreSwap && (ND_rank(tn) == ND_rank(hn)) && (ND_order(tn) > ND_order(hn))) { node_t *tmp; tmp = hn; hn = tn; diff --git a/lib/common/types.h b/lib/common/types.h index eec88bc93..eea21595e 100644 --- a/lib/common/types.h +++ b/lib/common/types.h @@ -92,6 +92,7 @@ extern "C" { typedef struct { boolean(*swapEnds) (edge_t * e); /* Should head and tail be swapped? */ boolean(*splineMerge) (node_t * n); /* Is n a node in the middle of an edge? */ + boolean ignoreSwap; /* Test for swapped edges if false */ } splineInfo; typedef struct pathend_t {