From 8015194daa15bb7df4cd21a017b4746ec08e1229 Mon Sep 17 00:00:00 2001 From: TheJare Date: Sat, 23 Nov 2013 02:58:02 +0100 Subject: [PATCH] Fix normalizeAngle and wrapAngle (again?) --- src/math/Math.js | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/math/Math.js b/src/math/Math.js index 0c993a09..334dde0e 100644 --- a/src/math/Math.js +++ b/src/math/Math.js @@ -351,7 +351,7 @@ Phaser.Math = { if (typeof radians === "undefined") { radians = true; } var rd = (radians) ? Math.PI : 180; - return this.wrap(angle, rd, -rd); + return this.wrap(angle, -rd, rd); }, @@ -656,23 +656,7 @@ Phaser.Math = { */ wrapAngle: function (angle) { - var result = angle; - - // Nothing needs to change - if (angle >= -180 && angle <= 180) - { - return angle; - } - - // Else normalise it to -180, 180 - result = (angle + 180) % 360; - - if (result < 0) - { - result += 360; - } - - return result - 180; + return this.wrap(angle, -180, 180); },