fixed bug 521
authoradam <adam@megacz.com>
Sun, 11 Apr 2004 20:03:08 +0000 (20:03 +0000)
committeradam <adam@megacz.com>
Sun, 11 Apr 2004 20:03:08 +0000 (20:03 +0000)
darcs-hash:20040411200308-5007d-b13cee3f695b549c10a19363ad37350261b89b8f.gz

src/org/ibex/Box.java

index 560e7f5..6811f21 100644 (file)
@@ -284,7 +284,8 @@ public final class Box extends JSScope implements Scheduler.Task {
     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;
@@ -336,9 +337,10 @@ public final class Box extends JSScope implements Scheduler.Task {
                         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];