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

Polygon.contains returns true for points to the left of the polygon #766

Closed
wants to merge 2 commits into from
Closed

Polygon.contains returns true for points to the left of the polygon #766

wants to merge 2 commits into from

Conversation

vilcans
Copy link

@vilcans vilcans commented Apr 27, 2014

Test case:

        var game = new Phaser.Game(600, 400);
        var poly = new Phaser.Polygon(
            50, 0,
            100, 0,
            100, 50,
            50, 50
        );
        var contains = poly.contains(40, 25);
        console.log('Contains?', contains, '(should be false)');

Some optimization gone wrong maybe when porting PIXI.Polygon maybe?

Anyway, a simple fix.

@photonstorm
Copy link
Collaborator

I can't merge your PR (wrong branch, wrong files - see contributors guide), but have merged the fix locally anyway, so no worries 👍

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

Successfully merging this pull request may close these issues.

None yet

2 participants