]> granicus.if.org Git - graphviz/commitdiff
Fix bug 1228. Note that this involves removing the fix for bug 789,
authorerg <devnull@localhost>
Mon, 12 Nov 2007 18:38:01 +0000 (18:38 +0000)
committererg <devnull@localhost>
Mon, 12 Nov 2007 18:38:01 +0000 (18:38 +0000)
but refixing it in the context of neato -n.

lib/common/output.c
lib/neatogen/neatoinit.c

index e6c100494cfb347e5c48e7c8b6e4ea5b91d8ae74..fa9604abfba04855c0f5243610a4044c265b954b 100644 (file)
@@ -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;
index 88c5163301f98c6edd30bfa10c020be297b50175..3ddf55c0df309c73fca73b30cac485e58104e3c9 100644 (file)
@@ -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