]> granicus.if.org Git - graphviz/commitdiff
Fix bugs 1474 and 1457.
authorerg <devnull@localhost>
Fri, 7 Nov 2008 22:44:20 +0000 (22:44 +0000)
committererg <devnull@localhost>
Fri, 7 Nov 2008 22:44:20 +0000 (22:44 +0000)
plugin/core/gvrender_core_dot.c

index c4d0cd1f865e90776656e15c361289f735cb15a1..1b2b16aca546c7a31c2a1aa0085582493f77fa4e 100644 (file)
@@ -110,14 +110,23 @@ static void xdot_points(GVJ_t *job, char c, pointf * A, int n)
         output_point(xbufs[emit_state], A[i]);
 }
 
+static char*
+color2str (unsigned char rgba[4])
+{
+    static char buf [10];
+
+    sprintf (buf, "#%02x%02x%02x%02x", rgba[0], rgba[1],  rgba[2], rgba[3]);
+    return buf;
+}
+
 static void xdot_pencolor (GVJ_t *job)
 {
-    xdot_str (job, "c ", job->obj->pencolor.u.string);
+    xdot_str (job, "c ", color2str (job->obj->pencolor.u.rgba));
 }
 
 static void xdot_fillcolor (GVJ_t *job)
 {
-    xdot_str (job, "C ", job->obj->fillcolor.u.string);
+    xdot_str (job, "C ", color2str (job->obj->fillcolor.u.rgba));
 }
 
 static void xdot_style (GVJ_t *job)
@@ -594,7 +603,7 @@ gvrender_features_t render_features_xdot = {
     0.,                         /* default pad - graph units */
     NULL,                      /* knowncolors */
     0,                         /* sizeof knowncolors */
-    COLOR_STRING,              /* color_type */
+    RGBA_BYTE,         /* color_type */
 };
 
 gvdevice_features_t device_features_canon = {