X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2FBox.java;h=180a65221be3dfa743d970c3c95c566518dcf70a;hb=1f1bf81e022398831354365d6522e92079556530;hp=9d7ed497118e1d4fa1ced72240a7dc166994e378;hpb=db4ab6de30e095d6448fb826c2e6f0d4ac53cc7b;p=org.ibex.core.git diff --git a/src/org/ibex/Box.java b/src/org/ibex/Box.java index 9d7ed49..180a652 100644 --- a/src/org/ibex/Box.java +++ b/src/org/ibex/Box.java @@ -152,6 +152,8 @@ public final class Box extends JSScope implements Scheduler.Task { private short col = 0; public LENGTH x = 0; public LENGTH y = 0; + public LENGTH ax = 0; // FEATURE: roll these into x/y; requires lots of changes + public LENGTH ay = 0; // FEATURE: roll these into x/y; requires lots of changes; perhaps y()? public LENGTH width = 0; public LENGTH height = 0; private LENGTH contentwidth = 0; // == max(minwidth, textwidth, sum(child.contentwidth)) @@ -166,6 +168,7 @@ public final class Box extends JSScope implements Scheduler.Task { // Instance Methods ///////////////////////////////////////////////////////////////////// + public final int fontSize() { return font == null ? DEFAULT_FONT.pointsize : font.pointsize; } /** invoked when a resource needed to render ourselves finishes loading */ public void perform() throws JSExn { @@ -174,9 +177,10 @@ public final class Box extends JSScope implements Scheduler.Task { // as external events have occured, check the state of box if (texture != null) { if (texture.isLoaded) { minwidth = min(texture.width, maxwidth); minheight = min(texture.height, maxheight); } - else { JS res = texture.stream; texture = null; throw new JSExn("image not found: "+res); } + else { JS res = texture.stream; texture = null; throw new JSExn("image not found: "+res.unclone()); } + } else { + Log.warn(Box.class, "perform() called with null texture"); } - MARK_REPACK; MARK_REFLOW; MARK_RESIZE; @@ -214,7 +218,7 @@ public final class Box extends JSScope implements Scheduler.Task { private static LENGTH[] colMaxWidth = new LENGTH[65535]; private static LENGTH[] rowHeight = new LENGTH[65535]; private static LENGTH[] rowMaxHeight = new LENGTH[65535]; - static { for(int i=0; i