From 66fc40845b86ba1219139ba5f2d346a49fb0447e Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Tue, 17 Oct 2017 04:18:29 +0100 Subject: [PATCH] Defaults y to x if not given --- v3/src/math/Vector2.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/v3/src/math/Vector2.js b/v3/src/math/Vector2.js index 42ea57175..2976b563c 100644 --- a/v3/src/math/Vector2.js +++ b/v3/src/math/Vector2.js @@ -16,6 +16,8 @@ var Vector2 = new Class({ } else { + if (y === undefined) { y = x; } + this.x = x || 0; this.y = y || 0; }