]> granicus.if.org Git - graphviz/commitdiff
If user specifies explicit white background, draw it.
authorerg <devnull@localhost>
Thu, 4 Feb 2010 17:46:09 +0000 (17:46 +0000)
committererg <devnull@localhost>
Thu, 4 Feb 2010 17:46:09 +0000 (17:46 +0000)
lib/common/emit.c

index 91492774762242fcb03daab43bb912b393f94e6f..6b631fdbe4217a6e2acd6e9fe992cbeac9d19689 100644 (file)
@@ -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 */