From bd98e067c39d8e4855a5fe9f5d31f447fa9a8b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 12 Feb 2017 15:42:12 +0100 Subject: [PATCH] Docs: Some cleanup in Curve. --- src/path/Curve.js | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/path/Curve.js b/src/path/Curve.js index 2acd8915..ba58cea5 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -437,22 +437,6 @@ var Curve = Base.extend(/** @lends Curve# */{ return Curve.getLength(this.getValues(), from, to); }, - /** - * Returns all intersections between two {@link Curve} objects as an array - * of {@link CurveLocation} objects. - * - * @param {Curve} curve the other curve to find the intersections with (if - * the curve itself or `null` is passed, the self intersection of the - * curve is returned, if it exists) - * @return {CurveLocation[]} the locations of all intersections between the - * curves - */ - getIntersections: function(curve) { - return Curve.getCurveIntersections(this.getValues(), - curve && curve !== this ? curve.getValues() : null, - this, curve, []); - }, - // TODO: adjustThroughPoint /** @@ -654,6 +638,7 @@ statics: /** @lends Curve */{ * @return {Number[][]} an array of curve value arrays of the resulting * monotone curve. If the original curve was already monotone, an array * only containing its values are returned. + * @private */ getMonoCurves: function(v, dir) { var curves = [], @@ -1724,7 +1709,7 @@ new function() { // Scope for methods that require private functions } }}; }, -new function() { // Scope for intersection using bezier fat-line clipping +new function() { // Scope for bezier intersection using fat-line clipping function addLocation(locations, include, v1, c1, t1, p1, v2, c2, t2, p2, overlap) { @@ -2255,7 +2240,23 @@ new function() { // Scope for intersection using bezier fat-line clipping return pairs; } - return { + return /** @lends Curve# */{ + /** + * Returns all intersections between two {@link Curve} objects as an + * array of {@link CurveLocation} objects. + * + * @param {Curve} curve the other curve to find the intersections with + * (if the curve itself or `null` is passed, the self intersection + * of the curve is returned, if it exists) + * @return {CurveLocation[]} the locations of all intersections between + * the curves + */ + getIntersections: function(curve) { + return getCurveIntersections(this.getValues(), + curve && curve !== this ? curve.getValues() : null, + this, curve, []); + }, + statics: /** @lends Curve */{ getCurveIntersections: getCurveIntersections, getCurvesIntersections: getCurvesIntersections,