diff --git a/src/path/Curve.js b/src/path/Curve.js index e346cae2..80378ae2 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -1149,25 +1149,21 @@ new function() { // // Scope to inject various curve evaluation methods var methods = ['getPoint', 'getTangent', 'getNormal', 'getWeightedTangent', 'getWeightedNormal', 'getCurvature']; return Base.each(methods, - // NOTE: Although Curve.getBounds() exists, we are using Path.getBounds() to - // determine the bounds of Curve objects with defined segment1 and segment2 - // values Curve.getBounds() can be used directly on curve arrays, without - // the need to create a Curve object first, as required by the code that - // finds path intersections. - function(name) { - // NOTE: (For easier searching): This loop produces: - // getPointAt, getTangentAt, getNormalAt, getWeightedTangentAt, - // getWeightedNormalAt, getCurvatureAt - this[name + 'At'] = function(offset, isParameter) { - var values = this.getValues(); - return Curve[name](values, isParameter ? offset - : Curve.getParameterAt(values, offset, 0)); - }; - }, { - statics: { - evaluateMethods: methods + function(name) { + // NOTE: (For easier searching): This loop produces: + // getPointAt, getTangentAt, getNormalAt, getWeightedTangentAt, + // getWeightedNormalAt, getCurvatureAt + this[name + 'At'] = function(offset, isParameter) { + var values = this.getValues(); + return Curve[name](values, isParameter ? offset + : Curve.getParameterAt(values, offset, 0)); + }; + }, { + statics: { + _evaluateMethods: methods + } } - }); + ); }, new function() { // Scope for methods that require private functions diff --git a/src/path/CurveLocation.js b/src/path/CurveLocation.js index 0acdb484..ec18d07a 100644 --- a/src/path/CurveLocation.js +++ b/src/path/CurveLocation.js @@ -512,7 +512,7 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{ hasOverlap: function() { return !!this._overlap; } -}, Base.each(Curve.evaluateMethods, function(name) { +}, Base.each(Curve._evaluateMethods, function(name) { // Produce getters for #getTangent() / #getNormal() / #getCurvature() // NOTE: (For easier searching): This loop produces: // getPointAt, getTangentAt, getNormalAt, getWeightedTangentAt, diff --git a/src/path/Path.js b/src/path/Path.js index 9de6d5cf..e806bfa7 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -1688,7 +1688,7 @@ var Path = PathItem.extend(/** @lends Path# */{ // TODO: intersects(item) // TODO: contains(item) -}, Base.each(Curve.evaluateMethods, +}, Base.each(Curve._evaluateMethods, function(name) { // NOTE: (For easier searching): This loop produces: // getPointAt, getTangentAt, getNormalAt, getWeightedTangentAt, diff --git a/src/path/PathIterator.js b/src/path/PathIterator.js index 4d2f721b..d5fe92d3 100644 --- a/src/path/PathIterator.js +++ b/src/path/PathIterator.js @@ -146,7 +146,7 @@ var PathIterator = Base.extend({ ctx.bezierCurveTo.apply(ctx, curve.slice(2)); } } -}, Base.each(Curve.evaluateMethods, +}, Base.each(Curve._evaluateMethods, function(name) { this[name + 'At'] = function(offset, weighted) { var param = this.getParameterAt(offset);