Defaults y to x if not given

This commit is contained in:
Richard Davey 2017-10-17 04:18:29 +01:00
parent 6accb89ff0
commit 66fc40845b

View file

@ -16,6 +16,8 @@ var Vector2 = new Class({
}
else
{
if (y === undefined) { y = x; }
this.x = x || 0;
this.y = y || 0;
}