~ubuntu-branches/ubuntu/lucid/graphviz/lucid-updates

« back to all changes in this revision

Viewing changes to lib/neatogen/neatoinit.c

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2008-06-19 20:23:23 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080619202323-ls23h96ntj9ny94m
Tags: 2.18-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Build depend on liblualib50-dev instead of liblua5.1-0-dev.
  - Drop libttf-dev (libttf-dev is in universe) (LP: #174749).
  - Replace gs-common with ghostscript.
  - Build-depend on python-dev instead of python2.4-dev or python2.5-dev.
  - Mention the correct python version for the python bindings in the
    package description.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: neatoinit.c,v 1.33 2007/06/19 17:59:21 erg Exp $ $Revision: 1.33 $ */
 
1
/* $Id: neatoinit.c,v 1.36 2008/03/03 23:01:51 ellson Exp $ $Revision: 1.36 $ */
2
2
/* vim:set shiftwidth=4 ts=8: */
3
3
 
4
4
/**********************************************************
453
453
 
454
454
    s = agxget(g, G_bb->index);
455
455
    if (sscanf(s, BS, &bb.LL.x, &bb.LL.y, &bb.UR.x, &bb.UR.y) == 4) {
 
456
        if (bb.LL.y > bb.UR.y) {
 
457
        /* If the LL.y coordinate is bigger than the UR.y coordinate,
 
458
         * we assume the input was produced using -y, so we normalize
 
459
         * the bb. 
 
460
         */
 
461
            int tmp = bb.LL.y;
 
462
            bb.LL.y = bb.UR.y;
 
463
            bb.UR.y = tmp;
 
464
        }
456
465
        GD_bb(g) = bb;
457
466
        return 1;
458
467
    } else
994
1003
    node_t *np;
995
1004
 
996
1005
    a = 0.0;
997
 
    da = (2 * PI) / nG;
 
1006
    da = (2 * M_PI) / nG;
998
1007
    for (np = agfstnode(G); np; np = agnxtnode(G, np)) {
999
1008
        ND_pos(np)[0] = nG * Spring_coeff * cos(a);
1000
1009
        ND_pos(np)[1] = nG * Spring_coeff * sin(a);
1298
1307
        MaxIter = 100 * agnnodes(g);
1299
1308
 
1300
1309
    nG = scan_graph_mode(g, layoutMode);
1301
 
    if (nG < 2)
 
1310
    if ((nG < 2) || (MaxIter <=0))
1302
1311
        return;
1303
1312
    if (layoutMode)
1304
1313
        majorization(mg, g, nG, layoutMode, layoutModel, Ndim, MaxIter);