From: erg Date: Mon, 6 Apr 2009 16:41:31 +0000 (+0000) Subject: Handle invisible nodes in emit_node. Otherwise, style=invis has to X-Git-Tag: LAST_LIBGRAPH~32^2~2189 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=637411b7e02212f1f4d0f3a8e011460829d4e626;p=graphviz Handle invisible nodes in emit_node. Otherwise, style=invis has to go into the HTML label code, plus gvrender_usershape so that images in invisible nodes aren't drawn. The only changes in semantics is that we no longer emit map data for invisible nodes. If someone can make a case that invisible nodes should be sensitive, we can go the more complex route. --- diff --git a/lib/common/emit.c b/lib/common/emit.c index 72b3c31f9..6e7fdb73c 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -1213,6 +1213,10 @@ static void emit_node(GVJ_t * job, node_t * n) { GVC_t *gvc = job->gvc; char *s; + char *style; + char **styles = 0; + char **sp; + char *p; if (ND_shape(n) /* node has a shape */ && node_in_layer(job, agraphof(n), n) /* and is in layer */ @@ -1226,6 +1230,15 @@ static void emit_node(GVJ_t * job, node_t * n) if (s[0]) gvrender_comment(job, s); + style = late_string(n, N_style, ""); + if (style[0]) { + styles = parse_style(style); + sp = styles; + while ((p = *sp++)) { + if (streq(p, "invis")) return; + } + } + emit_begin_node(job, n); ND_shape(n)->fns->codefn(job, n); emit_end_node(job);