From ef4eee106408798cfc8ae194594d1c503f81c00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 4 Jul 2013 19:39:55 -0700 Subject: [PATCH] Pass true for isParameter in Curve#divide() calls. Closes #252. --- src/path/Curve.js | 2 ++ src/path/CurveLocation.js | 4 ++-- src/path/Path.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/path/Curve.js b/src/path/Curve.js index 77f7b52f..36ea04f1 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -342,6 +342,7 @@ var Curve = Base.extend(/** @lends Curve# */{ * is a curve time parameter. * @return {Curve} the second part of the divided curve */ + // TODO: Rename to divideAt()? divide: function(offset, isParameter) { var parameter = this._getParameter(offset, isParameter), res = null; @@ -407,6 +408,7 @@ var Curve = Base.extend(/** @lends Curve# */{ * @return {Path} The newly created path after splitting, if any * @see Path#split(index, parameter) */ + // TODO: Rename to splitAt()? split: function(offset, isParameter) { return this._path ? this._path.split(this._segment1._index, diff --git a/src/path/CurveLocation.js b/src/path/CurveLocation.js index 894fa87c..532cffd7 100644 --- a/src/path/CurveLocation.js +++ b/src/path/CurveLocation.js @@ -238,12 +238,12 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{ divide: function() { var curve = this.getCurve(true); - return curve && curve.divide(this.getParameter(true)); + return curve && curve.divide(this.getParameter(true), true); }, split: function() { var curve = this.getCurve(true); - return curve && curve.split(this.getParameter(true)); + return curve && curve.split(this.getParameter(true), true); }, /** diff --git a/src/path/Path.js b/src/path/Path.js index 42f42a82..c51d037f 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -1037,7 +1037,7 @@ var Path = PathItem.extend(/** @lends Path# */{ if (parameter > 0) { // Divide the curve with the index at given parameter. // Increase because dividing adds more segments to the path. - curves[index++].divide(parameter); + curves[index++].divide(parameter, true); } // Create the new path with the segments to the right of given // parameter, which are removed from the current path. Pass true