rendering optimizations
[org.ibex.core.git] / src / org / ibex / Surface.java
index b553056..d2130e3 100644 (file)
@@ -132,8 +132,8 @@ public abstract class Surface extends PixelBuffer implements Scheduler.Task {
                 int oldmousex = mousex;     mousex = newmousex;
                 int oldmousey = mousey;     mousey = newmousey;
                 String oldcursor = cursor;  cursor = "default";
-                // Root gets motion events outside itself (if trapped)
-                if (!root.inside(oldmousex, oldmousey) && !root.inside(mousex, mousey) && (button1 || button2 || button3))
+                // FIXME: Root (ONLY) gets motion events outside itself (if trapped)
+                if (oldmousex != mousex || oldmousey != mousey)
                     root.putAndTriggerTrapsAndCatchExceptions("_Move", T);
                 if (!cursor.equals(oldcursor)) syncCursor();
             } };
@@ -236,7 +236,7 @@ public abstract class Surface extends PixelBuffer implements Scheduler.Task {
         // make sure the root is properly sized
         do {
             abort = false;
-            root.repack();
+            root.pack();
             if (syncRootBoxToSurface) {
                 root.setMaxWidth(JS.N(pendingWidth));
                 root.setMaxHeight(JS.N(pendingHeight));
@@ -248,12 +248,12 @@ public abstract class Surface extends PixelBuffer implements Scheduler.Task {
                 dirty(0, root.maxheight - Main.scarImage.height, Main.scarImage.width, Main.scarImage.height);
             }
             root.resize(root.x, root.y, root.maxwidth, root.maxheight);
-            root.place_children();
+            root.place();
             setSize(root.width, root.height);
-            String oldcursor = cursor;
+            /*String oldcursor = cursor;
             cursor = "default";
             root.putAndTriggerTrapsAndCatchExceptions("_Move", JS.T);
-            if (!cursor.equals(oldcursor)) syncCursor();
+            if (!cursor.equals(oldcursor)) syncCursor();*/
         } while(abort);
 
         int[][] dirt = dirtyRegions.flush();