private static LENGTH[] colMaxWidth = new LENGTH[65535];
private static LENGTH[] rowHeight = new LENGTH[65535];
private static LENGTH[] rowMaxHeight = new LENGTH[65535];
- static { for(int i=0; i<rowMaxHeight.length; i++) { rowMaxHeight[i] = 0; colMaxWidth[i] = 0; } }
+ static { for(int i=0; i<rowMaxHeight.length; i++) { rowMaxHeight[i] = MAX_LENGTH; colMaxWidth[i] = MAX_LENGTH; } }
Box nextPackedSibling() { Box b = nextSibling(); return b == null || (b.test(PACKED | VISIBLE)) ? b : b.nextPackedSibling(); }
Box firstPackedChild() { Box b = getChild(0); return b == null || (b.test(PACKED | VISIBLE)) ? b : b.nextPackedSibling(); }
x_slack += colWidth[i];
colWidth[i] = max(colWidth[i], child.contentwidth / child.colspan);
x_slack -= colWidth[i];
- colMaxWidth[i] = max(colMaxWidth[i], (child.test(HSHRINK) ? child.contentwidth : child.maxwidth) / child.colspan);
+ colMaxWidth[i] = min(colMaxWidth[i], child.test(HSHRINK) ? child.contentwidth : child.maxwidth) / child.colspan;
}
// PHASE 2: hand out slack
}
// cleanup
- for(int i=0; i<cols; i++) { colWidth[i] = 0; colMaxWidth[i] = 0; }
- for(int i=0; i<rows; i++) { rowHeight[i] = 0; rowMaxHeight[i] = 0; }
+ for(int i=0; i<cols; i++) { colWidth[i] = 0; colMaxWidth[i] = MAX_LENGTH; }
+ for(int i=0; i<rows; i++) { rowHeight[i] = 0; rowMaxHeight[i] = MAX_LENGTH; }
for(Box child = getChild(0); child != null; child = child.nextSibling())
if (test(VISIBLE))