From 19d84a8a8dab8b1ba6fb5c10503b05f0bba631aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 19 Feb 2014 15:46:28 +0100 Subject: [PATCH] Rename Path._getWindingNumber to _getWinding (to reflect the naming of the existing Path#_getWinding). --- src/path/PathItem.Boolean.js | 5 ++--- src/path/PathItem.js | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/path/PathItem.Boolean.js b/src/path/PathItem.Boolean.js index 8f160159..b45fdbfa 100644 --- a/src/path/PathItem.Boolean.js +++ b/src/path/PathItem.Boolean.js @@ -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. diff --git a/src/path/PathItem.js b/src/path/PathItem.js index 476bc3ea..2328d7b6 100644 --- a/src/path/PathItem.js +++ b/src/path/PathItem.js @@ -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); }