X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fcore%2FBox.java;h=c4c9fd8e906df3664945ff46d61e01b0be36ded2;hp=f333abb0eba7983bfcc5d4480886037940fd36c4;hb=ed8c8e77f35b69a9084dc5b7327ffb5cbf406cff;hpb=8e190fb0ff508ccf4962bbfbf8295a431805c12b diff --git a/src/org/ibex/core/Box.java b/src/org/ibex/core/Box.java index f333abb..c4c9fd8 100644 --- a/src/org/ibex/core/Box.java +++ b/src/org/ibex/core/Box.java @@ -126,8 +126,8 @@ public final class Box extends JSScope implements Task { private int contentwidth = 0; // == max(minwidth, textwidth, sum(child.contentwidth)) private int contentheight = 0; + private Path path = null; /* - private VectorGraphics.VectorPath path = null; private Affine transform = null; private VectorGraphics.RasterPath rpath = null; private Affine rtransform = null; @@ -143,8 +143,8 @@ public final class Box extends JSScope implements Task { public void perform() throws JSExn { if (texture == null) { Log.warn(Box.class, "perform() called with null texture"); return; } if (texture.isLoaded) { - setWidth(max(texture.width, maxwidth), maxwidth); - setHeight(max(texture.height, maxheight), maxheight); + setWidth(max(texture.width, minwidth), maxwidth); + setHeight(max(texture.height, minheight), maxheight); DIRTY; } else { JS res = texture.stream; texture = null; throw new JSExn("image not found: "+res.unclone()); } } @@ -420,6 +420,8 @@ public final class Box extends JSScope implements Task { font.rasterizeGlyphs(text, buf, strokecolor, text_x, text_y, cx1, cy1, cx2, cy2); } + if (path != null) path.realize(Affine.translate(globalx, globaly)).stroke(buf, 1, strokecolor); + for(Box b = getChild(0); b != null; b = b.nextSibling()) b.render(globalx, globaly, cx1, cy1, cx2, cy2, buf, null); } @@ -545,6 +547,7 @@ public final class Box extends JSScope implements Task { 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 "width": setWidth(toInt(value), toInt(value)); case "height": setHeight(toInt(value), toInt(value)); case "maxwidth": setWidth(minwidth, toInt(value)); @@ -848,7 +851,7 @@ public final class Box extends JSScope implements Task { b.clear(MOUSEINSIDE); deleteNode(i); b.parent = null; - RECONSTRAIN(); + REPACK(); putAndTriggerTrapsAndCatchExceptions("ChildChange", b); } @@ -901,8 +904,8 @@ public final class Box extends JSScope implements Task { b.parent = this; // need both of these in case child was already uncalc'ed - b.RECONSTRAIN(); - RECONSTRAIN(); + b.REPACK(); + REPACK(); b.DIRTY; putAndTriggerTrapsAndCatchExceptions("ChildChange", b);