]> granicus.if.org Git - graphviz/commitdiff
Allow fillcolor to be used for arrowheads
authorEmden Gansner <erg@research.att.com>
Wed, 15 Feb 2012 18:10:43 +0000 (13:10 -0500)
committerEmden Gansner <erg@research.att.com>
Wed, 15 Feb 2012 18:10:43 +0000 (13:10 -0500)
doc/info/attrs.html
doc/infosrc/attrs
lib/common/emit.c
lib/common/globals.h
lib/common/input.c

index b5845faeeef796f4b00cdfd48f34c443a2fb10ea..92adf2eceb31462edaa444558711236f34e8d577 100644 (file)
@@ -166,7 +166,7 @@ This field indicates which graph component uses the attribute.
 <BR><A HREF=#k:addPoint>addPoint</A>
 </TD><TD ALIGN="CENTER">+3</TD><TD></TD><TD>not dot</TD> </TR>
  <TR><TD><A NAME=a:fillcolor HREF=#d:fillcolor>fillcolor</A>
-</TD><TD>NC</TD><TD><A HREF=#k:color>color</A>
+</TD><TD>NEC</TD><TD><A HREF=#k:color>color</A>
 <BR><A HREF=#k:colorList>colorList</A>
 </TD><TD ALIGN="CENTER">lightgrey(nodes)<BR>black(clusters)</TD><TD></TD><TD></TD> </TR>
  <TR><TD><A NAME=a:fixedsize HREF=#d:fixedsize>fixedsize</A>
@@ -773,7 +773,7 @@ This field indicates which graph component uses the attribute.
 
 <DT><A NAME=d:fillcolor HREF=#a:fillcolor><STRONG>fillcolor</STRONG></A>
 <DD>  Color used to fill the background of a node or cluster
-  assuming <A HREF=#d:style>style</A>=filled.
+  assuming <A HREF=#d:style>style</A>=filled, or a filled arrowhead.
   If <B>fillcolor</B> is not defined, <A HREF=#d:color>color</A> is
   used. (For clusters, if <B>color</B> is not defined,
   <A HREF=#d:bgcolor>bgcolor</A> is used.) If this is not defined,
index 9a60254b9d57e6b7555c054246444fd0677fa9e6..e36461dd598f4d5c9184e90953b5f4492806fd10 100644 (file)
@@ -285,9 +285,9 @@ Terminating condition. If the length squared of all energy gradients are
 Margin used around polygons for purposes of spline edge routing.
 The interpretation is the same as given for <A HREF=#d:sep>sep</A>.
 This should normally be strictly less than <A HREF=#d:sep>sep</A>.
-:fillcolor:NC:color/colorList:lightgrey(nodes)/black(clusters);
+:fillcolor:NEC:color/colorList:lightgrey(nodes)/black(clusters);
 Color used to fill the background of a node or cluster
-assuming <A HREF=#d:style>style</A>=filled.
+assuming <A HREF=#d:style>style</A>=filled, or a filled arrowhead.
 If <B>fillcolor</B> is not defined, <A HREF=#d:color>color</A> is
 used. (For clusters, if <B>color</B> is not defined,
 <A HREF=#d:bgcolor>bgcolor</A> is used.) If this is not defined,
index 7db2ef5c22e28a50447b539f88417eba15bddf9a..8fc01ee519c892a6b92a662630d24b84b023aa8a 100644 (file)
@@ -1960,6 +1960,8 @@ static void emit_edge_graphics(GVJ_t * job, edge_t * e, char** styles)
                        default_pencolor(pencolor, DEFAULT_VISITEDPENCOLOR));
            fillcolor = late_nnstring(e, E_visitedfillcolor, DEFAULT_VISITEDFILLCOLOR);
        }
+       else
+           fillcolor = late_nnstring(e, E_fillcolor, color);
        if (pencolor != color)
            gvrender_set_pencolor(job, pencolor);
        if (fillcolor != color)
@@ -1975,6 +1977,9 @@ static void emit_edge_graphics(GVJ_t * job, edge_t * e, char** styles)
            stp = taper (&bz, taperfun (e), penwidth, 0, 0);
            gvrender_polygon(job, stp->vertices, stp->nvertices, TRUE);
            free_stroke (stp);
+           gvrender_set_pencolor(job, color);
+           if (fillcolor != color)
+               gvrender_set_fillcolor(job, fillcolor);
            if (bz.sflag) {
                arrow_gen(job, EMIT_TDRAW, bz.sp, bz.list[0], arrowsize, penwidth, bz.sflag);
            }
@@ -2082,10 +2087,13 @@ static void emit_edge_graphics(GVJ_t * job, edge_t * e, char** styles)
            if (! (ED_gui_state(e) & (GUI_STATE_ACTIVE | GUI_STATE_SELECTED))) {
                if (color[0]) {
                    gvrender_set_pencolor(job, color);
-                   gvrender_set_fillcolor(job, color);
+                   gvrender_set_fillcolor(job, fillcolor);
                } else {
                    gvrender_set_pencolor(job, DEFAULT_COLOR);
-                   gvrender_set_fillcolor(job, DEFAULT_COLOR);
+                   if (fillcolor[0])
+                       gvrender_set_fillcolor(job, fillcolor);
+                   else
+                       gvrender_set_fillcolor(job, DEFAULT_COLOR);
                }
            }
            for (i = 0; i < ED_spl(e)->size; i++) {
index dddfada75d78de2e26c955f4627ce59ba0c22b7b..cd6c7b89e3fed138455b3b163c04e43c959cf5aa 100644 (file)
@@ -113,7 +113,7 @@ extern "C" {
        *N_group, *N_comment, *N_vertices, *N_z,
        *N_penwidth, *N_gradientangle;
     EXTERN attrsym_t
-       *E_weight, *E_minlen, *E_color,
+       *E_weight, *E_minlen, *E_color, *E_fillcolor,
        *E_activepencolor, *E_activefillcolor,
        *E_selectedpencolor, *E_selectedfillcolor,
        *E_visitedpencolor, *E_visitedfillcolor,
index 35eb27caf2b47483b2cf835cfc7f58cc0ae4dd32..56546caaa936e7df59bdd6850c3ef150f0f219a7 100644 (file)
@@ -832,6 +832,7 @@ void graph_init(graph_t * g, boolean use_rankdir)
     /* initialize edges */
     E_weight = agfindedgeattr(g, "weight");
     E_color = agfindedgeattr(g, "color");
+    E_fillcolor = agfindedgeattr(g, "fillcolor");
     E_fontsize = agfindedgeattr(g, "fontsize");
     E_fontname = agfindedgeattr(g, "fontname");
     E_fontcolor = agfindedgeattr(g, "fontcolor");