void solve(boolean findMinimum) {
int numkids = 0; for(Box c = firstPackedChild(); c != null; c = c.nextPackedSibling()) numkids++;
//#repeat col/row colspan/rowspan contentwidth/contentheight width/height HSHRINK/VSHRINK numregions/numregions_v \
- // maxwidth/maxheight cols/rows minwidth/minheight regions/regions_v targetColumnSize/targetRowSize sizes/sizes_v
+ // maxwidth/maxheight cols/rows minwidth/minheight regions/regions_v targetColumnSize/targetRowSize sizes/sizes_v \
+ // HSHRINK/VSHRINK
if (numkids == 0) {
if (findMinimum) contentwidth = 0;
else targetColumnSize = 0;
if (regions[r+1] < child.col) continue;
if (regions[r] >= min(child.col+child.colspan,cols)) { minregion = r; break; }
total -= sizes[r];
+ int child_maxwidth = child.test(HSHRINK)?child.contentwidth:child.maxwidth;
if (sizes[r] <= (float)(targetColumnSize*(regions[r+1]-regions[r])))
- if ((child.colspan * targetColumnSize) > (child.maxwidth + (float)0.5))
- sizes[r] = (float)Math.min(sizes[r], (regions[r+1]-regions[r])*(child.maxwidth/child.colspan));
+ if ((child.colspan * targetColumnSize) > (child_maxwidth + (float)0.5))
+ sizes[r] = (float)Math.min(sizes[r], (regions[r+1]-regions[r])*(child_maxwidth/child.colspan));
if ((child.colspan * targetColumnSize) < (child.contentwidth - (float)0.5))
sizes[r] = (float)Math.max(sizes[r], (regions[r+1]-regions[r])*(child.contentwidth/child.colspan));
total += sizes[r];