From: Emden Gansner Date: Thu, 3 Nov 2016 20:57:52 +0000 (-0400) Subject: Revert version ffb894f27874ebd510a8555c28083d6e01eb80b6. The fix broke other input... X-Git-Tag: untagged-348619a7ff77176f7492 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ef4d51121ba26e3e30ef7609249045952a481fa;p=graphviz Revert version ffb894f27874ebd510a8555c28083d6e01eb80b6. The fix broke other input (rtest/graphs/url.gv). Plus it didn't fix the problem of repeated ids. We need to rethink how to handle anchors. --- diff --git a/lib/common/emit.c b/lib/common/emit.c index 09bcd34b5..e8ad87dfc 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -1984,14 +1984,8 @@ static void emit_node(GVJ_t * job, node_t * n) emit_begin_node(job, n); ND_shape(n)->fns->codefn(job, n); - if (ND_xlabel(n) && ND_xlabel(n)->set) { - obj_state_t *obj = push_obj_state(job); - obj->type = NODE_OBJTYPE; - obj->u.n = n; - obj->emit_state = EMIT_NDRAW; + if (ND_xlabel(n) && ND_xlabel(n)->set) emit_label(job, EMIT_NLABEL, ND_xlabel(n)); - pop_obj_state(job); - } emit_end_node(job); } } diff --git a/lib/common/htmltable.c b/lib/common/htmltable.c index d81e04bc8..8962f8134 100644 --- a/lib/common/htmltable.c +++ b/lib/common/htmltable.c @@ -545,7 +545,7 @@ static void emit_html_tbl(GVJ_t * job, htmltbl_t * tbl, htmlenv_t * env) pts.UR.y += pos.y; if (doAnchor && !(job->flags & EMIT_CLUSTERS_LAST)) - anchor = initAnchor(job, env, &tbl->data, pts, &saved, 0); + anchor = initAnchor(job, env, &tbl->data, pts, &saved, 1); else anchor = 0; @@ -582,26 +582,13 @@ static void emit_html_tbl(GVJ_t * job, htmltbl_t * tbl, htmlenv_t * env) emit_html_rules(job, cp, env, tbl->data.pencolor, *cells); } - if (tbl->data.border) { - if (anchor) { - agxbuf xb; - obj_state_t *obj = job->obj; - unsigned char buf[SMALLBUF]; - agxbinit(&xb, SMALLBUF, buf); - agxbput(&xb, obj->id); - agxbputc(&xb, 'b'); - char* id = agxbuse(&xb); - gvrender_begin_anchor(job, - obj->url, obj->tooltip, obj->target, - id); - agxbfree(&xb); - } + if (tbl->data.border) doBorder(job, &tbl->data, pts); - } + } if (anchor) - endAnchor(job, &saved, 0); + endAnchor(job, &saved, 1); if (doAnchor && (job->flags & EMIT_CLUSTERS_LAST)) { if (initAnchor(job, env, &tbl->data, pts, &saved, 0)) @@ -658,7 +645,7 @@ static void emit_html_cell(GVJ_t * job, htmlcell_t * cp, htmlenv_t * env) pts.UR.y += pos.y; if (doAnchor && !(job->flags & EMIT_CLUSTERS_LAST)) - inAnchor = initAnchor(job, env, &cp->data, pts, &saved, 0); + inAnchor = initAnchor(job, env, &cp->data, pts, &saved, 1); else inAnchor = 0; @@ -688,7 +675,7 @@ static void emit_html_cell(GVJ_t * job, htmlcell_t * cp, htmlenv_t * env) } if (inAnchor) - endAnchor(job, &saved, 0); + endAnchor(job, &saved, 1); if (doAnchor && (job->flags & EMIT_CLUSTERS_LAST)) { if (initAnchor(job, env, &cp->data, pts, &saved, 0))