static int TILE_FLAG = 0x00000020;
static int FONT_CHANGED_FLAG = 0x00000040; // set when font changes, cleared during repack
static int ISROOT_FLAG = 0x00000080;
+ static int NOCLIP_FLAG = 0x00000100;
// Geometry ////////////////////////////////////////////////////////////////////////////
public final void dirty() { dirty(0, 0, width, height); }
public final void dirty(int x, int y, int w, int h) {
for(Box cur = this; cur != null; cur = cur.parent) {
- w = min(x + w, cur.width) - max(x, 0);
- h = min(y + h, cur.height) - max(y, 0);
- x = max(x, 0);
- y = max(y, 0);
+ if ((flags & NOCLIP_FLAG) == 0) {
+ w = min(x + w, cur.width) - max(x, 0);
+ h = min(y + h, cur.height) - max(y, 0);
+ x = max(x, 0);
+ y = max(y, 0);
+ }
if (w <= 0 || h <= 0) return;
if (cur.parent == null && cur.surface != null) cur.surface.dirty(x, y, w, h);
x += cur.x;
int globaly = parenty + (parent == null ? 0 : y);
// intersect the x,y,w,h rendering window with ourselves; quit if it's empty
- clipw = min(max(clipx, parent == null ? 0 : globalx) + clipw, (parent == null ? 0 : globalx) + width) - globalx;
- cliph = min(max(clipy, parent == null ? 0 : globaly) + cliph, (parent == null ? 0 : globaly) + height) - globaly;
- clipx = max(clipx, parent == null ? 0 : globalx);
- clipy = max(clipy, parent == null ? 0 : globaly);
+ if ((flags & NOCLIP_FLAG) == 0) {
+ clipw = min(max(clipx, parent == null ? 0 : globalx) + clipw, (parent == null ? 0 : globalx) + width) - globalx;
+ cliph = min(max(clipy, parent == null ? 0 : globaly) + cliph, (parent == null ? 0 : globaly) + height) - globaly;
+ clipx = max(clipx, parent == null ? 0 : globalx);
+ clipy = max(clipy, parent == null ? 0 : globaly);
+ }
if (clipw <= 0 || cliph <= 0) return;
if ((fillcolor & 0xFF000000) != 0x00000000)
- buf.fillRect(clipx, clipy, clipx + clipw, clipy + cliph, fillcolor);
+ buf.fillTrapezoid(clipx, clipx + clipw, clipy, clipx, clipx + clipw, clipy + cliph, fillcolor);
if (image != null)
if ((flags & TILE_FLAG) != 0) renderTiledImage(globalx, globaly, clipx, clipy, clipw, cliph, buf);
renderText(globalx, globaly, clipx, clipy, clipw, cliph, buf);
// now subtract the pad region from the clip region before proceeding
- clipw = min(max(clipx, globalx + hpad) + clipw, globalx + width - hpad) - clipx;
- cliph = min(max(clipy, globaly + vpad) + cliph, globaly + height - vpad) - clipy;
- clipx = max(clipx, globalx + hpad);
- clipy = max(clipy, globaly + vpad);
+ if ((flags & NOCLIP_FLAG) == 0) {
+ clipw = min(max(clipx, globalx + hpad) + clipw, globalx + width - hpad) - clipx;
+ cliph = min(max(clipy, globaly + vpad) + cliph, globaly + height - vpad) - clipy;
+ clipx = max(clipx, globalx + hpad);
+ clipy = max(clipy, globaly + vpad);
+ }
for(Box b = getChild(0); b != null; b = b.nextSibling())
b.render(globalx, globaly, clipx, clipy, clipw, cliph, buf);
b.dirty();
} });
+ specialBoxProperties.put("noclip", new SpecialBoxProperty() {
+ public Object get(Box b) { return ((b.flags & NOCLIP_FLAG) != 0) ? Boolean.TRUE : Boolean.FALSE; }
+ public void put(Box b, Object value) {
+ if (((b.flags & NOCLIP_FLAG) != 0) == stob(value)) return;
+ if (stob(value)) b.flags |= NOCLIP_FLAG; else b.flags &= ~NOCLIP_FLAG;
+ MARK_FOR_REFLOW_b;
+ b.dirty();
+ } });
+
specialBoxProperties.put("invisible", new SpecialBoxProperty() {
public Object get(Box b) {
for (Box cur = b; cur != null; cur = cur.parent) {