From 2eb02b18773eb30f609e13d633fcc40fe393e8a8 Mon Sep 17 00:00:00 2001 From: megacz Date: Fri, 30 Jan 2004 06:47:54 +0000 Subject: [PATCH] 2002/06/05 19:50:56 darcs-hash:20040130064754-2ba56-32799559c8d7bd318f8b83b1a6d914a15de97e8b.gz --- src/org/xwt/Box.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/org/xwt/Box.java b/src/org/xwt/Box.java index ff243cc..51315b9 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) - 2); 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) { -- 1.7.10.4