From a963e2dc38d4ba10440ffcfbabd92bb7781784d7 Mon Sep 17 00:00:00 2001 From: Ben Houston Date: Fri, 21 Dec 2012 10:26:31 -0500 Subject: [PATCH] remove lazy-conditions. --- src/math/Vector2.js | 4 ++-- src/math/Vector3.js | 4 ++-- src/math/Vector4.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/math/Vector2.js b/src/math/Vector2.js index 75cf640cb6..9bb3b8ca96 100644 --- a/src/math/Vector2.js +++ b/src/math/Vector2.js @@ -118,7 +118,7 @@ THREE.Vector2.prototype = { divideScalar: function ( s ) { - if ( s ) { + if ( s !== 0 ) { this.x /= s; this.y /= s; @@ -244,7 +244,7 @@ THREE.Vector2.prototype = { var oldLength = this.length(); - if( oldLength ) { + if ( oldLength !== 0 && l !== oldLength ) { this.multiplyScalar( l / oldLength ); } diff --git a/src/math/Vector3.js b/src/math/Vector3.js index dd50e23695..c937d5ca26 100644 --- a/src/math/Vector3.js +++ b/src/math/Vector3.js @@ -168,7 +168,7 @@ THREE.Vector3.prototype = { divideScalar: function ( s ) { - if ( s ) { + if ( s !== 0 ) { this.x /= s; this.y /= s; @@ -312,7 +312,7 @@ THREE.Vector3.prototype = { var oldLength = this.length(); - if( oldLength ) { + if ( oldLength !== 0 && l !== oldLength ) { this.multiplyScalar( l / oldLength ); } diff --git a/src/math/Vector4.js b/src/math/Vector4.js index 1b1d15b166..d2d1c55074 100644 --- a/src/math/Vector4.js +++ b/src/math/Vector4.js @@ -153,7 +153,7 @@ THREE.Vector4.prototype = { divideScalar: function ( s ) { - if ( s ) { + if ( s !== 0 ) { this.x /= s; this.y /= s; @@ -321,7 +321,7 @@ THREE.Vector4.prototype = { var oldLength = this.length(); - if( oldLength ) { + if ( oldLength !== 0 && l !== oldLength ) { this.multiplyScalar( l / oldLength ); } -- GitLab