// Reflow ////////////////////////////////////////////////////////////////////////////////////////
+ /** only for use on the root box */
void reflow() { reflow(width, height); }
void reflow(int new_width, int new_height) {
repack();
if (Surface.abort) return;
+ //#repeat width/height new_width/new_height HSHRINK_FLAG/VSHRINK_FLAG contentwidth/contentheight minwidth/minheight maxwidth/maxheight
+ new_width = bound(max(contentwidth, minwidth),
+ new_width,
+ ((flags & HSHRINK_FLAG) != 0) ? max(contentwidth, minwidth) : maxwidth);
+ //#end
resize(x, y, new_width, new_height);
}
// --- Phase 2 ----------------------------------------------------------------------
// compute the min/max sizes of the columns and rows and set our contentwidth
+ //#repeat x/y y/x width/height col/row cols/rows colspan/rowspan colWidth/rowHeight maxwidth/maxheight minwidth/minheight contentwidth/contentheight colMaxWidth/rowMaxHeight numCols/numRows
if (numChildren() != 0) {
- //#repeat x/y y/x width/height col/row cols/rows colspan/rowspan colWidth/rowHeight maxwidth/maxheight minwidth/minheight contentwidth/contentheight colMaxWidth/rowMaxHeight numCols/numRows
int numCols = cols;
if (numCols == 0)
for(Box child = getChild(0); child != null; child = child.nextSibling())
if (!(((child.flags & NOTPACKED_FLAG) != 0) || ((child.flags & INVISIBLE_FLAG) != 0)))
colWidth[child.col] = max(colWidth[child.col], child.contentwidth / child.colspan);
for(int col=0; col<numCols; col++) contentwidth += colWidth[col];
- contentwidth = max(textwidth, contentwidth);
- contentwidth = bound(minwidth, contentwidth, maxwidth);
- //#end
}
+ contentwidth = max(textwidth, contentwidth);
+ contentwidth = bound(minwidth, contentwidth, maxwidth);
+ //#end
offset_x = 0;
if ((flags & NOTPACKED_FLAG) == 0) {