From: megacz Date: Fri, 30 Jan 2004 06:50:15 +0000 (+0000) Subject: 2002/08/21 00:11:42 X-Git-Tag: RC3~1553 X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=commitdiff_plain;h=f132e005914d0fd75cca809cc7dce892950c81e8 2002/08/21 00:11:42 darcs-hash:20040130065015-2ba56-147077ded627ca0fba829518349c1926b33e5c4c.gz --- diff --git a/CHANGES b/CHANGES index 36b6ba7..4c85a7f 100644 --- a/CHANGES +++ b/CHANGES @@ -384,4 +384,6 @@ 17-Aug megacz Template.java: fixed a bug that was keeping retheme() from working +20-Aug megacz Box.java: fixed rounding error + diff --git a/src/org/xwt/Box.java b/src/org/xwt/Box.java index 1a1f672..c0891f5 100644 --- a/src/org/xwt/Box.java +++ b/src/org/xwt/Box.java @@ -830,10 +830,10 @@ public final class Box extends JSObject { // arbitrarily distribute out any leftovers resulting from rounding errors int last = 0; - while(goal > total && total != last) { + while(goal != total && total != last) { last = total; for(Box bt = getChild(0); bt != null; bt = bt.nextSibling()) { - int newsize = bound(bt.cmin(o), bt.size(o) + 1, bt.dmax(o)); + int newsize = bound(bt.cmin(o), bt.size(o) + (goal > total ? 1 : -1), bt.dmax(o)); total += newsize - bt.size(o); bt.set(size, o, newsize); }