]> granicus.if.org Git - graphviz/commitdiff
Fix bug 690
authorerg <devnull@localhost>
Sat, 23 Apr 2005 20:18:52 +0000 (20:18 +0000)
committererg <devnull@localhost>
Sat, 23 Apr 2005 20:18:52 +0000 (20:18 +0000)
lib/common/splines.c

index e2e47488c7e97dfa8cd10a2fc963ba9d292086d0..362c8231b53021187887bde94b41e478446c1a82 100644 (file)
@@ -251,7 +251,7 @@ clip_and_install(edge_t * fe, edge_t * le, point * ps, int pn,
     pointf p2;
     bezier *newspl;
     node_t *tn, *hn;
-    int start, end, i;
+    int start, end, i, clipTail, clipHead;
     graph_t *g;
     edge_t *orig;
     inside_t inside_context;
@@ -270,9 +270,17 @@ clip_and_install(edge_t * fe, edge_t * le, point * ps, int pn,
        hn = tn;
        tn = tmp;
     }
+    if (tn == orig->tail) {
+       clipTail = ED_tail_port(orig).clip;
+       clipHead = ED_head_port(orig).clip;
+    }
+    else { /* fe and orig are reversed */
+       clipTail = ED_head_port(orig).clip;
+       clipHead = ED_tail_port(orig).clip;
+    }
 
     /* spline may be interior to node */
-    if(ED_tail_port(orig).clip && ND_shape(tn) && ND_shape(tn)->fns->insidefn) {
+    if(clipTail && ND_shape(tn) && ND_shape(tn)->fns->insidefn) {
        inside_context.s.n = tn;
        inside_context.s.bp = ED_tail_port(orig).bp;
        for (start = 0; start < pn - 4; start += 3) {
@@ -284,7 +292,7 @@ clip_and_install(edge_t * fe, edge_t * le, point * ps, int pn,
        shape_clip0(&inside_context, tn, &ps[start], TRUE);
     } else
        start = 0;
-    if(ED_head_port(orig).clip && ND_shape(hn) && ND_shape(hn)->fns->insidefn) {
+    if(clipHead && ND_shape(hn) && ND_shape(hn)->fns->insidefn) {
        inside_context.s.n = hn;
        inside_context.s.bp = ED_head_port(orig).bp;
        for (end = pn - 4; end > 0; end -= 3) {