]> granicus.if.org Git - graphviz/commitdiff
Fix horizontal alignment bug in html cells
authorerg <devnull@localhost>
Thu, 19 May 2005 21:10:05 +0000 (21:10 +0000)
committererg <devnull@localhost>
Thu, 19 May 2005 21:10:05 +0000 (21:10 +0000)
lib/common/htmltable.c

index b1675d3da468c7fc0e8574e37acbf3fec99ea188..4c39f671ecde62bdaa950573e2e7775c1dad6072 100644 (file)
@@ -51,6 +51,7 @@ typedef struct {
     graph_t *g;
 } htmlenv_t;
 
+#define DEBUG 1
 #ifdef DEBUG
 static void printCell(htmlcell_t * cp, int ind);
 #endif
@@ -134,7 +135,7 @@ emit_html_txt(GVJ_t * job, htmltxt_t * tp, htmlenv_t * env, void *obj)
     }
 
     halfwidth_x = ((double)(tp->box.UR.x - tp->box.LL.x))/2.0;
-    p.x = env->p.x;
+    p.x = env->p.x + ((double)(tp->box.UR.x + tp->box.LL.x))/2.0;
     p.y = env->p.y + ((double)(tp->box.UR.y + tp->box.LL.y))/2.0;
 
     emit_textlines(job, tp->nlines, tp->line, p,
@@ -1299,11 +1300,10 @@ void printBox(box b)
     fprintf(stderr, "(%d,%d)(%d,%d)", b.LL.x, b.LL.y, b.UR.x, b.UR.y);
 }
 
-void printImage(char *tp, int ind)
+void printImage(htmlimg_t *ip, int ind)
 {
-    int i;
     indent(ind);
-    fprintf(stderr, "img: %s\n", tp);
+    fprintf(stderr, "img: %s\n", ip->src);
 }
 
 void printTxt(htmltxt_t * tp, int ind)