re-enabled path support
[org.ibex.core.git] / src / org / ibex / core / Box.java
index c34948d..c4c9fd8 100644 (file)
@@ -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;
@@ -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));