- nextWidth = width;
- nextHeight = height;
- if (nextSizeChange != null) return;
- if (root.maxwidth == width && root.maxheight == height) return;
- nextSizeChange = new Scheduler.Task() { public void perform() {
- if (nextSizeChange != this) return;
- // dirty the place where the scar used to be
- root.dirty(0, root.maxheight - Main.scarImage.height, Main.scarImage.width, Main.scarImage.height);
- root.setMaxWidth(JS.N(nextWidth));
- root.setMaxHeight(JS.N(nextHeight));
- nextSizeChange = null;
- }};
- Scheduler.add(nextSizeChange);
+ if (pendingWidth == width && pendingHeight == height) return;
+ actualWidth = pendingWidth = width;
+ actualHeight = pendingHeight = height;