diff --git a/src/path/CurveLocation.js b/src/path/CurveLocation.js index fccd561d..56fe57e9 100644 --- a/src/path/CurveLocation.js +++ b/src/path/CurveLocation.js @@ -387,17 +387,15 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{ * crossing another curve} * @see #isTouching() */ - isCrossing: function(_report) { + isCrossing: function() { // Implementation based on work by Andy Finnell: // http://losingfight.com/blog/2011/07/09/how-to-implement-boolean-operations-on-bezier-paths-part-3/ // https://bitbucket.org/andyfinnell/vectorboolean var inter = this._intersection; if (!inter) return false; - // TODO: Make getCurve() and getParameter() sync work in boolean ops - // before and after splitting!!! - var t1 = this._parameter, - t2 = inter._parameter, + var t1 = this.getParameter(), + t2 = inter.getParameter(), tMin = /*#=*/Numerical.CURVETIME_EPSILON, tMax = 1 - tMin; // If the intersection is in the middle of the path, it is either a @@ -411,32 +409,14 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{ // emerge from switching to 0 and 1 in edge cases. // NOTE: VectorBoolean has code that slowly shifts these points inwards // until the resulting tangents are not ambiguous. Do we need this too? - var c2 = this._curve, + var c2 = this.getCurve(), c1 = c2.getPrevious(), - c4 = inter._curve, + c4 = inter.getCurve(), c3 = c4.getPrevious(), PI = Math.PI; if (!c1 || !c3) return false; - if (_report) { - new Path.Circle({ - center: this.getPoint(), - radius: 10, - strokeColor: 'red' - }); - new Path({ - segments: [c1.getSegment1(), c1.getSegment2(), c2.getSegment2()], - strokeColor: 'red', - strokeWidth: 4 - }); - new Path({ - segments: [c3.getSegment1(), c3.getSegment2(), c4.getSegment2()], - strokeColor: 'orange', - strokeWidth: 4 - }); - } - function isInRange(angle, min, max) { return min < max ? angle > min && angle < max diff --git a/src/path/PathItem.Boolean.js b/src/path/PathItem.Boolean.js index 04aa0133..c485a6d8 100644 --- a/src/path/PathItem.Boolean.js +++ b/src/path/PathItem.Boolean.js @@ -136,7 +136,8 @@ PathItem.inject(new function() { } /* - * Creates linked lists between intersections through their _next property. + * Creates linked lists between intersections through their _next and _prev + * properties. * * @private */