X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FBox.java;h=e34fe984f246e85f1a810651cb6db135f01b65d0;hb=b3611dccef8b70fc1229f259e3a9f9bdf1b2b8b4;hp=ff243ccce97c69c08610ef3a287f3147ecacc4fa;hpb=d808d820e5497c26db571413862b4e39dbf9bf8c;p=org.ibex.core.git diff --git a/src/org/xwt/Box.java b/src/org/xwt/Box.java index ff243cc..e34fe98 100644 --- a/src/org/xwt/Box.java +++ b/src/org/xwt/Box.java @@ -825,16 +825,16 @@ public final class Box extends JSObject { if (w <= 0 || h <= 0) return; if (border != null) renderBorder(x, y, w, h, buf); - if ((color & 0xFF000000) != 0x00000000 || getParent() == null) { int bw = border == null ? 0 : border[2].getWidth(); int bh = border == null ? 0 : border[0].getHeight(); + int x1 = max(x, pos(0) + bw); + int y1 = max(y, pos(1) + bh); + int x2 = min(x + w, pos(0) + size(0) - bw); + int y2 = min(y + h, pos(1) + size(1) - bh); buf.setClip(0, 0, buf.getWidth(), buf.getHeight()); - buf.fillRect(max(x, pos(0) + bw), - max(y, pos(1) + bh), - min(x + w, pos(0) + size(0) - bw), - min(y + h, pos(1) + size(1) - bh), - (color & 0xFF000000) != 0 ? color : SpecialBoxProperty.lightGray); + if (y2 - y1 > 0 && x2 - x1 > 0) + buf.fillRect(x1,y1,x2,y2,(color & 0xFF000000) != 0 ? color : SpecialBoxProperty.lightGray); } if (image != null) {