Prebuilt module for commit 53269ab169

This commit is contained in:
Paper.js Bot 2016-02-02 20:47:37 +00:00
parent a069f9bfee
commit 4dceb6a9ba
5 changed files with 109 additions and 127 deletions

View file

@ -9,7 +9,7 @@
* *
* All rights reserved. * All rights reserved.
* *
* Date: Tue Feb 2 21:43:44 2016 +0100 * Date: Tue Feb 2 21:45:04 2016 +0100
* *
*** ***
* *
@ -9383,45 +9383,41 @@ PathItem.inject(new function() {
} else { } else {
var xBefore = px - epsilon, var xBefore = px - epsilon,
xAfter = px + epsilon, xAfter = px + epsilon,
start, prevWinding,
end = 0; prevXEnd;
while (end < length) { for (var i = 0; i < length; i++) {
start = end; var curve = curves[i],
var curve = curves[start], winding = curve.winding,
last = curve.last, values = curve.values,
prevWinding = last.winding, yStart = values[1],
prevXEnd = last.values[6]; yEnd = values[7];
end = start + curve.length; if (curve.last) {
for (var i = start; i < end; i++) { prevWinding = curve.last.winding;
var curve = curves[i], prevXEnd = curve.last.values[6];
winding = curve.winding, }
values = curve.values, if (winding && (py >= yStart && py <= yEnd
yStart = values[1], || py >= yEnd && py <= yStart)) {
yEnd = values[7]; var x = py === yStart ? values[0]
if (winding && (py >= yStart && py <= yEnd : py === yEnd ? values[6]
|| py >= yEnd && py <= yStart)) { : Curve.solveCubic(values, 1, py, roots, 0, 1) === 1
var x = py === yStart ? values[0] ? Curve.getPoint(values, roots[0]).x
: py === yEnd ? values[6] : null;
: Curve.solveCubic(values, 1, py, roots, 0, 1) === 1 if (x != null) {
? Curve.getPoint(values, roots[0]).x var isWindingChange = winding === -prevWinding;
: null; if (py !== yStart || isWindingChange
if (x != null) { || (x - px) * (prevXEnd - px) < 0) {
var isWindingChange = winding === -prevWinding; if (x < xBefore) {
if (py !== yStart || isWindingChange windLeft += winding;
|| (x - px) * (prevXEnd - px) < 0) { } else if (x > xAfter) {
if (x < xBefore) { windRight += winding;
windLeft += winding; } else if (py === yStart && isWindingChange) {
} else if (x > xAfter) { ++windLeft;
windRight += winding; ++windRight;
} else if (py === yStart && isWindingChange) {
++windLeft;
++windRight;
}
} }
} }
prevWinding = winding;
prevXEnd = values[6];
} }
prevWinding = winding;
prevXEnd = values[6];
} }
} }
} }
@ -9777,9 +9773,7 @@ Path.inject({
handleCurve([p1x, p1y, p1x, p1y, p2x, p2y, p2x, p2y]); handleCurve([p1x, p1y, p1x, p1y, p2x, p2y, p2x, p2y]);
} }
if (monoCurves.length > 0) { if (monoCurves.length > 0) {
var first = monoCurves[0]; monoCurves[0].last = last;
first.length = monoCurves.length;
first.last = last;
} }
} }
return monoCurves; return monoCurves;

74
dist/paper-core.js vendored
View file

@ -9,7 +9,7 @@
* *
* All rights reserved. * All rights reserved.
* *
* Date: Tue Feb 2 21:43:44 2016 +0100 * Date: Tue Feb 2 21:45:04 2016 +0100
* *
*** ***
* *
@ -9383,45 +9383,41 @@ PathItem.inject(new function() {
} else { } else {
var xBefore = px - epsilon, var xBefore = px - epsilon,
xAfter = px + epsilon, xAfter = px + epsilon,
start, prevWinding,
end = 0; prevXEnd;
while (end < length) { for (var i = 0; i < length; i++) {
start = end; var curve = curves[i],
var curve = curves[start], winding = curve.winding,
last = curve.last, values = curve.values,
prevWinding = last.winding, yStart = values[1],
prevXEnd = last.values[6]; yEnd = values[7];
end = start + curve.length; if (curve.last) {
for (var i = start; i < end; i++) { prevWinding = curve.last.winding;
var curve = curves[i], prevXEnd = curve.last.values[6];
winding = curve.winding, }
values = curve.values, if (winding && (py >= yStart && py <= yEnd
yStart = values[1], || py >= yEnd && py <= yStart)) {
yEnd = values[7]; var x = py === yStart ? values[0]
if (winding && (py >= yStart && py <= yEnd : py === yEnd ? values[6]
|| py >= yEnd && py <= yStart)) { : Curve.solveCubic(values, 1, py, roots, 0, 1) === 1
var x = py === yStart ? values[0] ? Curve.getPoint(values, roots[0]).x
: py === yEnd ? values[6] : null;
: Curve.solveCubic(values, 1, py, roots, 0, 1) === 1 if (x != null) {
? Curve.getPoint(values, roots[0]).x var isWindingChange = winding === -prevWinding;
: null; if (py !== yStart || isWindingChange
if (x != null) { || (x - px) * (prevXEnd - px) < 0) {
var isWindingChange = winding === -prevWinding; if (x < xBefore) {
if (py !== yStart || isWindingChange windLeft += winding;
|| (x - px) * (prevXEnd - px) < 0) { } else if (x > xAfter) {
if (x < xBefore) { windRight += winding;
windLeft += winding; } else if (py === yStart && isWindingChange) {
} else if (x > xAfter) { ++windLeft;
windRight += winding; ++windRight;
} else if (py === yStart && isWindingChange) {
++windLeft;
++windRight;
}
} }
} }
prevWinding = winding;
prevXEnd = values[6];
} }
prevWinding = winding;
prevXEnd = values[6];
} }
} }
} }
@ -9777,9 +9773,7 @@ Path.inject({
handleCurve([p1x, p1y, p1x, p1y, p2x, p2y, p2x, p2y]); handleCurve([p1x, p1y, p1x, p1y, p2x, p2y, p2x, p2y]);
} }
if (monoCurves.length > 0) { if (monoCurves.length > 0) {
var first = monoCurves[0]; monoCurves[0].last = last;
first.length = monoCurves.length;
first.last = last;
} }
} }
return monoCurves; return monoCurves;

File diff suppressed because one or more lines are too long

74
dist/paper-full.js vendored
View file

@ -9,7 +9,7 @@
* *
* All rights reserved. * All rights reserved.
* *
* Date: Tue Feb 2 21:43:44 2016 +0100 * Date: Tue Feb 2 21:45:04 2016 +0100
* *
*** ***
* *
@ -9383,45 +9383,41 @@ PathItem.inject(new function() {
} else { } else {
var xBefore = px - epsilon, var xBefore = px - epsilon,
xAfter = px + epsilon, xAfter = px + epsilon,
start, prevWinding,
end = 0; prevXEnd;
while (end < length) { for (var i = 0; i < length; i++) {
start = end; var curve = curves[i],
var curve = curves[start], winding = curve.winding,
last = curve.last, values = curve.values,
prevWinding = last.winding, yStart = values[1],
prevXEnd = last.values[6]; yEnd = values[7];
end = start + curve.length; if (curve.last) {
for (var i = start; i < end; i++) { prevWinding = curve.last.winding;
var curve = curves[i], prevXEnd = curve.last.values[6];
winding = curve.winding, }
values = curve.values, if (winding && (py >= yStart && py <= yEnd
yStart = values[1], || py >= yEnd && py <= yStart)) {
yEnd = values[7]; var x = py === yStart ? values[0]
if (winding && (py >= yStart && py <= yEnd : py === yEnd ? values[6]
|| py >= yEnd && py <= yStart)) { : Curve.solveCubic(values, 1, py, roots, 0, 1) === 1
var x = py === yStart ? values[0] ? Curve.getPoint(values, roots[0]).x
: py === yEnd ? values[6] : null;
: Curve.solveCubic(values, 1, py, roots, 0, 1) === 1 if (x != null) {
? Curve.getPoint(values, roots[0]).x var isWindingChange = winding === -prevWinding;
: null; if (py !== yStart || isWindingChange
if (x != null) { || (x - px) * (prevXEnd - px) < 0) {
var isWindingChange = winding === -prevWinding; if (x < xBefore) {
if (py !== yStart || isWindingChange windLeft += winding;
|| (x - px) * (prevXEnd - px) < 0) { } else if (x > xAfter) {
if (x < xBefore) { windRight += winding;
windLeft += winding; } else if (py === yStart && isWindingChange) {
} else if (x > xAfter) { ++windLeft;
windRight += winding; ++windRight;
} else if (py === yStart && isWindingChange) {
++windLeft;
++windRight;
}
} }
} }
prevWinding = winding;
prevXEnd = values[6];
} }
prevWinding = winding;
prevXEnd = values[6];
} }
} }
} }
@ -9777,9 +9773,7 @@ Path.inject({
handleCurve([p1x, p1y, p1x, p1y, p2x, p2y, p2x, p2y]); handleCurve([p1x, p1y, p1x, p1y, p2x, p2y, p2x, p2y]);
} }
if (monoCurves.length > 0) { if (monoCurves.length > 0) {
var first = monoCurves[0]; monoCurves[0].last = last;
first.length = monoCurves.length;
first.last = last;
} }
} }
return monoCurves; return monoCurves;

File diff suppressed because one or more lines are too long