Improve CurveLocation#equals()

Relates to #784, described in https://github.com/paperjs/paper.js/issues/784#issuecomment-143161586
This commit is contained in:
Jürg Lehni 2015-09-30 12:47:02 -05:00
parent 4e9bac1ca5
commit 2a7d1c5728

View file

@ -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(