X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2FBox.java;h=eb3123b93b7bed758f9205fefcd84f59fc56b2f0;hb=ae09de9ae76aa9c28433271f2a12245ca969e5f4;hp=e3e30ecef4c5696f016f66899683fd4f2b951e94;hpb=b1568b13f53ca805911fcd7737daf79492d6be1f;p=org.ibex.core.git diff --git a/src/org/ibex/Box.java b/src/org/ibex/Box.java index e3e30ec..eb3123b 100644 --- a/src/org/ibex/Box.java +++ b/src/org/ibex/Box.java @@ -54,7 +54,7 @@ public final class Box extends JSScope implements Scheduler.Task { //#define CHECKSET_INT(prop) int nu = toInt(value); if (nu == prop) break; prop = nu; //#define CHECKSET_FLAG(flag) boolean nu = toBoolean(value); if (nu == test(flag)) break; if (nu) set(flag); else clear(flag); //#define CHECKSET_BOOLEAN(prop) boolean nu = toBoolean(value); if (nu == prop) break; prop = nu; - //#define CHECKSET_STRING(prop) if ((value==null&&prop==null)||(value!=null&&value.equals(prop))) break; prop=(String)value; + //#define CHECKSET_STRING(prop) if ((value==null&&prop==null)||(value!=null&&JS.toString(value).equals(prop))) break; prop=JS.toString(value); protected Box() { super(null); } @@ -277,10 +277,9 @@ public final class Box extends JSScope implements Scheduler.Task { } private static float[] coeff = null; - private static Simplex lp_h = new Simplex(100, 100, 300); - private static Simplex lp = new Simplex(100, 100, 300); + private static Simplex lp_h = new Simplex(65535, 65535, 65535); + private static Simplex lp = new Simplex(65535, 65535, 65535); - // FIXME: numboxes^2, and damn ugly to boot private static int[] regions = new int[65535]; private static int[] regions_v = new int[65535]; private static int numregions = 0; @@ -291,18 +290,18 @@ public final class Box extends JSScope implements Scheduler.Task { private void computeRegions() { numregions = 0; for(Box c = firstPackedChild(); c != null; c = c.nextPackedSibling()) { - int target = c.col; - for(boolean stop = false;;) { - for(int i=0; i<=numregions; i++) { - if (i == numregions) { regions[numregions++] = target; break; } - if (target == regions[i]) break; - if (target < regions[i]) { int tmp = target; target = regions[i]; regions[i] = tmp; } - } - if (stop) break; - stop = true; - target = min(cols, c.col+c.colspan); - } + 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 0 && cols > 1) do { + if (numkids > 0) do { computeRegions(); int nc = numregions * 3 + numkids * 2 + 3; if (coeff == null || nc+1>coeff.length) coeff = new float[nc+1]; @@ -321,7 +320,7 @@ public final class Box extends JSScope implements Scheduler.Task { for(int i=0; i