Skip to content

Commit

Permalink
Some comment cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
lehni committed Feb 5, 2016
1 parent 5a46620 commit ffe42a0
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/path/PathItem.Boolean.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,18 +306,18 @@ PathItem.inject(new function() {

/**
* Private method that returns the winding contribution of the given point
* with respect to a given set of monotone curves.
* with respect to a given set of monotonic curves.
*/
function getWinding(point, curves, horizontal) {
var epsilon = /*#=*/Numerical.WINDING_EPSILON,
px = point.x,
py = point.y,
windLeft = 0,
windRight = 0,
isOnCurve = false,
length = curves.length,
roots = [],
abs = Math.abs,
isOnCurve = false;
abs = Math.abs;
// Horizontal curves may return wrong results, since the curves are
// monotonic in y direction and this is an indeterminate state.
if (horizontal) {
Expand Down Expand Up @@ -357,20 +357,19 @@ PathItem.inject(new function() {
values = curve.values,
yStart = values[1],
yEnd = values[7];
// The first curve of a loop holds the last curve with
// non-zero winding.
// Retrieve and use it here (See _getMonoCurve()).
// The first curve of a loop holds the last curve with non-zero
// winding. Retrieve and use it here (See _getMonoCurve()).
if (curve.last) {
// Get the end x coordinate and winding of the last
// non-horizontal curve, which will be the previous
// non-horizontal curve for the first curve in the loop.
prevWinding = curve.last.winding;
prevXEnd = curve.last.values[6];
}
// Since the curves are monotone in y direction, we can just
// compare the endpoints of the curve to determine if the
// ray from query point along +-x direction will intersect
// the monotone curve.
// Since the curves are monotonic in y direction, we can just
// compare the endpoints of the curve to determine if the ray
// from query point along +-x direction will intersect the
// monotonic curve.
if (py >= yStart && py <= yEnd || py >= yEnd && py <= yStart) {
if (winding) {
// Calculate the x value for the ray's intersection.
Expand Down Expand Up @@ -925,7 +924,7 @@ Path.inject(/** @lends Path# */{
if (Curve.isStraight(v)
|| y0 >= y1 === y1 >= y2 && y1 >= y2 === y2 >= y3) {
// Straight curves and curves with end and control points sorted
// in y direction are guaranteed to be monotone in y direction.
// in y direction are guaranteed to be monotonic in y direction.
insertCurve(v);
} else {
// Split the curve at y extrema, to get bezier curves with clear
Expand Down

0 comments on commit ffe42a0

Please sign in to comment.