X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2FBox.java;h=8c0d3efaec52cbe660f4f05379e6b4a2b2b9a9da;hp=3892ce9f6f4945d83cbec4ae143b1ae97611485d;hb=4052bf6501ced1a941a66108e87262da033f33af;hpb=678a052b8a88a204220b57071360775ffa7b8c2b diff --git a/src/org/ibex/Box.java b/src/org/ibex/Box.java index 3892ce9..8c0d3ef 100644 --- a/src/org/ibex/Box.java +++ b/src/org/ibex/Box.java @@ -240,14 +240,21 @@ public final class Box extends JSScope implements Scheduler.Task { for(int i=0; i i)) + rowcontentwidth += child.contentwidth; + contentwidth = max(contentwidth, rowcontentwidth); + } contentwidth = bound(minwidth, max(font == null || text == null ? 0 : font.textwidth(text), contentwidth), maxwidth); //#end } @@ -288,49 +295,49 @@ public final class Box extends JSScope implements Scheduler.Task { private static float[] coeff = null; void place_children() { + LinearProgramming.Problem lpr_h; + LinearProgramming.Problem lpr_v; int numkids = 0; for(Box c = firstPackedChild(); c != null; c = c.nextPackedSibling()) numkids++; - int nc = numkids * 2 + cols * 3 + 1 + 2; - if (coeff == null || nc+1>coeff.length) coeff = new float[nc+1]; - LinearProgramming.Simplex lp_h = new LinearProgramming.Simplex(); - LinearProgramming.Problem lpr_h = new LinearProgramming.Problem(nc, nc); - LinearProgramming.Simplex lp_v = new LinearProgramming.Simplex(); - LinearProgramming.Problem lpr_v = new LinearProgramming.Problem(nc, nc); - - //#repeat col/row colspan/rowspan contentwidth/contentheight width/height colMaxWidth/rowMaxHeight colWidth/rowHeight \ - // HSHRINK/VSHRINK maxwidth/maxheight cols/rows minwidth/minheight colWidth/rowHeight x_slack/y_slack lp_h/lp_v lpr_h/lpr_v + //#repeat col/row colspan/rowspan contentwidth/contentheight width/height \ + // maxwidth/maxheight cols/rows minwidth/minheight lp_h/lp_v lpr_h/lpr_v do { + int nc = numkids * 2 + cols * 3 + 1 + 2; + if (coeff == null || nc+1>coeff.length) coeff = new float[nc+1]; + LinearProgramming.Simplex lp_h = new LinearProgramming.Simplex(); + lpr_h = new LinearProgramming.Problem(nc, nc); + // objective function - coeff[cols*2+numkids] = coeff[cols*2+numkids+1] = (float)-10000.0; // attempt to make sum of columns equal to parent width - for(int i=cols*2; i=child.col && i=child.col && i=child.col && i