diff --git a/src/basic/Line.js b/src/basic/Line.js index b2295d4c..3d143109 100644 --- a/src/basic/Line.js +++ b/src/basic/Line.js @@ -113,7 +113,10 @@ var Line = Base.extend(/** @lends Line# */{ }, isCollinear: function(line) { - return this._vx * line._vy - this._vy * line._vx < 1e-10; + // TODO: Tests showed that 1e-10 might work well here, but we want to + // keep it in sync with Point#isCollinear() + return this._vx * line._vy - this._vy * line._vx + < /*#=*/Numerical.TOLERANCE; }, statics: /** @lends Line */{ diff --git a/src/basic/Point.js b/src/basic/Point.js index 7ff1ab5a..f9af8718 100644 --- a/src/basic/Point.js +++ b/src/basic/Point.js @@ -703,7 +703,8 @@ var Point = Base.extend(/** @lends Point# */{ */ isCollinear: function(point) { // NOTE: Numerical.EPSILON is too small, breaking shape-path-shape - // conversion test. + // conversion test. But tolerance is probably too large? + // TODO: Tests showed that 1e-10 might work well here. return Math.abs(this.cross(point)) < /*#=*/Numerical.TOLERANCE; },