]> granicus.if.org Git - graphviz/commitdiff
Fix typo when converting to floating point:
authorerg <devnull@localhost>
Wed, 20 Aug 2008 21:18:37 +0000 (21:18 +0000)
committererg <devnull@localhost>
Wed, 20 Aug 2008 21:18:37 +0000 (21:18 +0000)
   sp->LeftBound became sp->Splinesep

Moved resolution of dynamic ports to last minute for dot, otherwise
it is impossible to figure out what structure needs to be resolved.

lib/common/render.h
lib/common/shapes.c
lib/common/splines.c
lib/dotgen/dotsplines.c

index c8f31b360b2957b89a41a927d9dad98be7773b99..7cc185767eb34e022ecdcd0faecf406008e148c1 100644 (file)
@@ -133,6 +133,7 @@ extern "C" {
     extern void pop_obj_state(GVJ_t *job);
     extern obj_state_t* push_obj_state(GVJ_t *job);
     extern int rank(graph_t * g, int balance, int maxiter);
+    extern port resolvePort(node_t*  n, node_t* other, port* oldport);
     extern void resolvePorts (edge_t* e);
     extern void round_corners(GVJ_t*, char*, char*, pointf*, int, int);
     extern void routesplinesinit(void);
index 80168d3c3096be28f85d61861a53ecec888ce115..6be98a2a2face2d5ade42331b3e9a0b16aa5e047 100644 (file)
@@ -21,7 +21,7 @@
 #define RBCONST 12
 #define RBCURVE .5
 
-static port Center = { {0, 0}, -1, 0, 0, 0, 1, 0, 0 };
+static port Center = { {0, 0}, -1, 0, 0, 0, 1, 0, 0, 0 };
 
 #define ATTR_SET(a,n) ((a) && (*(agxget(n,a->index)) != '\0'))
   /* Default point size = 0.05 inches or 3.6 points */
@@ -2083,9 +2083,9 @@ static void indent(int l)
        fputs("  ", stderr);
 }
 
-static void prbox(box b)
+static void prbox(boxf b)
 {
-    fprintf(stderr, "((%d,%d),(%d,%d))\n", b.LL.x, b.LL.y, b.UR.x, b.UR.y);
+    fprintf(stderr, "((%f,%f),(%f,%f))\n", b.LL.x, b.LL.y, b.UR.x, b.UR.y);
 }
 
 static void dumpL(field_t * info, int level)
@@ -2542,7 +2542,8 @@ static char* closestSide (node_t*  n, node_t* other, port* oldport)
     return rv;
 }
 
-static port resolvePort(node_t*  n, node_t* other, port* oldport)
+port 
+resolvePort(node_t*  n, node_t* other, port* oldport)
 {
     port rv;
     char* compass = closestSide (n, other, oldport);  
index bc30f0157a7567caae094872647fd07779cc6fa4..111d241d9f21d8e076af32800c6f1ae5d99a3361 100644 (file)
@@ -390,6 +390,8 @@ beginpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge)
 
     n = e->tail;
 
+    if (ED_tail_port(e).dyna)
+       ED_tail_port(e) = resolvePort(e->tail, e->head, &ED_tail_port(e));
     if (ND_shape(n))
        pboxfn = ND_shape(n)->fns->pboxfn;
     else
@@ -580,6 +582,8 @@ void endpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge)
 
     n = e->head;
 
+    if (ED_head_port(e).dyna) 
+       ED_head_port(e) = resolvePort(e->head, e->tail, &ED_head_port(e));
     if (ND_shape(n))
        pboxfn = ND_shape(n)->fns->pboxfn;
     else
index 6a4a99a989276dd9121222836905a7e7e13f2c35..f8d2236f3adecb4b236a9949975ca5625345f266 100644 (file)
@@ -322,9 +322,6 @@ static void _dot_splines(graph_t * g, int normalize)
        }
     }
 
-    for (i = 0; i < n_edges; i++)
-       resolvePorts (getmainedge(edges[i]));
-
     /* Sort so that equivalent edges are contiguous. 
      * Equivalence should basically mean that 2 edges have the
      * same set {(tailnode,tailport),(headnode,headport)}, or
@@ -2306,7 +2303,7 @@ static box maximal_bbox(spline_info_t* sp, node_t* vn, edge_t* ie, edge_t* oe)
            b = nb;
        rv.LL.x = ROUND(b);
     } else
-       rv.LL.x = MIN(ROUND(b), sp->Splinesep);
+       rv.LL.x = MIN(ROUND(b), sp->LeftBound);
 
     /* we have to leave room for our own label! */
     if ((ND_node_type(vn) == VIRTUAL) && (ND_label(vn)))