From: erg Date: Mon, 12 Nov 2007 18:38:01 +0000 (+0000) Subject: Fix bug 1228. Note that this involves removing the fix for bug 789, X-Git-Tag: LAST_LIBGRAPH~32^2~5036 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ecf3f3c820f05924bdedb480859fc13058e1bf6;p=graphviz Fix bug 1228. Note that this involves removing the fix for bug 789, but refixing it in the context of neato -n. --- diff --git a/lib/common/output.c b/lib/common/output.c index e6c100494..fa9604abf 100644 --- a/lib/common/output.c +++ b/lib/common/output.c @@ -153,8 +153,8 @@ static void rec_attach_bb(graph_t * g) char buf[BUFSIZ]; point pt; - sprintf(buf, "%d,%d,%d,%d", GD_bb(g).LL.x, GD_bb(g).LL.y, - GD_bb(g).UR.x, GD_bb(g).UR.y); + sprintf(buf, "%d,%d,%d,%d", GD_bb(g).LL.x, YDIR(GD_bb(g).LL.y), + GD_bb(g).UR.x, YDIR(GD_bb(g).UR.y)); agset(g, "bb", buf); if (GD_label(g) && GD_label(g)->text[0]) { pt = GD_label(g)->p; diff --git a/lib/neatogen/neatoinit.c b/lib/neatogen/neatoinit.c index 88c516330..3ddf55c0d 100644 --- a/lib/neatogen/neatoinit.c +++ b/lib/neatogen/neatoinit.c @@ -453,6 +453,15 @@ static int chkBB(Agraph_t * g, attrsym_t * G_bb) s = agxget(g, G_bb->index); if (sscanf(s, BS, &bb.LL.x, &bb.LL.y, &bb.UR.x, &bb.UR.y) == 4) { + if (bb.LL.y > bb.UR.y) { + /* If the LL.y coordinate is bigger than the UR.y coordinate, + * we assume the input was produced using -y, so we normalize + * the bb. + */ + int tmp = bb.LL.y; + bb.LL.y = bb.UR.y; + bb.UR.y = tmp; + } GD_bb(g) = bb; return 1; } else