From b49534e7a4b55bc83fe9e826a29e5e209a5097a4 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 28 Feb 2007 19:13:15 +0000 Subject: [PATCH] Tried once again to make a labeled continue work. It doesn't. I thought maybe this was fixed, because in early betas the "with" statement didn't work, but it does now. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4612 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/DisplayUtil.as | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/as/com/threerings/util/DisplayUtil.as b/src/as/com/threerings/util/DisplayUtil.as index 229b36a3a..9499dfdcb 100644 --- a/src/as/com/threerings/util/DisplayUtil.as +++ b/src/as/com/threerings/util/DisplayUtil.as @@ -103,7 +103,10 @@ public class DisplayUtil // keep track of area that doesn't generate new possibles var dead :Array = new Array(); - while (possibles.length > 0) { + // Note: labeled breaks and continues are supposed to be legal, + // but they throw wacky runtime exceptions for me. So instead + // I'm throwing a boolean and using that to continue the while + /* CHECKPOSSIBLES: */ while (possibles.length > 0) { try { var p :Point = (possibles.shift() as Point); r.x = p.x; @@ -117,6 +120,7 @@ public class DisplayUtil // and not over a dead area for each (var deadRect :Rectangle in dead) { if (deadRect.intersects(r)) { + //continue CHECKPOSSIBLES; throw true; // continue outer loop } } @@ -140,6 +144,7 @@ public class DisplayUtil // re-sort the list possibles.sort(pointSorter); + //continue CHECKPOSSIBLES; throw true; // continue outer loop } }