Revision: 3939
          http://vexi.svn.sourceforge.net/vexi/?rev=3939&view=rev
Author:   clrg
Date:     2010-10-24 02:37:40 +0000 (Sun, 24 Oct 2010)

Log Message:
-----------
Minor optimization of Move logic

Modified Paths:
--------------
    branches/vexi3_old_build/core/org.vexi.core/src/org/vexi/core/Box.jpp

Modified: branches/vexi3_old_build/core/org.vexi.core/src/org/vexi/core/Box.jpp
===================================================================
--- branches/vexi3_old_build/core/org.vexi.core/src/org/vexi/core/Box.jpp       
2010-10-21 13:40:15 UTC (rev 3938)
+++ branches/vexi3_old_build/core/org.vexi.core/src/org/vexi/core/Box.jpp       
2010-10-24 02:37:40 UTC (rev 3939)
@@ -1400,34 +1400,30 @@
         // to this box so we can not call propagateLeave() directly upon it
         int i;
         boolean interrupted = false;
+        boolean packedhit = false;
         
         // absolute layout - allows for interruption by overlaying siblings
-        if (!test(PACK)) {
-            for (Box b = getChild(i=treeSize()-1); b != null; b = 
getChild(--i)) {
-                int b_mx = mousex-getXInParent(b);
-                int b_my = mousey-getYInParent(b);
-                if (!interrupted && b.inside(b_mx, b_my)) {
-                    if (b.propagateMove(b_mx, b_my)) {
-                        interrupted = true;
-                    }
-                } else {
-                    b.propagateLeave();
+        // packed layout - interrupted still applies, plus packedhit shortcut
+        for (Box b = getChild(i=treeSize()-1); b != null; b = getChild(--i)) {
+               if (!b.test(DISPLAY)) {
+                       continue;
+               }
+               if (interrupted || packedhit) {
+                b.propagateLeave();
+                       continue;
+               }
+            int b_mx = mousex-getXInParent(b);
+            int b_my = mousey-getYInParent(b);
+            if (b.inside(b_mx, b_my)) {
+               if (test(PACK)) {
+                       packedhit = true;
+               }
+                if (b.propagateMove(b_mx, b_my)) {
+                    interrupted = true;
                 }
+            } else {
+                b.propagateLeave();
             }
-        
-        // packed layout - siblings can not interrupt each other
-        } else {
-            for (Box b = getChild(i=0); b != null; b = getChild(++i)) {
-                int b_mx = mousex-b.x;
-                int b_my = mousey-b.y;
-                if (b.inside(b_mx, b_my)) {
-                    if (b.propagateMove(b_mx, b_my)) {
-                        interrupted = true;
-                    }
-                } else {
-                    b.propagateLeave();
-                }
-            }
         }
 
         // child prevented cascade during _Move/Move which blocks
@@ -1484,7 +1480,7 @@
             if (inside(s_mx, s_my)) {
                 propagateEvent(event, _event, value, s_mx, s_my);
             } else if (forceOnRoot) {
-                if (Interpreter.CASCADE_PREVENTED == justTriggerTraps(_event, 
value)) {
+                if (Interpreter.CASCADE_PREVENTED != justTriggerTraps(_event, 
value)) {
                     justTriggerTraps(event, value);
                 }
             }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to