Skip to content

Commit 66fc408

Browse files
committed
Defaults y to x if not given
1 parent 6accb89 commit 66fc408

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

v3/src/math/Vector2.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ var Vector2 = new Class({
1616
}
1717
else
1818
{
19+
if (y === undefined) { y = x; }
20+
1921
this.x = x || 0;
2022
this.y = y || 0;
2123
}

0 commit comments

Comments
 (0)