From: erg Date: Thu, 4 Feb 2010 17:46:09 +0000 (+0000) Subject: If user specifies explicit white background, draw it. X-Git-Tag: LAST_LIBGRAPH~32^2~1451 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3fc1ae1201e8d993003fdfb91cdb53579f61942f;p=graphviz If user specifies explicit white background, draw it. --- diff --git a/lib/common/emit.c b/lib/common/emit.c index 914927747..6b631fdbe 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -941,18 +941,23 @@ static void emit_background(GVJ_t * job, graph_t *g) { xdot* xd; char *str; + int dfltColor; /* if no bgcolor specified - first assume default of "white" */ - if (! ((str = agget(g, "bgcolor")) && str[0])) + if (! ((str = agget(g, "bgcolor")) && str[0])) { str = "white"; + dfltColor = 1; + } + else + dfltColor = 0; /* if device has no truecolor support, change "transparent" to "white" */ if (! (job->flags & GVDEVICE_DOES_TRUECOLOR) && (streq(str, "transparent"))) str = "white"; - /* except for "tranparent" on truecolor, or "white" on (assumed) white paper, paint background */ + /* except for "tranparent" on truecolor, or default "white" on (assumed) white paper, paint background */ if (!( ((job->flags & GVDEVICE_DOES_TRUECOLOR) && streq(str, "transparent")) - || ((job->flags & GVRENDER_NO_WHITE_BG) && streq(str, "white")))) { + || ((job->flags & GVRENDER_NO_WHITE_BG) && dfltColor))) { gvrender_set_fillcolor(job, str); gvrender_set_pencolor(job, str); gvrender_box(job, job->clip, TRUE); /* filled */