From 97c8a7cb83689dc70eff2e2de4cb3059a466289f Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Tue, 31 May 2011 16:13:42 +0200 Subject: [PATCH] Clean up Line#getSide. --- src/basic/Line.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/basic/Line.js b/src/basic/Line.js index 341b7f7c..75fcd9ea 100644 --- a/src/basic/Line.js +++ b/src/basic/Line.js @@ -96,14 +96,14 @@ var Line = this.Line = Base.extend({ var v1 = this.vector, v2 = point.subtract(this.point), ccw = v2.cross(v1); - if (ccw == 0.0) { + if (ccw == 0) { ccw = v2.dot(v1); - if (ccw > 0.0) { + if (ccw > 0) { ccw = (v2 - v1).dot(v1); - if (ccw < 0.0) - ccw = 0.0; + if (ccw < 0) + ccw = 0; } } - return ccw < 0.0 ? -1 : ccw > 0.0 ? 1 : 0; + return ccw < 0 ? -1 : ccw > 0 ? 1 : 0; } });