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) {