]> granicus.if.org Git - graphviz/commitdiff
improve labels for patchwork
authornorth <devnull@localhost>
Mon, 30 Mar 2009 19:32:09 +0000 (19:32 +0000)
committernorth <devnull@localhost>
Mon, 30 Mar 2009 19:32:09 +0000 (19:32 +0000)
lib/common/utils.c
lib/patchwork/patchwork.c

index 9b80e665fe212e0b65fce53152a463f4da2f09e6..257895386da174f739ac63224cfeedc0ed1e3f9f 100644 (file)
@@ -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;
index 3395cb2874789197bb342fe378e8242722c2a4dd..9fa09abb5a1f6e69bdec19914da2ff4fcbafa9e1 100644 (file)
@@ -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;