Revision: 1992
          http://svn.sourceforge.net/vexi/?rev=1992&view=rev
Author:   clrg
Date:     2007-07-17 16:01:47 -0700 (Tue, 17 Jul 2007)

Log Message:
-----------
Don't fire visible traps like that - it's a special property

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

Modified: core/trunk/org.vexi.core/src/org/vexi/core/Box.jpp
===================================================================
--- core/trunk/org.vexi.core/src/org/vexi/core/Box.jpp  2007-07-16 16:39:55 UTC 
(rev 1991)
+++ core/trunk/org.vexi.core/src/org/vexi/core/Box.jpp  2007-07-17 23:01:47 UTC 
(rev 1992)
@@ -127,7 +127,14 @@
     // unused - private static final int max(int a, int b, int c) { return 
(a>=b && a>=c) ? a : (b>=c && b>=a) ? b : c; }
 
     private final boolean inside(int x, int y) { return test(DISPLAY) && x >= 
0 && y >= 0 && x < width && y < height; }
-    private final boolean isVisible() throws JSExn { return 
JSU.toBoolean((JS)get(SC_visible)); }
+    private final boolean isVisible() {
+        Box b=this;
+        while(true) {
+            if (!b.test(DISPLAY)) return false;
+            if (b.parent == null) return Surface.fromBox(b) != null;
+            b = b.parent;
+        }
+    }
 
     private final void set(int mask) { flags |= mask; }
     private final void clear(int mask) { flags &= ~mask; }
@@ -1144,14 +1151,7 @@
         case "minheight": return JSU.N(minheight);
         case "maxheight": return JSU.N(maxheight);
         case "display": return JSU.B(test(DISPLAY));
-        case "visible":
-            Box b = this;
-            while(true) {
-                if (!b.test(DISPLAY)) return JSU.F;
-                if (b.parent == null) break;
-                b = b.parent;
-            }
-            return JSU.B(b.getSurface() != null);
+        case "visible": return isVisible() ? JSU.T : JSU.F;
         case "packed": throw new JSExn("Deprecated property read: 
"+JSU.toString(name));
         case "cursor": return test(CURSOR) ? super.get(name) : null;
         case "mouse":


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

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to