From f019d95fdc05b45e4fa144055eb622aed025dcd0 Mon Sep 17 00:00:00 2001 From: erg Date: Wed, 9 Apr 2008 15:29:42 +0000 Subject: [PATCH] Multiply margin by 2, since vpsc needs the total space between nodes, not the margin added around them. --- lib/neatogen/adjust.c | 7 ++++--- lib/neatogen/neatoinit.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/neatogen/adjust.c b/lib/neatogen/adjust.c index 4955d625a..7f943bc51 100644 --- a/lib/neatogen/adjust.c +++ b/lib/neatogen/adjust.c @@ -688,12 +688,13 @@ vpscAdjust(graph_t* G) opt.noverlap = 2; opt.clusters = NEW(cluster_data); margin = sepFactor (G); + /* Multiply by 2 since opt.gap is the gap size, not the margin */ if (margin.doAdd) { - opt.gap.x = PS2INCH(margin.x); - opt.gap.y = PS2INCH(margin.y); + opt.gap.x = 2.0*PS2INCH(margin.x); + opt.gap.y = 2.0*PS2INCH(margin.y); } else { - opt.gap.x = opt.gap.y = PS2INCH(DFLT_MARGIN); + opt.gap.x = opt.gap.y = 2.0*PS2INCH(DFLT_MARGIN); } opt.nsize = nsize; diff --git a/lib/neatogen/neatoinit.c b/lib/neatogen/neatoinit.c index 42fb7af72..14121d9a0 100644 --- a/lib/neatogen/neatoinit.c +++ b/lib/neatogen/neatoinit.c @@ -1209,11 +1209,12 @@ majorization(graph_t *mg, graph_t * g, int nv, int mode, int model, int dim, int } #endif /* MOSEK */ margin = sepFactor (g); + /* Multiply by 2 since opt.gap is the gap size, not the margin */ if (margin.doAdd) { - opt.gap.x = PS2INCH(margin.x); - opt.gap.y = PS2INCH(margin.y); + opt.gap.x = 2.0*PS2INCH(margin.x); + opt.gap.y = 2.0*PS2INCH(margin.y); } - else opt.gap.x = opt.gap.y = PS2INCH(DFLT_MARGIN); + else opt.gap.x = opt.gap.y = 2.0*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++) { -- 2.40.0