mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Rename Path._getWindingNumber to _getWinding (to reflect the naming of the existing Path#_getWinding).
This commit is contained in:
parent
093aae0836
commit
19d84a8a8d
2 changed files with 7 additions and 8 deletions
|
@ -101,7 +101,7 @@ PathItem.inject(new function() { // FIXME: Is new necessary?
|
|||
random = Math.random,
|
||||
abs = Math.abs,
|
||||
tolerance = /*#=*/ Numerical.TOLERANCE,
|
||||
getWindingNumber = PathItem._getWindingNumber;
|
||||
getWinding = PathItem._getWinding;
|
||||
// Split curves at intersections on both paths.
|
||||
intersections = singlePathOp ? path1.getSelfIntersections(true)
|
||||
: path1.getIntersections(path2, true);
|
||||
|
@ -162,8 +162,7 @@ PathItem.inject(new function() { // FIXME: Is new necessary?
|
|||
point = crv.getPointAt(length);
|
||||
v = crv.getValues();
|
||||
horizontal = (Curve.isLinear(v) && abs(v[1] - v[7]) < tolerance);
|
||||
// PathItem._getWindingNumber
|
||||
windMedian = getWindingNumber(point, monoCurves, horizontal);
|
||||
windMedian = getWinding(point, monoCurves, horizontal);
|
||||
// While subtracting, we need to omit this curve if this
|
||||
// curve is contributing to the second operand and is outside
|
||||
// the first operand.
|
||||
|
|
|
@ -270,8 +270,8 @@ var PathItem = Item.extend(/** @lends PathItem# */{
|
|||
* @return {Number} Winding number.
|
||||
*/
|
||||
_getWinding: function(point, horizontal) {
|
||||
var curves = this._getMonotoneCurves();
|
||||
return PathItem._getWindingNumber(point, curves, horizontal);
|
||||
return PathItem._getWinding(point, this._getMonotoneCurves(),
|
||||
horizontal);
|
||||
},
|
||||
|
||||
_contains: function(point) {
|
||||
|
@ -359,7 +359,7 @@ var PathItem = Item.extend(/** @lends PathItem# */{
|
|||
* Private static method that returns the winding contribution of the
|
||||
* given point with respect to a given set of monotone curves.
|
||||
*/
|
||||
_getWindingNumber: function(point, curves, horizontal) {
|
||||
_getWinding: function _getWinding(point, curves, horizontal) {
|
||||
function getTangent(v, t) {
|
||||
var sign = t === 0 ? 2 : t === 1 ? -2 : 0,
|
||||
tan;
|
||||
|
@ -412,10 +412,10 @@ var PathItem = Item.extend(/** @lends PathItem# */{
|
|||
yTop = (yTop + y) / 2;
|
||||
yBot = (yBot + y) / 2;
|
||||
windLeft = yTop > -Infinity
|
||||
? PathItem._getWindingNumber(new Point(x, yTop), curves)
|
||||
? _getWinding(new Point(x, yTop), curves)
|
||||
: 0;
|
||||
windRight = yBot < Infinity
|
||||
? PathItem._getWindingNumber(new Point(x, yBot), curves)
|
||||
? _getWinding(new Point(x, yBot), curves)
|
||||
: 0;
|
||||
return Math.max(windLeft, windRight);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue