Prebuilt module for commit 50c910b03a

This commit is contained in:
Paper.js Bot 2017-01-06 13:27:00 +00:00
parent d591ff687d
commit ac60d58c39
5 changed files with 71 additions and 50 deletions

View file

@ -9,7 +9,7 @@
* *
* All rights reserved. * All rights reserved.
* *
* Date: Fri Jan 6 12:17:33 2017 +0100 * Date: Fri Jan 6 14:23:27 2017 +0100
* *
*** ***
* *
@ -9957,14 +9957,15 @@ PathItem.inject(new function() {
winding = o0 > o3 ? 1 : -1, winding = o0 > o3 ? 1 : -1,
windingPrev = vPrev[io] > vPrev[io + 6] ? 1 : -1, windingPrev = vPrev[io] > vPrev[io + 6] ? 1 : -1,
a3Prev = vPrev[ia + 6]; a3Prev = vPrev[ia + 6];
if (a >= paL && a <= paR) {
onPath = true;
}
if (po !== o0) { if (po !== o0) {
if (a < paL) { if (a < paL) {
windingL += winding; windingL += winding;
} else if (a > paR) { } else if (a > paR) {
windingR += winding; windingR += winding;
} else {
windingL += winding;
windingR += winding;
onPath = true;
} }
} else if (winding !== windingPrev) { } else if (winding !== windingPrev) {
if (a3Prev < paR) { if (a3Prev < paR) {
@ -10052,6 +10053,11 @@ PathItem.inject(new function() {
if (i + 1 === l || curves[i + 1]._path !== path) { if (i + 1 === l || curves[i + 1]._path !== path) {
if (vClose && (res = handleCurve(vClose))) if (vClose && (res = handleCurve(vClose)))
return res; return res;
if (onPath && !windingL && !windingR) {
var add = path.isClockwise(closed) ^ dir ? 1 : -1;
windingL += add;
windingR += add;
}
vClose = null; vClose = null;
} }
} }
@ -10079,9 +10085,12 @@ PathItem.inject(new function() {
totalLength += length; totalLength += length;
segment = segment.getNext(); segment = segment.getNext();
} while (segment && !segment._intersection && segment !== start); } while (segment && !segment._intersection && segment !== start);
var offsets = [0.48, 0.1, 0.9]; var windingZero = { winding: 0, quality: 0 },
for (var i = 0; (!winding || winding.quality < 0.5) && i < offsets.length; i++) { winding = windingZero,
var length = totalLength * offsets[i]; tMin = 4e-7,
tMax = 1 - tMin;
for (var i = 0; i < 3 && winding.quality < 0.5; i++) {
var length = totalLength * (i + 1) / 4;
for (var j = 0, l = chain.length; j < l; j++) { for (var j = 0, l = chain.length; j < l; j++) {
var entry = chain[j], var entry = chain[j],
curveLength = entry.length; curveLength = entry.length;
@ -10089,23 +10098,21 @@ PathItem.inject(new function() {
var curve = entry.curve, var curve = entry.curve,
path = curve._path, path = curve._path,
parent = path._parent, parent = path._parent,
t = curve.getTimeAt(length), t = Numerical.clamp(curve.getTimeAt(length), tMin, tMax),
pt = curve.getPointAtTime(t), pt = curve.getPointAtTime(t),
dir = abs(curve.getTangentAtTime(t).normalize().y) dir = abs(curve.getTangentAtTime(t).normalize().y)
< Math.SQRT1_2 ? 1 : 0; < Math.SQRT1_2 ? 1 : 0;
if (parent instanceof CompoundPath) if (parent instanceof CompoundPath)
path = parent; path = parent;
var windingNew = !(operator.subtract && path2 && ( var wind = !(operator.subtract && path2 && (
path === path1 && path === path1 &&
path2._getWinding(pt, dir, true).winding || path2._getWinding(pt, dir, true).winding ||
path === path2 && path === path2 &&
!path1._getWinding(pt, dir, true).winding)) !path1._getWinding(pt, dir, true).winding))
? getWinding(pt, curves, dir, true) ? getWinding(pt, curves, dir, true)
: { winding: 0 }; : windingZero;
if (windingNew.winding && if (wind.quality > winding.quality)
(!winding || winding.quality < windingNew.quality)) { winding = wind;
winding = windingNew;
}
break; break;
} }
length -= curveLength; length -= curveLength;

35
dist/paper-core.js vendored
View file

@ -9,7 +9,7 @@
* *
* All rights reserved. * All rights reserved.
* *
* Date: Fri Jan 6 12:17:33 2017 +0100 * Date: Fri Jan 6 14:23:27 2017 +0100
* *
*** ***
* *
@ -9957,14 +9957,15 @@ PathItem.inject(new function() {
winding = o0 > o3 ? 1 : -1, winding = o0 > o3 ? 1 : -1,
windingPrev = vPrev[io] > vPrev[io + 6] ? 1 : -1, windingPrev = vPrev[io] > vPrev[io + 6] ? 1 : -1,
a3Prev = vPrev[ia + 6]; a3Prev = vPrev[ia + 6];
if (a >= paL && a <= paR) {
onPath = true;
}
if (po !== o0) { if (po !== o0) {
if (a < paL) { if (a < paL) {
windingL += winding; windingL += winding;
} else if (a > paR) { } else if (a > paR) {
windingR += winding; windingR += winding;
} else {
windingL += winding;
windingR += winding;
onPath = true;
} }
} else if (winding !== windingPrev) { } else if (winding !== windingPrev) {
if (a3Prev < paR) { if (a3Prev < paR) {
@ -10052,6 +10053,11 @@ PathItem.inject(new function() {
if (i + 1 === l || curves[i + 1]._path !== path) { if (i + 1 === l || curves[i + 1]._path !== path) {
if (vClose && (res = handleCurve(vClose))) if (vClose && (res = handleCurve(vClose)))
return res; return res;
if (onPath && !windingL && !windingR) {
var add = path.isClockwise(closed) ^ dir ? 1 : -1;
windingL += add;
windingR += add;
}
vClose = null; vClose = null;
} }
} }
@ -10079,9 +10085,12 @@ PathItem.inject(new function() {
totalLength += length; totalLength += length;
segment = segment.getNext(); segment = segment.getNext();
} while (segment && !segment._intersection && segment !== start); } while (segment && !segment._intersection && segment !== start);
var offsets = [0.48, 0.1, 0.9]; var windingZero = { winding: 0, quality: 0 },
for (var i = 0; (!winding || winding.quality < 0.5) && i < offsets.length; i++) { winding = windingZero,
var length = totalLength * offsets[i]; tMin = 4e-7,
tMax = 1 - tMin;
for (var i = 0; i < 3 && winding.quality < 0.5; i++) {
var length = totalLength * (i + 1) / 4;
for (var j = 0, l = chain.length; j < l; j++) { for (var j = 0, l = chain.length; j < l; j++) {
var entry = chain[j], var entry = chain[j],
curveLength = entry.length; curveLength = entry.length;
@ -10089,23 +10098,21 @@ PathItem.inject(new function() {
var curve = entry.curve, var curve = entry.curve,
path = curve._path, path = curve._path,
parent = path._parent, parent = path._parent,
t = curve.getTimeAt(length), t = Numerical.clamp(curve.getTimeAt(length), tMin, tMax),
pt = curve.getPointAtTime(t), pt = curve.getPointAtTime(t),
dir = abs(curve.getTangentAtTime(t).normalize().y) dir = abs(curve.getTangentAtTime(t).normalize().y)
< Math.SQRT1_2 ? 1 : 0; < Math.SQRT1_2 ? 1 : 0;
if (parent instanceof CompoundPath) if (parent instanceof CompoundPath)
path = parent; path = parent;
var windingNew = !(operator.subtract && path2 && ( var wind = !(operator.subtract && path2 && (
path === path1 && path === path1 &&
path2._getWinding(pt, dir, true).winding || path2._getWinding(pt, dir, true).winding ||
path === path2 && path === path2 &&
!path1._getWinding(pt, dir, true).winding)) !path1._getWinding(pt, dir, true).winding))
? getWinding(pt, curves, dir, true) ? getWinding(pt, curves, dir, true)
: { winding: 0 }; : windingZero;
if (windingNew.winding && if (wind.quality > winding.quality)
(!winding || winding.quality < windingNew.quality)) { winding = wind;
winding = windingNew;
}
break; break;
} }
length -= curveLength; length -= curveLength;

File diff suppressed because one or more lines are too long

35
dist/paper-full.js vendored
View file

@ -9,7 +9,7 @@
* *
* All rights reserved. * All rights reserved.
* *
* Date: Fri Jan 6 12:17:33 2017 +0100 * Date: Fri Jan 6 14:23:27 2017 +0100
* *
*** ***
* *
@ -9957,14 +9957,15 @@ PathItem.inject(new function() {
winding = o0 > o3 ? 1 : -1, winding = o0 > o3 ? 1 : -1,
windingPrev = vPrev[io] > vPrev[io + 6] ? 1 : -1, windingPrev = vPrev[io] > vPrev[io + 6] ? 1 : -1,
a3Prev = vPrev[ia + 6]; a3Prev = vPrev[ia + 6];
if (a >= paL && a <= paR) {
onPath = true;
}
if (po !== o0) { if (po !== o0) {
if (a < paL) { if (a < paL) {
windingL += winding; windingL += winding;
} else if (a > paR) { } else if (a > paR) {
windingR += winding; windingR += winding;
} else {
windingL += winding;
windingR += winding;
onPath = true;
} }
} else if (winding !== windingPrev) { } else if (winding !== windingPrev) {
if (a3Prev < paR) { if (a3Prev < paR) {
@ -10052,6 +10053,11 @@ PathItem.inject(new function() {
if (i + 1 === l || curves[i + 1]._path !== path) { if (i + 1 === l || curves[i + 1]._path !== path) {
if (vClose && (res = handleCurve(vClose))) if (vClose && (res = handleCurve(vClose)))
return res; return res;
if (onPath && !windingL && !windingR) {
var add = path.isClockwise(closed) ^ dir ? 1 : -1;
windingL += add;
windingR += add;
}
vClose = null; vClose = null;
} }
} }
@ -10079,9 +10085,12 @@ PathItem.inject(new function() {
totalLength += length; totalLength += length;
segment = segment.getNext(); segment = segment.getNext();
} while (segment && !segment._intersection && segment !== start); } while (segment && !segment._intersection && segment !== start);
var offsets = [0.48, 0.1, 0.9]; var windingZero = { winding: 0, quality: 0 },
for (var i = 0; (!winding || winding.quality < 0.5) && i < offsets.length; i++) { winding = windingZero,
var length = totalLength * offsets[i]; tMin = 4e-7,
tMax = 1 - tMin;
for (var i = 0; i < 3 && winding.quality < 0.5; i++) {
var length = totalLength * (i + 1) / 4;
for (var j = 0, l = chain.length; j < l; j++) { for (var j = 0, l = chain.length; j < l; j++) {
var entry = chain[j], var entry = chain[j],
curveLength = entry.length; curveLength = entry.length;
@ -10089,23 +10098,21 @@ PathItem.inject(new function() {
var curve = entry.curve, var curve = entry.curve,
path = curve._path, path = curve._path,
parent = path._parent, parent = path._parent,
t = curve.getTimeAt(length), t = Numerical.clamp(curve.getTimeAt(length), tMin, tMax),
pt = curve.getPointAtTime(t), pt = curve.getPointAtTime(t),
dir = abs(curve.getTangentAtTime(t).normalize().y) dir = abs(curve.getTangentAtTime(t).normalize().y)
< Math.SQRT1_2 ? 1 : 0; < Math.SQRT1_2 ? 1 : 0;
if (parent instanceof CompoundPath) if (parent instanceof CompoundPath)
path = parent; path = parent;
var windingNew = !(operator.subtract && path2 && ( var wind = !(operator.subtract && path2 && (
path === path1 && path === path1 &&
path2._getWinding(pt, dir, true).winding || path2._getWinding(pt, dir, true).winding ||
path === path2 && path === path2 &&
!path1._getWinding(pt, dir, true).winding)) !path1._getWinding(pt, dir, true).winding))
? getWinding(pt, curves, dir, true) ? getWinding(pt, curves, dir, true)
: { winding: 0 }; : windingZero;
if (windingNew.winding && if (wind.quality > winding.quality)
(!winding || winding.quality < windingNew.quality)) { winding = wind;
winding = windingNew;
}
break; break;
} }
length -= curveLength; length -= curveLength;

File diff suppressed because one or more lines are too long