]> granicus.if.org Git - graphviz/commitdiff
change record fielt_t.size to pointf.
authorellson <devnull@localhost>
Wed, 10 Sep 2008 23:48:35 +0000 (23:48 +0000)
committerellson <devnull@localhost>
Wed, 10 Sep 2008 23:48:35 +0000 (23:48 +0000)
   - does somehing very weird to diagen, but diagen is basically broken - need to work on plugin

lib/common/diagen.c
lib/common/shapes.c
lib/common/types.h

index 1075b6225250ac42115d3db7a63ef12f0bc8c7a8..0ee858d557ab811b5792adfdb6489d4b1c465e86 100644 (file)
@@ -742,9 +742,7 @@ static void
 dia_bezier(point * A, int n, int arrow_at_start, int arrow_at_end, int filled)
 {
     int i, conn_h, conn_t;
-    pointf p, firstp = { 0, 0 }, llp = {
-    0, 0}, urp = {
-    0, 0};
+    pointf p, firstp = { 0, 0 }, llp = { 0, 0}, urp = { 0, 0};
     node_t *head, *tail;
     char *shape_t;
     pointf cp_h, cp_t;
@@ -820,6 +818,7 @@ dia_bezier(point * A, int n, int arrow_at_start, int arrow_at_end, int filled)
         dia_fputs("      </dia:attribute>\n");
         dia_fputs("      <dia:connections>\n");
     
+/* FIXME !!! - What is this crap!   It should just user the arrow vector. */
         if ((strcmp(shape_t, "ellipse") == 0)
            || (strcmp(shape_t, "circle") == 0)
            || (strcmp(shape_t, "doublecircle") == 0)) {
@@ -828,6 +827,7 @@ dia_bezier(point * A, int n, int arrow_at_start, int arrow_at_end, int filled)
                conn_h = ellipse_connection(cp_h, diapt(A[n - 1]));
            else
                conn_h = ellipse_connection(cp_h, diapt(A[0]));
+        } else if (strcmp(shape_t, "record") == 0) { 
         } else {
            if (AG_IS_DIRECTED(Rootgraph))
                conn_h = box_connection(head, diapt(A[n - 1]));
@@ -843,6 +843,7 @@ dia_bezier(point * A, int n, int arrow_at_start, int arrow_at_end, int filled)
                conn_t = ellipse_connection(cp_t, diapt(A[0]));
            else
                conn_t = ellipse_connection(cp_t, diapt(A[n - 1]));
+        } else if (strcmp(shape_t, "record") == 0) {
         } else {
            if (AG_IS_DIRECTED(Rootgraph))
                conn_t = box_connection(tail, diapt(A[0]));
index ea4a3fc74be3aa94c22fdddd4274c191fcb28947..f020842efe16319f09f8cb3985aed63d91fab9c0 100644 (file)
@@ -1951,12 +1951,12 @@ dotext :
     return rv;
 }
 
-static point size_reclbl(node_t * n, field_t * f)
+static pointf size_reclbl(node_t * n, field_t * f)
 {
     int i;
     char *p;
     double marginx, marginy;
-    point d, d0;
+    pointf d, d0;
     pointf dimen;
 
     if (f->lp) {
@@ -1978,7 +1978,7 @@ static point size_reclbl(node_t * n, field_t * f)
            } else
                PAD(dimen);
        }
-       PF2P(dimen, d);
+       d = dimen;
     } else {
        d.x = d.y = 0;
        for (i = 0; i < f->n_flds; i++) {
@@ -1996,12 +1996,12 @@ static point size_reclbl(node_t * n, field_t * f)
     return d;
 }
 
-static void resize_reclbl(field_t * f, point sz, int nojustify_p)
+static void resize_reclbl(field_t * f, pointf sz, int nojustify_p)
 {
     int i, amt;
     double inc;
     pointf d;
-    point newsz;
+    pointf newsz;
     field_t *sf;
 
     /* adjust field */
@@ -2026,9 +2026,9 @@ static void resize_reclbl(field_t * f, point sz, int nojustify_p)
            sf = f->fld[i];
            amt = ((int) ((i + 1) * inc)) - ((int) (i * inc));
            if (f->LR)
-               newsz = pointof(sf->size.x + amt, sz.y);
+               newsz = pointfof(sf->size.x + amt, sz.y);
            else
-               newsz = pointof(sz.x, sf->size.y + amt);
+               newsz = pointfof(sz.x, sf->size.y + amt);
            resize_reclbl(sf, newsz, nojustify_p);
        }
     }
@@ -2039,7 +2039,7 @@ static void resize_reclbl(field_t * f, point sz, int nojustify_p)
  * the sides attribute, which indicates which sides of the
  * record are accessible to the field.
  */
-static void pos_reclbl(field_t * f, point ul, int sides)
+static void pos_reclbl(field_t * f, pointf ul, int sides)
 {
     int i, last, mask;
 
@@ -2110,7 +2110,7 @@ static void dumpL(field_t * info, int level)
 static void record_init(node_t * n)
 {
     field_t *info;
-    point ul, sz;
+    pointf ul, sz;
     int flip, len;
     char *textbuf;             /* temp buffer for storing labels */
     int sides = BOTTOM | RIGHT | TOP | LEFT; 
@@ -2142,7 +2142,7 @@ static void record_init(node_t * n)
        sz.y = MAX(info->size.y, sz.y);
     }
     resize_reclbl(info, sz, mapbool(late_string(n, N_nojustify, "false")));
-    ul = pointof(-sz.x / 2, sz.y / 2);          /* suspected to introduce ronding error - see Kluge below */
+    ul = pointfof(-sz.x / 2., sz.y / 2.);          /* FIXME - is this still true:    suspected to introduce ronding error - see Kluge below */
     pos_reclbl(info, ul, sides);
     ND_width(n) = PS2INCH(info->size.x);
     ND_height(n) = PS2INCH(info->size.y + 1);   /* Kluge!!  +1 to fix rounding diff between layout and rendering 
index 5d6ce95382bbe502c71703d9dae341848584b08e..d2bcf4be9bfdfea77054069db31b18ba10ebf073 100644 (file)
@@ -280,7 +280,7 @@ extern "C" {
 
 /* for "record" shapes */
     typedef struct field_t {
-       point size;             /* its dimension */
+       pointf size;            /* its dimension */
        boxf b;                 /* its placement in node's coordinates */
        int n_flds;
        textlabel_t *lp;        /* n_flds == 0 */