From 2a7d1c5728d1c80cb2c1818308e47f9bacaf057b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 30 Sep 2015 12:47:02 -0500 Subject: [PATCH] Improve CurveLocation#equals() Relates to #784, described in https://github.com/paperjs/paper.js/issues/784#issuecomment-143161586 --- src/path/CurveLocation.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/path/CurveLocation.js b/src/path/CurveLocation.js index b1111a35..5bfdc06a 100644 --- a/src/path/CurveLocation.js +++ b/src/path/CurveLocation.js @@ -365,8 +365,10 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{ || loc instanceof CurveLocation // Call getCurve() and getParameter() to keep in sync && this.getCurve() === loc.getCurve() - && this.getPoint().isClose(loc.getPoint(), + && (this.getPoint().isClose(loc.getPoint(), /*#=*/Numerical.GEOMETRIC_EPSILON) + || Math.abs(this.getParameter() - loc.getParameter()) + < /*#=*/Numerical.CURVETIME_EPSILON) && (_ignoreOther || (!this._intersection && !loc._intersection || this._intersection && this._intersection.equals(