Skip to content

[2.1.3] Polygon.contains - Cannot read property 'y' of undefined #1267

@BurnedToast

Description

@BurnedToast

Hi,

I get an error that can be reproduced with the following snippet:

var poly = new Phaser.Polygon([
    new Phaser.Point(250, 0),
    new Phaser.Point(50, 0),
    new Phaser.Point(0, 100),
    new Phaser.Point(275, 100),
    new Phaser.Point(250, 0)
]);
poly.contains(50, 50);

The error stack is;

Uncaught TypeError: Cannot read property 'y' of undefined phaser.js:15457
Phaser.Polygon.contains phaser.js:15457

Thats Polygon.js line 100

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions