Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShapeLayout's getNextPoint can cause infinite loops in certain circumstances #15

Open
joelhooks opened this issue Jul 14, 2011 · 0 comments

Comments

@joelhooks
Copy link

            var pt : Point;

    do {
        pt = new Point();
        pt.x = (Math.random() * _rect.width) + _rect.x;
        pt.y = (Math.random() * _rect.height) + _rect.y;

        if (!_target.hitTestPoint(pt.x, pt.y, true)) {
            pt = null;
        }
    } while (pt == null);


    return pt;
}```

If the ShapeLayout's layout object has been added to another container that hasn't been added to the stage the above do-while loop can never escape.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant