From: ellson Date: Tue, 12 Sep 2006 20:08:50 +0000 (+0000) Subject: don't bother with sizing empty strings X-Git-Tag: LAST_LIBGRAPH~32^2~5885 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b4ed2d40d937b7d79555d0dca2bbfa255e91bd8;p=graphviz don't bother with sizing empty strings --- diff --git a/lib/common/labels.c b/lib/common/labels.c index dfadd2a4c..10af571eb 100644 --- a/lib/common/labels.c +++ b/lib/common/labels.c @@ -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);