Skip to content

Commit c85f4c0

Browse files
committed
may as well use the setter logic, saves duplicating code
1 parent 2faab9b commit c85f4c0

1 file changed

Lines changed: 1 addition & 25 deletions

File tree

src/geom/Polygon.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,7 @@ Phaser.Polygon = function (points) {
2323
*/
2424
this.type = Phaser.POLYGON;
2525

26-
//if points isn't an array, use arguments as the array
27-
if (!(points instanceof Array))
28-
{
29-
points = Array.prototype.slice.call(arguments);
30-
}
31-
32-
//if this is a flat array of numbers, convert it to points
33-
if (typeof points[0] === 'number')
34-
{
35-
var p = [];
36-
37-
for (var i = 0, len = points.length; i < len; i += 2)
38-
{
39-
p.push(new Phaser.Point(points[i], points[i + 1]));
40-
}
41-
42-
points = p;
43-
}
44-
45-
/**
46-
* @property {array<Phaser.Point>|array<number>} points - The array of vertex Points.
47-
* @private
48-
*/
49-
this._points = points;
50-
26+
this.points = points;
5127
};
5228

5329
Phaser.Polygon.prototype = {

0 commit comments

Comments
 (0)