- //#repeat col/row colspan/rowspan contentwidth/contentheight width/height HSHRINK/VSHRINK \
- // maxwidth/maxheight cols/rows minwidth/minheight lp_h/lp_v lp_h/lp_v
- if (cols > 1) {
- int nc = numkids * 2 + cols * 3 + 1 + 2;
+ int numregions = 0, numregions_v = 0;
+ //#repeat col/row colspan/rowspan contentwidth/contentheight width/height HSHRINK/VSHRINK numregions/numregions_v \
+ // maxwidth/maxheight cols/rows minwidth/minheight lp_h/lp lp_h/lp easy_width/easy_height regions/regions_v
+ if (cols > 1) do {
+ /* boolean easy_width = contentwidth >= width; */
+ for(Box c = firstPackedChild(); c != null; c = c.nextPackedSibling()) {
+ breakpoints[c.col] = true;
+ breakpoints[min(cols, c.col+c.colspan)] = true;
+ }
+ numregions = 0;
+ // FIXME: depends on cols
+ for(int i=0; i<cols; i++) if (breakpoints[i]) regions[numregions++] = i;
+ regions[numregions] = cols;
+ for(int i=0; i<numkids; i++) breakpoints[i] = false;
+ /*
+ for(Box c = firstPackedChild(); easy_width && c != null; c = c.nextPackedSibling()) {
+ if (c.contentwidth == c.maxwidth) continue;
+ if (c.maxwidth == Integer.MAX_VALUE) continue;
+ easy_width = false;
+ }
+ if (easy_width) for(int i=0; i<cols; i++) {
+ easy_width = false;
+ boolean good = true;
+ for(Box c = firstPackedChild(); good && c != null; c = c.nextPackedSibling())
+ if (c.col <= i && c.col + c.colspan > i && c.maxwidth < Integer.MAX_VALUE)
+ good = false;
+ if (good) { easy_width = true; break; }
+ }
+ if (easy_width) break;
+ */
+ int nc = numregions * 2 + numkids + 1;