void resize(int x, int y, int width, int height) {
if (x == this.x && y == this.y && width == this.width && height == this.height) return;
- boolean sizechange = (this.width != width || this.height != height) && getTrap("SizeChange") != null;
+ boolean sizechange = (this.width != width || this.height != height) && hasTrap("SizeChange");
int thisx = parent == null ? 0 : this.x;
int thisy = parent == null ? 0 : this.y;
Box who = (parent == null ? this : parent);
case "distanceto":
Box b = (Box)a0;
- JS ret = new JS();
+ JS ret = new JS.O();
ret.put("x", N(b.localToGlobalX(0) - localToGlobalX(0)));
ret.put("y", N(b.localToGlobalY(0) - localToGlobalY(0)));
return ret;
case "indexof": return METHOD;
case "distanceto": return METHOD;
case "text": return text;
- case "path": throw new JSExn("cannot read from the path property");
+ case "path":
+ if (path != null) return path.toString();
+ if (text == null) return null;
+ if (font == null) return null;
+ String ret = "";
+ for(int i=0; i<text.length(); i++) ret += font.glyphs[text.charAt(i)].path;
+ return ret;
case "fill": return Color.colorToString(fillcolor);
case "strokecolor": return Color.colorToString(strokecolor);
case "textcolor": return Color.colorToString(strokecolor);
throw new Error("unreachable"); // unreachable
}
- private class Mouse extends JS.Cloneable {
+ private class Mouse extends JS implements JS.Cloneable {
public Object get(Object key) {
//#switch(key)
case "x": return N(globalToLocalX(getSurface()._mousex));
case "shrink": CHECKSET_FLAG(HSHRINK | VSHRINK); RECONSTRAIN();
case "hshrink": CHECKSET_FLAG(HSHRINK); RECONSTRAIN();
case "vshrink": CHECKSET_FLAG(VSHRINK); RECONSTRAIN();
- case "path": path = Path.parse(toString(value)); dirty();
+ case "path": path = Path.parse(toString(value)); RECONSTRAIN(); dirty();
case "width": setWidth(toInt(value), toInt(value));
case "height": setHeight(toInt(value), toInt(value));
case "maxwidth": setWidth(minwidth, toInt(value));