]> granicus.if.org Git - graphviz/commitdiff
Fix the sep and esep attributes to allow additive margins in addition
authorerg <devnull@localhost>
Tue, 8 Apr 2008 21:34:51 +0000 (21:34 +0000)
committererg <devnull@localhost>
Tue, 8 Apr 2008 21:34:51 +0000 (21:34 +0000)
to scaled margins.

lib/neatogen/neatoinit.c
lib/neatogen/neatoprocs.h

index 93b5685e67d1869084d3761090119e240c8a1711..42fb7af7286750ddd99a1019b5ceda5e517162f5 100644 (file)
@@ -1136,6 +1136,7 @@ majorization(graph_t *mg, graph_t * g, int nv, int mode, int model, int dim, int
     int i;
     node_t *v;
     vtx_data *gp;
+    expand_t margin;
 
     int init;
 
@@ -1207,13 +1208,14 @@ majorization(graph_t *mg, graph_t * g, int nv, int mode, int model, int dim, int
                     fprintf(stderr,"Using Mosek for constraint optimization...\n");
             }
 #endif /* MOSEK */
-            if ((str = agget(g, "sep")) && 
-                (i = sscanf(str, "%lf,%lf", &opt.gap.x, &opt.gap.y))) {
-                   if (i == 1) opt.gap.y = opt.gap.x;
-                    if(Verbose)
-                        fprintf(stderr,"gap=%f,%f\n",opt.gap.x,opt.gap.y);
-            }
-            else opt.gap.x = opt.gap.y = 0;
+           margin = sepFactor (g);
+           if (margin.doAdd) {
+               opt.gap.x = PS2INCH(margin.x);
+               opt.gap.y = PS2INCH(margin.y);
+           }
+            else opt.gap.x = opt.gap.y = PS2INCH(DFLT_MARGIN);
+           if(Verbose)
+               fprintf(stderr,"gap=%f,%f\n",opt.gap.x,opt.gap.y);
             for (i=0, v = agfstnode(g); v; v = agnxtnode(g, v),i++) {
                 nsize[i].x = ND_width(v);
                 nsize[i].y = ND_height(v);
index a6dbceb43df9439869728fc7af0dca556c3135e8..e815645b3d242857f158a7dcdd83e7aac865de26 100644 (file)
@@ -20,6 +20,7 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
+#include <adjust.h>
 
     extern int allow_edits(int);
     extern void avoid_cycling(graph_t *, Agnode_t *, double *);
@@ -41,7 +42,7 @@ extern "C" {
     extern int init_port(Agnode_t *, Agedge_t *, char *, boolean);
     extern void jitter3d(Agnode_t *, int);
     extern void jitter_d(Agnode_t *, int, int);
-    extern Ppoly_t *makeObstacle(node_t * n, double SEP);
+    extern Ppoly_t *makeObstacle(node_t * n, expand_t* );
     extern void makeSelfArcs(path * P, edge_t * e, int stepx);
     extern void makeSpline(edge_t *, Ppoly_t **, int, boolean);
     extern void make_spring(graph_t *, Agnode_t *, Agnode_t *, double);
@@ -77,7 +78,7 @@ extern "C" {
     extern void spline_edges0(Agraph_t *);
     extern int spline_edges1(graph_t * g, int);
     extern int splineEdges(graph_t *,
-                          int (*edgefn) (graph_t *, double, int), int);
+                          int (*edgefn) (graph_t *, expand_t*, int), int);
     extern void neato_set_aspect(graph_t * g);
     extern void toggle(int);
     extern int user_pos(Agsym_t *, Agsym_t *, Agnode_t *, int);