mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Remove unused Curve#_getWinding() and commented out CompoundPath#_getWinding() code.
This commit is contained in:
parent
cc0f088a11
commit
e6b7e9b2eb
2 changed files with 0 additions and 30 deletions
|
@ -249,14 +249,6 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{
|
|||
return curves;
|
||||
},
|
||||
|
||||
// _getWinding: function(point) {
|
||||
// var children = this._children,
|
||||
// winding = 0;
|
||||
// for (var i = 0, l = children.length; i < l; i++)
|
||||
// winding += children[i]._getWinding(point);
|
||||
// return winding;
|
||||
// },
|
||||
|
||||
_getChildHitTestOptions: function(options) {
|
||||
// If we're not specifically asked to returns paths through
|
||||
// options.type == 'path' do not test children for fill, since a
|
||||
|
|
|
@ -440,28 +440,6 @@ var Curve = Base.extend(/** @lends Curve# */{
|
|||
return '{ ' + parts.join(', ') + ' }';
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the winding contribution of this curve, to the parent path or
|
||||
* CompoundPath it is part of.
|
||||
*/
|
||||
_getWinding: function() {
|
||||
var path = this.getPath();
|
||||
if (!path)
|
||||
// If this curve is not part of a path,
|
||||
// the 'insideness' contribution of this curve is undefined.
|
||||
return null;
|
||||
var v = this.getValues(),
|
||||
point = Curve.evaluate(v, 0.5, 0),
|
||||
// Since we are using curves monotonic in Y direction, horizontal
|
||||
// curves may report wrong winding contribution. See
|
||||
// PathItem#_getWinding for details on how we resolve this issue.
|
||||
tolerance = /*#=*/ Numerical.TOLERANCE,
|
||||
horizontal = (Curve.isLinear(v) && Math.abs(v[1] - v[7]) < tolerance);
|
||||
// Call the parent's _getWinding method
|
||||
return (path._parent instanceof CompoundPath ? path._parent
|
||||
: path)._getWinding(point, horizontal);
|
||||
},
|
||||
|
||||
// Mess with indentation in order to get more line-space below...
|
||||
statics: {
|
||||
getValues: function(segment1, segment2, matrix) {
|
||||
|
|
Loading…
Reference in a new issue