2003/12/21 09:29:50
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:43:05 +0000 (07:43 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:43:05 +0000 (07:43 +0000)
darcs-hash:20040130074305-2ba56-8bade0c08815f531f92374d642db4d410dfb5146.gz

src/org/xwt/Box.java

index 25dc935..a96383e 100644 (file)
@@ -138,6 +138,8 @@ public final class Box extends JSScope implements Scheduler.Task {
     private int fillcolor = 0x00000000;
     private int strokecolor = 0xFF000000;
 
+    private int aspect = 0;
+
     // specified directly by user
     public LENGTH minwidth = 0;
     public LENGTH maxwidth = MAX_LENGTH;
@@ -349,6 +351,7 @@ public final class Box extends JSScope implements Scheduler.Task {
         if ((fillcolor & 0xFF000000) != 0x00000000)
             buf.fillTrapezoid(globalx, globalx + width, globaly, globalx, globalx + width, globaly + height, fillcolor);
 
+        // FIXME: do aspect in here
         if (texture != null && texture.isLoaded)
             for(int x = globalx; x < cx2; x += texture.width)
                 for(int y = globaly; y < cy2; y += texture.height)
@@ -413,6 +416,7 @@ public final class Box extends JSScope implements Scheduler.Task {
         case "shrink": return B(test(HSHRINK) || test(VSHRINK));
         case "hshrink": return B(test(HSHRINK));
         case "vshrink": return B(test(VSHRINK));
+        case "aspect": return N(aspect);
         case "x": return (parent == null || !test(VISIBLE)) ? N(0) : N(x);
         case "y": return (parent == null || !test(VISIBLE)) ? N(0) : N(y);
         case "width": return N(width);
@@ -469,6 +473,7 @@ public final class Box extends JSScope implements Scheduler.Task {
         case "noclip": CHECKSET_FLAG(NOCLIP); if (parent == null) dirty(); else parent.dirty();
         case "visible": CHECKSET_FLAG(VISIBLE); dirty(); MARK_RESIZE; dirty();
         case "packed": CHECKSET_FLAG(PACKED); MARK_REPACK_parent;
+        case "aspect": CHECKSET_INT(aspect); DIRTY;
         case "globalx": put("x", N(globalToLocalX(toInt(value))));
         case "globaly": put("y", N(globalToLocalY(toInt(value))));
         case "align": clear(ALIGNS); setAlign(value == null ? "center" : value); MARK_RESIZE;