X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2FBox.java;h=180a65221be3dfa743d970c3c95c566518dcf70a;hb=61a7cbf016d3bf7a231170e54d9b75dc652cb4fd;hp=e8c3d35da608ca66af48de77f9f6fbfaad977d8f;hpb=66204595a29d1ac52c97211a6567d1f0b76234a9;p=org.ibex.core.git diff --git a/src/org/ibex/Box.java b/src/org/ibex/Box.java index e8c3d35..180a652 100644 --- a/src/org/ibex/Box.java +++ b/src/org/ibex/Box.java @@ -215,12 +215,10 @@ public final class Box extends JSScope implements Scheduler.Task { // static stuff so we don't have to keep reallocating private static int[] numRowsInCol = new int[65535]; private static LENGTH[] colWidth = new LENGTH[65535]; - private static LENGTH[] colMinWidth = new LENGTH[65535]; private static LENGTH[] colMaxWidth = new LENGTH[65535]; private static LENGTH[] rowHeight = new LENGTH[65535]; - private static LENGTH[] rowMinHeight = new LENGTH[65535]; private static LENGTH[] rowMaxHeight = new LENGTH[65535]; - static { for(int i=0; i 0 && cols > 0 && startslack != x_slack;) { - if (eligible == 0) break; - int increment = x_slack / eligible; - eligible = 0; + int increment = max(1, x_slack / cols); startslack = x_slack; for(short col=0; col < cols; col++) { // FIXME: double check this int diff = min(min(colMaxWidth[col], colWidth[col] + increment) - colWidth[col], x_slack); - if (colWidth[col] + diff < colMinWidth[col]) diff = colMinWidth[col] - colWidth[col]; - if (diff == 0) continue; - eligible++; x_slack -= diff; colWidth[col] += diff; } @@ -360,8 +348,8 @@ public final class Box extends JSScope implements Scheduler.Task { } // cleanup - for(int i=0; i