mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Prebuilt module for commit 648beb33e9
This commit is contained in:
parent
5c5c387c53
commit
f6d1bf08b4
5 changed files with 53 additions and 38 deletions
25
dist/docs/assets/js/paper.js
vendored
25
dist/docs/assets/js/paper.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Fri Jun 10 12:33:44 2016 +0200
|
* Date: Fri Jun 10 13:04:57 2016 +0200
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -9588,7 +9588,7 @@ PathItem.inject(new function() {
|
||||||
return results || locations;
|
return results || locations;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWinding(point, curves, horizontal) {
|
function getWinding(point, curves, operator, horizontal) {
|
||||||
var epsilon = 2e-7,
|
var epsilon = 2e-7,
|
||||||
px = point.x,
|
px = point.x,
|
||||||
py = point.y,
|
py = point.y,
|
||||||
|
@ -9617,9 +9617,9 @@ PathItem.inject(new function() {
|
||||||
yTop = (yTop + py) / 2;
|
yTop = (yTop + py) / 2;
|
||||||
yBottom = (yBottom + py) / 2;
|
yBottom = (yBottom + py) / 2;
|
||||||
if (yTop > -Infinity)
|
if (yTop > -Infinity)
|
||||||
windLeft = getWinding(new Point(px, yTop), curves);
|
windLeft = getWinding(new Point(px, yTop), curves, operator);
|
||||||
if (yBottom < Infinity)
|
if (yBottom < Infinity)
|
||||||
windRight = getWinding(new Point(px, yBottom), curves);
|
windRight = getWinding(new Point(px, yBottom), curves, operator);
|
||||||
} else {
|
} else {
|
||||||
var xBefore = px - epsilon,
|
var xBefore = px - epsilon,
|
||||||
xAfter = px + epsilon,
|
xAfter = px + epsilon,
|
||||||
|
@ -9676,7 +9676,8 @@ PathItem.inject(new function() {
|
||||||
windRight = windRightOnCurve;
|
windRight = windRightOnCurve;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Math.max(abs(windLeft), abs(windRight));
|
return operator && operator.unite && !windLeft ^ !windRight ? 1
|
||||||
|
: Math.max(abs(windLeft), abs(windRight));
|
||||||
}
|
}
|
||||||
|
|
||||||
function propagateWinding(segment, path1, path2, monoCurves, operator) {
|
function propagateWinding(segment, path1, path2, monoCurves, operator) {
|
||||||
|
@ -9707,9 +9708,12 @@ PathItem.inject(new function() {
|
||||||
if (parent instanceof CompoundPath)
|
if (parent instanceof CompoundPath)
|
||||||
path = parent;
|
path = parent;
|
||||||
if (!(operator.subtract && path2
|
if (!(operator.subtract && path2
|
||||||
&& (path === path1 && path2._getWinding(pt, hor)
|
&& (path === path1
|
||||||
|| path === path2 && !path1._getWinding(pt, hor))))
|
&& path2._getWinding(pt, operator, hor)
|
||||||
windingSum += getWinding(pt, monoCurves, hor);
|
|| path === path2
|
||||||
|
&& !path1._getWinding(pt, operator, hor)))) {
|
||||||
|
windingSum += getWinding(pt, monoCurves, operator, hor);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
length -= curveLength;
|
length -= curveLength;
|
||||||
|
@ -9839,8 +9843,9 @@ PathItem.inject(new function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
_getWinding: function(point, horizontal) {
|
_getWinding: function(point, operator, horizontal) {
|
||||||
return getWinding(point, this._getMonoCurves(), horizontal);
|
return getWinding(point, this._getMonoCurves(), operator,
|
||||||
|
horizontal);
|
||||||
},
|
},
|
||||||
|
|
||||||
unite: function(path) {
|
unite: function(path) {
|
||||||
|
|
25
dist/paper-core.js
vendored
25
dist/paper-core.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Fri Jun 10 12:33:44 2016 +0200
|
* Date: Fri Jun 10 13:04:57 2016 +0200
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -9588,7 +9588,7 @@ PathItem.inject(new function() {
|
||||||
return results || locations;
|
return results || locations;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWinding(point, curves, horizontal) {
|
function getWinding(point, curves, operator, horizontal) {
|
||||||
var epsilon = 2e-7,
|
var epsilon = 2e-7,
|
||||||
px = point.x,
|
px = point.x,
|
||||||
py = point.y,
|
py = point.y,
|
||||||
|
@ -9617,9 +9617,9 @@ PathItem.inject(new function() {
|
||||||
yTop = (yTop + py) / 2;
|
yTop = (yTop + py) / 2;
|
||||||
yBottom = (yBottom + py) / 2;
|
yBottom = (yBottom + py) / 2;
|
||||||
if (yTop > -Infinity)
|
if (yTop > -Infinity)
|
||||||
windLeft = getWinding(new Point(px, yTop), curves);
|
windLeft = getWinding(new Point(px, yTop), curves, operator);
|
||||||
if (yBottom < Infinity)
|
if (yBottom < Infinity)
|
||||||
windRight = getWinding(new Point(px, yBottom), curves);
|
windRight = getWinding(new Point(px, yBottom), curves, operator);
|
||||||
} else {
|
} else {
|
||||||
var xBefore = px - epsilon,
|
var xBefore = px - epsilon,
|
||||||
xAfter = px + epsilon,
|
xAfter = px + epsilon,
|
||||||
|
@ -9676,7 +9676,8 @@ PathItem.inject(new function() {
|
||||||
windRight = windRightOnCurve;
|
windRight = windRightOnCurve;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Math.max(abs(windLeft), abs(windRight));
|
return operator && operator.unite && !windLeft ^ !windRight ? 1
|
||||||
|
: Math.max(abs(windLeft), abs(windRight));
|
||||||
}
|
}
|
||||||
|
|
||||||
function propagateWinding(segment, path1, path2, monoCurves, operator) {
|
function propagateWinding(segment, path1, path2, monoCurves, operator) {
|
||||||
|
@ -9707,9 +9708,12 @@ PathItem.inject(new function() {
|
||||||
if (parent instanceof CompoundPath)
|
if (parent instanceof CompoundPath)
|
||||||
path = parent;
|
path = parent;
|
||||||
if (!(operator.subtract && path2
|
if (!(operator.subtract && path2
|
||||||
&& (path === path1 && path2._getWinding(pt, hor)
|
&& (path === path1
|
||||||
|| path === path2 && !path1._getWinding(pt, hor))))
|
&& path2._getWinding(pt, operator, hor)
|
||||||
windingSum += getWinding(pt, monoCurves, hor);
|
|| path === path2
|
||||||
|
&& !path1._getWinding(pt, operator, hor)))) {
|
||||||
|
windingSum += getWinding(pt, monoCurves, operator, hor);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
length -= curveLength;
|
length -= curveLength;
|
||||||
|
@ -9839,8 +9843,9 @@ PathItem.inject(new function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
_getWinding: function(point, horizontal) {
|
_getWinding: function(point, operator, horizontal) {
|
||||||
return getWinding(point, this._getMonoCurves(), horizontal);
|
return getWinding(point, this._getMonoCurves(), operator,
|
||||||
|
horizontal);
|
||||||
},
|
},
|
||||||
|
|
||||||
unite: function(path) {
|
unite: function(path) {
|
||||||
|
|
8
dist/paper-core.min.js
vendored
8
dist/paper-core.min.js
vendored
File diff suppressed because one or more lines are too long
25
dist/paper-full.js
vendored
25
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Date: Fri Jun 10 12:33:44 2016 +0200
|
* Date: Fri Jun 10 13:04:57 2016 +0200
|
||||||
*
|
*
|
||||||
***
|
***
|
||||||
*
|
*
|
||||||
|
@ -9588,7 +9588,7 @@ PathItem.inject(new function() {
|
||||||
return results || locations;
|
return results || locations;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWinding(point, curves, horizontal) {
|
function getWinding(point, curves, operator, horizontal) {
|
||||||
var epsilon = 2e-7,
|
var epsilon = 2e-7,
|
||||||
px = point.x,
|
px = point.x,
|
||||||
py = point.y,
|
py = point.y,
|
||||||
|
@ -9617,9 +9617,9 @@ PathItem.inject(new function() {
|
||||||
yTop = (yTop + py) / 2;
|
yTop = (yTop + py) / 2;
|
||||||
yBottom = (yBottom + py) / 2;
|
yBottom = (yBottom + py) / 2;
|
||||||
if (yTop > -Infinity)
|
if (yTop > -Infinity)
|
||||||
windLeft = getWinding(new Point(px, yTop), curves);
|
windLeft = getWinding(new Point(px, yTop), curves, operator);
|
||||||
if (yBottom < Infinity)
|
if (yBottom < Infinity)
|
||||||
windRight = getWinding(new Point(px, yBottom), curves);
|
windRight = getWinding(new Point(px, yBottom), curves, operator);
|
||||||
} else {
|
} else {
|
||||||
var xBefore = px - epsilon,
|
var xBefore = px - epsilon,
|
||||||
xAfter = px + epsilon,
|
xAfter = px + epsilon,
|
||||||
|
@ -9676,7 +9676,8 @@ PathItem.inject(new function() {
|
||||||
windRight = windRightOnCurve;
|
windRight = windRightOnCurve;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Math.max(abs(windLeft), abs(windRight));
|
return operator && operator.unite && !windLeft ^ !windRight ? 1
|
||||||
|
: Math.max(abs(windLeft), abs(windRight));
|
||||||
}
|
}
|
||||||
|
|
||||||
function propagateWinding(segment, path1, path2, monoCurves, operator) {
|
function propagateWinding(segment, path1, path2, monoCurves, operator) {
|
||||||
|
@ -9707,9 +9708,12 @@ PathItem.inject(new function() {
|
||||||
if (parent instanceof CompoundPath)
|
if (parent instanceof CompoundPath)
|
||||||
path = parent;
|
path = parent;
|
||||||
if (!(operator.subtract && path2
|
if (!(operator.subtract && path2
|
||||||
&& (path === path1 && path2._getWinding(pt, hor)
|
&& (path === path1
|
||||||
|| path === path2 && !path1._getWinding(pt, hor))))
|
&& path2._getWinding(pt, operator, hor)
|
||||||
windingSum += getWinding(pt, monoCurves, hor);
|
|| path === path2
|
||||||
|
&& !path1._getWinding(pt, operator, hor)))) {
|
||||||
|
windingSum += getWinding(pt, monoCurves, operator, hor);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
length -= curveLength;
|
length -= curveLength;
|
||||||
|
@ -9839,8 +9843,9 @@ PathItem.inject(new function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
_getWinding: function(point, horizontal) {
|
_getWinding: function(point, operator, horizontal) {
|
||||||
return getWinding(point, this._getMonoCurves(), horizontal);
|
return getWinding(point, this._getMonoCurves(), operator,
|
||||||
|
horizontal);
|
||||||
},
|
},
|
||||||
|
|
||||||
unite: function(path) {
|
unite: function(path) {
|
||||||
|
|
8
dist/paper-full.min.js
vendored
8
dist/paper-full.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue