Revision: 949
Author: allain.lalonde
Date: Sat Jan 23 17:38:49 2010
Log: Making POcclusionDetection use java5's for each syntax
http://code.google.com/p/piccolo2d/source/detail?r=949

Modified:
/piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/util/POcclusionDetection.java

=======================================
--- /piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/util/POcclusionDetection.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/util/POcclusionDetection.java Sat Jan 23 17:38:49 2010
@@ -31,6 +31,7 @@
 import org.piccolo2d.PNode;
 import org.piccolo2d.util.PBounds;
 import org.piccolo2d.util.PPickPath;
+import static org.piccolo2d.util.PUtil.reverse;


 /**
@@ -69,9 +70,7 @@

         pickPath.pushTransform(node.getTransformReference(false));

-        final int count = node.getChildrenCount();
-        for (int i = count - 1; i >= 0; i--) {
-            final PNode each = node.getChild(i);
+        for (PNode each: reverse(node.getChildrenReference())) {
             if (node.getOccluded()) {
                 // if n has been occluded by a previous descendant then
                 // this child must also be occluded

--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en

Reply via email to