X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FSurface.java;h=68bbdde00c18fd72647b12f6f9ecee162c77720f;hb=3d8c42500631568e2eda5a869403f72c8a0e361a;hp=28e4819fab7ff5dd24915e567bd0f09885abe7e4;hpb=ac49a62b989af76577f5b62e5afd58e7972623b4;p=org.ibex.core.git diff --git a/src/org/xwt/Surface.java b/src/org/xwt/Surface.java index 28e4819..68bbdde 100644 --- a/src/org/xwt/Surface.java +++ b/src/org/xwt/Surface.java @@ -278,6 +278,9 @@ public abstract class Surface { protected final void SizeChange(int width, int height) { this.width = width; this.height = height; + root.width = width; + root.height = height; + root.needs_reflow = true; abort = true; long lastResizeTime = System.currentTimeMillis(); lastResizeTimeTop = (int)(lastResizeTime >> 32); @@ -327,7 +330,7 @@ public abstract class Surface { Vec keywatchers = new Vec(); /** When set to true, render() should abort as soon as possible and restart the rendering process */ - volatile boolean abort = false; + static volatile boolean abort = false; /** a solid red 10x10 double buffer */ private DoubleBuffer showRenderBuf = null; @@ -405,9 +408,9 @@ public abstract class Surface { // make sure the root is properly sized do { - Box.abort = false; + abort = false; root.reflow(); - } while(Box.abort); + } while(abort); // this is a bit dangerous since we're passing ourselves to another method before subclasses' ctors have run... backbuffer = Platform.createDoubleBuffer(Platform.getScreenWidth(), Platform.getScreenHeight(), this); @@ -420,7 +423,7 @@ public abstract class Surface { public synchronized void render() { // if the window size changed as a result of a user action, we have to update the root box's size - if (root.width != width || root.width != height) { + if (root.width != width || root.height != height) { // since the scar will be moving, dirty the place it used to be if (scarred) dirty(hscar, @@ -437,14 +440,14 @@ public abstract class Surface { // make sure the root is properly sized do { - Box.abort = false; + abort = false; root.reflow(); // update mouseinside and trigger Enter/Leave as a result of box size/position changes String oldcursor = cursor; cursor = "default"; root.Move(mousex, mousey, mousex, mousey); if (!cursor.equals(oldcursor)) syncCursor(); - } while(Box.abort); + } while(abort); if (centerSurfaceOnRender) { centerSurfaceOnRender = false; @@ -469,7 +472,7 @@ public abstract class Surface { if (y+h > height) h = height - y; if (w <= 0 || h <= 0) continue; - root.render(x, y, w, h, backbuffer); + root.render(0, 0, x, y, w, h, backbuffer); // if any area under the scar was repainted, rescar that area if (scarred && x < hscar + scarPicture.getWidth() &&