2003/11/17 06:19:20
[org.ibex.core.git] / src / org / xwt / BoxTree.java
index 7d2d3d5..86f1566 100644 (file)
@@ -346,7 +346,7 @@ public final class BoxTree extends Box {
     /** Returns our index in our parent */
     public int getIndexInParent() {
         // FIXME: store numleft and numright in the tree
-        if (peerTree_parent == null) return left == null ? 0 : left.numPeerChildren();
+        if (peerTree_parent == null) return left == null ? 0 : left.numPeerChildren() + 1;
         else if (peerTree_parent.left == this) return peerTree_parent.getIndexInParent() - 1;
         else if (peerTree_parent.right == this) return peerTree_parent.getIndexInParent() + 1;
         else throw new Error("we're not a child of our parent!");