From: adam Date: Sun, 11 Apr 2004 19:56:22 +0000 (+0000) Subject: incremental repainting X-Git-Tag: RC4~11 X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=commitdiff_plain;h=101d92c6c35804825a28c3845d19bf653691ea45;hp=162fce11441e085eb084fef7b4ca8dd6006e9dfe incremental repainting darcs-hash:20040411195622-5007d-da1de8fa4228eccf4a4bb52187e46ee3227e1d84.gz --- diff --git a/src/org/ibex/Box.java b/src/org/ibex/Box.java index faaabeb..9d2196d 100644 --- a/src/org/ibex/Box.java +++ b/src/org/ibex/Box.java @@ -254,25 +254,22 @@ public final class Box extends JSScope implements Scheduler.Task { void resize(LENGTH x, LENGTH y, LENGTH width, LENGTH height) { if (x == this.x && y == this.y && width == this.width && height == this.height) return; boolean sizechange = (this.width != width || this.height != height) && getTrap("SizeChange") != null; - try { - int thisx = parent == null ? 0 : this.x; - int thisy = parent == null ? 0 : this.y; - if (this.x != x || this.y != y) set(MOVED); - if (texture == null && (text == null || text.equals("")) && !test(MOVED)) { - if ((fillcolor & 0xff000000) != 0) { - Box who = (parent == null ? this : parent); - who.dirty(thisx+min(this.width,width), thisy, Math.abs(width-this.width), max(this.height, height)); - who.dirty(thisx, thisy+min(this.height,height), min(this.width, width), Math.abs(height-this.height)); - } - //return; + int thisx = parent == null ? 0 : this.x; + int thisy = parent == null ? 0 : this.y; + Box who = (parent == null ? this : parent); + if (this.x != x || this.y != y) set(MOVED); + if (texture == null && (text == null || text.equals("")) && !test(MOVED)) { + if ((fillcolor & 0xff000000) != 0 || parent == null) { + who.dirty(thisx+min(this.width,width), thisy, Math.abs(width-this.width), max(this.height, height)); + who.dirty(thisx, thisy+min(this.height,height), max(this.width, width), Math.abs(height-this.height)); } - (parent == null ? this : parent).dirty(thisx, thisy, this.width, this.height); this.width = width; this.height = height; this.x = x; this.y = y; - DIRTY; - } finally { + } else { + who.dirty(thisx, thisy, this.width, this.height); this.width = width; this.height = height; this.x = x; this.y = y; - if (sizechange) putAndTriggerTrapsAndCatchExceptions("SizeChange", T); + DIRTY; } + if (sizechange) putAndTriggerTrapsAndCatchExceptions("SizeChange", T); } private float targetColumnSize = (float)0.0;