]> granicus.if.org Git - graphviz/commitdiff
don't bother with sizing empty strings
authorellson <devnull@localhost>
Tue, 12 Sep 2006 20:08:50 +0000 (20:08 +0000)
committerellson <devnull@localhost>
Tue, 12 Sep 2006 20:08:50 +0000 (20:08 +0000)
lib/common/labels.c

index dfadd2a4c3c7e6c9420b465a6de2ea50440f02c0..10af571eba554a7bc0389de07b878023cfd47c94 100644 (file)
@@ -21,7 +21,7 @@
 
 static void storeline(graph_t *g, textlabel_t *lp, char *line, char terminator)
 {
-    pointf size;
+    pointf size = {0.,0.};
     textpara_t *para;
 
     lp->u.txt.para =
@@ -29,7 +29,8 @@ static void storeline(graph_t *g, textlabel_t *lp, char *line, char terminator)
     para = &(lp->u.txt.para[lp->u.txt.nparas]);
     para->str = line;
     para->just = terminator;
-    size = textsize(g, para, lp->fontname, lp->fontsize);
+    if (line && line[0])
+        size = textsize(g, para, lp->fontname, lp->fontsize);
     lp->u.txt.nparas++;
     /* width = max line width */
     lp->dimen.x = MAX(lp->dimen.x, size.x);