- //#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 \
- // computeRegions/computeRegions_v
- private void computeRegions() {
- numregions = 0;
- for(Box c = firstPackedChild(); c != null; c = c.nextPackedSibling()) {
- regions[numregions++] = c.col;
- regions[numregions++] = min(cols, c.col+c.colspan);
- }
- Vec.sortInts(regions, 0, numregions);
- int j = 0;
- int newnumregions = numregions;
- for(int i=1; i<numregions; i++) {
- if (regions[j] != regions[i]) j++;
- else newnumregions--;
- regions[j] = regions[i];
- }
- numregions = newnumregions;
- if (regions[numregions-1] == cols) numregions--;
- else regions[numregions] = cols;
- }
- //#end