diff --git a/src/path/CurveLocation.js b/src/path/CurveLocation.js index b006e39f..a475bf7d 100644 --- a/src/path/CurveLocation.js +++ b/src/path/CurveLocation.js @@ -28,9 +28,6 @@ */ var CurveLocation = Base.extend(/** @lends CurveLocation# */{ _class: 'CurveLocation', - // Enforce creation of beans, as bean getters have hidden parameters. - // See #getSegment() below. - beans: true, // DOCS: CurveLocation class description: add these back when the mentioned // functioned have been added: {@link Path#split(location)} @@ -134,8 +131,7 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{ // still, otherwise assume it's the curve before segment2. function trySegment(segment) { var curve = segment && segment.getCurve(); - if (curve && (that._time = curve.getTimeOf(that._point)) - != null) { + if (curve && (that._time = curve.getTimeOf(that._point)) != null) { // Fetch path again as it could be on a new one through split() that._setCurve(curve); that._segment = segment; diff --git a/src/path/PathItem.Boolean.js b/src/path/PathItem.Boolean.js index 4996dfb6..b8d32446 100644 --- a/src/path/PathItem.Boolean.js +++ b/src/path/PathItem.Boolean.js @@ -264,22 +264,25 @@ PathItem.inject(new function() { prevTime; for (var i = locations.length - 1; i >= 0; i--) { - var loc = locations[i]; - // Call include() before retrieving _curve, because it might cause a - // change in the cached location values (see #resolveCrossings()). + var loc = locations[i], + // Retrieve curve-time before calling include(), because it may + // be changed to the scaled value after splitting previously. + // See CurveLocation#getCurve(), #resolveCrossings() + time = loc._time; if (include) { if (!include(loc)) continue; results.unshift(loc); } + // Retrieve curve after calling include(), because it may cause a + // change in the cached location values, see above. var curve = loc._curve, - time = loc._time, origTime = time, segment; if (curve !== prevCurve) { // This is a new curve, update noHandles setting. noHandles = !curve.hasHandles(); - } else if (prevTime >= tMin && prevTime <= tMax ) { + } else if (prevTime > tMin) { // Scale parameter when we are splitting same curve multiple // times, but only if splitting was done previously. time /= prevTime;