From: Emden Gansner Date: Thu, 1 Mar 2012 18:34:29 +0000 (-0500) Subject: Fix a couple of typos and add end point fudge factors to the path to X-Git-Tag: LAST_LIBGRAPH~32^2~466^2~4^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6944f62eaedc739c1eed3f8192569bea8c3e1a1a;p=graphviz Fix a couple of typos and add end point fudge factors to the path to guarantee the start and end points from ports will be interior to the bounding boxes. This helps to avoid the possibility that the path planner may create a degenerate spline running along box edges. Fixes bug 2205. --- diff --git a/lib/common/splines.c b/lib/common/splines.c index ce8d78128..3c6514ec9 100644 --- a/lib/common/splines.c +++ b/lib/common/splines.c @@ -356,8 +356,8 @@ void add_box(path * P, boxf b) /* beginpath: * Set up boxes near the tail node. - * For regular nodes, the result should be a list of continguous rectangles - * such that the last one ends has the smallest LL.y and its LL.y is above + * For regular nodes, the result should be a list of contiguous rectangles + * such that the last one has the smallest LL.y and its LL.y is above * the bottom of the rank (rank.ht1). * * For flat edges, we assume endp->sidemask has been set. For regular @@ -493,6 +493,7 @@ beginpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge) b.LL.y = MIN(b.LL.y,P->start.p.y); endp->boxes[0] = b; endp->boxn = 1; + P->start.p.y += 1; } else if (side & BOTTOM) { if (endp->sidemask == TOP) { @@ -513,6 +514,7 @@ beginpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge) endp->boxes[0] = b; endp->boxn = 1; } + P->start.p.y -= 1; } else if (side & LEFT) { b.UR.x = P->start.p.x+1; @@ -526,6 +528,7 @@ beginpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge) } endp->boxes[0] = b; endp->boxn = 1; + P->start.p.x -= 1; } else { b.LL.x = P->start.p.x; @@ -539,6 +542,7 @@ beginpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge) } endp->boxes[0] = b; endp->boxn = 1; + P->start.p.x += 1; } for (orig = e; ED_edge_type(orig) != NORMAL; orig = ED_to_orig(orig)); if (n == agtail(orig)) @@ -685,6 +689,7 @@ void endpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge) b.LL.y = MIN(b.LL.y,P->end.p.y); endp->boxes[0] = b; endp->boxn = 1; + P->end.p.y += 1; } else if (side & BOTTOM) { if (endp->sidemask == TOP) { @@ -705,6 +710,7 @@ void endpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge) endp->boxes[0] = b; endp->boxn = 1; } + P->end.p.y -= 1; } else if (side & LEFT) { b.UR.x = P->end.p.x+1; @@ -718,6 +724,7 @@ void endpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge) } endp->boxes[0] = b; endp->boxn = 1; + P->end.p.x -= 1; } else { b.LL.x = P->end.p.x-1; @@ -731,6 +738,7 @@ void endpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge) } endp->boxes[0] = b; endp->boxn = 1; + P->end.p.x += 1; } for (orig = e; ED_edge_type(orig) != NORMAL; orig = ED_to_orig(orig)); if (n == aghead(orig))