]> granicus.if.org Git - graphviz/commitdiff
emeit_colors() - fix cluster bgcolor, node pencolor, fillcolor gradient endpoint...
authorJohn Ellson <ellson@research.att.com>
Sun, 22 Jan 2012 20:35:22 +0000 (15:35 -0500)
committerJohn Ellson <ellson@research.att.com>
Sun, 22 Jan 2012 20:35:22 +0000 (15:35 -0500)
lib/common/emit.c

index 572b29d2d708f9b28914fc5f8ba101eb42d9c0b9..a8812041a0c10faaba2d09bf29bfbd89e3a2e919 100644 (file)
@@ -2862,6 +2862,8 @@ static void emit_cluster_colors(GVJ_t * job, graph_t * g)
        emit_cluster_colors(job, sg);
        if (((str = agget(sg, "color")) != 0) && str[0])
            gvrender_set_pencolor(job, str);
+       if (((str = agget(sg, "bgcolor")) != 0) && str[0])
+           gvrender_set_pencolor(job, str);
        if (((str = agget(sg, "fillcolor")) != 0) && str[0])
            gvrender_set_fillcolor(job, str);
        if (((str = agget(sg, "fontcolor")) != 0) && str[0])
@@ -2885,8 +2887,22 @@ static void emit_colors(GVJ_t * job, graph_t * g)
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
        if (((str = agget(n, "color")) != 0) && str[0])
            gvrender_set_pencolor(job, str);
-       if (((str = agget(n, "fillcolor")) != 0) && str[0])
+       if (((str = agget(n, "pencolor")) != 0) && str[0])
            gvrender_set_fillcolor(job, str);
+       if (((str = agget(n, "fillcolor")) != 0) && str[0]) {
+           if (strchr(str, ':')) {
+               colors = strdup(str);
+               for (str = strtok(colors, ":"); str;
+                   str = strtok(0, ":")) {
+                   if (str[0])
+                       gvrender_set_pencolor(job, str);
+               }
+               free(colors);
+           }
+           else {
+               gvrender_set_pencolor(job, str);
+           }
+       }
        if (((str = agget(n, "fontcolor")) != 0) && str[0])
            gvrender_set_pencolor(job, str);
        for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
@@ -2899,8 +2915,10 @@ static void emit_colors(GVJ_t * job, graph_t * g)
                            gvrender_set_pencolor(job, str);
                    }
                    free(colors);
-               } else
+               }
+               else {
                    gvrender_set_pencolor(job, str);
+               }
            }
            if (((str = agget(e, "fontcolor")) != 0) && str[0])
                gvrender_set_pencolor(job, str);