No more need for #_getCurves() since it now does the same as #getCurves()

#getCurves() works both on Path and CompoundPath. Relates to #1073, #1075
This commit is contained in:
Jürg Lehni 2016-06-16 11:16:56 +02:00
parent 1a392bb5db
commit 85c680820e

View file

@ -100,7 +100,7 @@ PathItem.inject(new function() {
for (var i = 0, l = paths.length; i < l; i++) { for (var i = 0, l = paths.length; i < l; i++) {
var path = paths[i]; var path = paths[i];
segments.push.apply(segments, path._segments); segments.push.apply(segments, path._segments);
curves.push.apply(curves, path._getCurves()); curves.push.apply(curves, path.getCurves());
// Keep track if there are valid intersections other than // Keep track if there are valid intersections other than
// overlaps in each path. // overlaps in each path.
path._overlapsOnly = path._validOverlapsOnly = true; path._overlapsOnly = path._validOverlapsOnly = true;
@ -727,7 +727,7 @@ PathItem.inject(new function() {
* @return {Number} the winding number * @return {Number} the winding number
*/ */
_getWinding: function(point, horizontal) { _getWinding: function(point, horizontal) {
return getWinding(point, this._getCurves(), horizontal).winding; return getWinding(point, this.getCurves(), horizontal).winding;
}, },
/** /**
@ -962,15 +962,6 @@ PathItem.inject(new function() {
}); });
Path.inject(/** @lends Path# */{ Path.inject(/** @lends Path# */{
/**
* Private method that returns and caches all the curves in this Path,
* which are monotonically decreasing or increasing in the y-direction.
* Used by getWinding().
*/
_getCurves: function() {
return this.getCurves();
},
/** /**
* Returns a point that is guaranteed to be inside the path. * Returns a point that is guaranteed to be inside the path.
* *
@ -1029,23 +1020,4 @@ Path.inject(/** @lends Path# */{
} }
return point; return point;
} }
});
CompoundPath.inject(/** @lends CompoundPath# */{
/**
* Private method that returns all the curves in this CompoundPath, which
* are monotonically decreasing or increasing in the 'y' direction.
* Used by getWinding().
*/
_getCurves: function() {
var children = this._children,
curves = [];
for (var i = 0, l = children.length; i < l; i++)
curves.push.apply(curves, children[i]._getCurves());
return curves;
}
}); });