From: north Date: Mon, 30 Mar 2009 19:32:09 +0000 (+0000) Subject: improve labels for patchwork X-Git-Tag: LAST_LIBGRAPH~32^2~2218 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3cc9dfad28eecd4f94d2661df7822de0b6f7f080;p=graphviz improve labels for patchwork --- diff --git a/lib/common/utils.c b/lib/common/utils.c index 9b80e665f..257895386 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -582,7 +582,7 @@ int test_toggle() return Tflag; } -void common_init_node(node_t * n) +void common_init_node_opt(node_t * n, int shape_init_flag) { char *str; ND_width(n) = @@ -602,9 +602,12 @@ void common_init_node(node_t * n) late_nnstring(n, N_fontname, DEFAULT_FONTNAME), late_nnstring(n, N_fontcolor, DEFAULT_COLOR)); ND_showboxes(n) = late_int(n, N_showboxes, 0, 0); - ND_shape(n)->fns->initfn(n); + if (shape_init_flag) ND_shape(n)->fns->initfn(n); } +void common_init_node(node_t * n) + { return common_init_node_opt(n,TRUE); } + struct fontinfo { double fontsize; char *fontname; diff --git a/lib/patchwork/patchwork.c b/lib/patchwork/patchwork.c index 3395cb287..9fa09abb5 100644 --- a/lib/patchwork/patchwork.c +++ b/lib/patchwork/patchwork.c @@ -157,12 +157,14 @@ static void printer(treenode_t *tree) static void finishNode (node_t* n) { +#ifdef OLD_AND_UNIMPROVED char* str = strdup_and_subst_obj(NODENAME_ESC, (void*)n); ND_shape(n) = bind_shape("box", n); ND_label(n) = make_label((void*)n, str, LT_NONE, late_double(n, N_fontsize, DEFAULT_FONTSIZE, MIN_FONTSIZE), late_nnstring(n, N_fontname, DEFAULT_FONTNAME), late_nnstring(n, N_fontcolor, DEFAULT_COLOR)); +#endif ND_shape(n)->fns->initfn(n); } @@ -204,6 +206,10 @@ static rect_t walker(treenode_t *tree) r = walker(p); EXPANDBB(rr,r); } + rr.LL.x -= 2./72.; + rr.LL.y -= 2./72.; + rr.UR.x += 2./72.; + rr.UR.y += 2./72.; GD_bb(tree->u.subg) = rr; } return rr;