diff --git a/src/path/CurveLocation.js b/src/path/CurveLocation.js index 7a9383bf..f4eff541 100644 --- a/src/path/CurveLocation.js +++ b/src/path/CurveLocation.js @@ -212,9 +212,15 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{ getOffset: function() { var offset = this._offset; if (offset == null) { - var path = this.getPath(); - offset = this._offset = path ? path._getOffset(this) - : this.getCurveOffset(); + offset = 0; + var path = this.getPath(), + index = this.getIndex(); + if (path && index != null) { + var curves = path.getCurves(); + for (var i = 0; i < index; i++) + offset += curves[i].getLength(); + } + this._offset = offset += this.getCurveOffset(); } return offset; }, diff --git a/src/path/Path.js b/src/path/Path.js index 0dbc3874..d07faa2b 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -1680,22 +1680,6 @@ var Path = PathItem.extend(/** @lends Path# */{ // See #getLocationOf(), #getNearestLocation(), #getNearestPoint() beans: false, - _getOffset: function(location) { - var index = location && location.getIndex(); - if (index != null) { - var curves = this.getCurves(), - offset = 0; - for (var i = 0; i < index; i++) - offset += curves[i].getLength(); - var curve = curves[index], - parameter = location.getParameter(); - if (parameter > 0) - offset += curve.getPartLength(0, parameter); - return offset; - } - return null; - }, - /** * {@grouptitle Positions on Paths and Curves} *