mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Prebuilt module for commit 15e00e0b99
This commit is contained in:
parent
e6900bae62
commit
8be5219914
6 changed files with 51 additions and 39 deletions
18
dist/docs/assets/js/paper.js
vendored
18
dist/docs/assets/js/paper.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Sat Jun 22 18:48:16 2019 +0200
|
||||
* Date: Sat Jun 22 23:05:50 2019 +0200
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -1043,6 +1043,10 @@ var Numerical = new function() {
|
|||
return val >= -EPSILON && val <= EPSILON;
|
||||
},
|
||||
|
||||
isMachineZero: function(val) {
|
||||
return val >= -MACHINE_EPSILON && val <= MACHINE_EPSILON;
|
||||
},
|
||||
|
||||
clamp: clamp,
|
||||
|
||||
integrate: function(f, a, b, n) {
|
||||
|
@ -2626,7 +2630,7 @@ var Line = Base.extend({
|
|||
v2y -= p2y;
|
||||
}
|
||||
var cross = v1x * v2y - v1y * v2x;
|
||||
if (!Numerical.isZero(cross)) {
|
||||
if (!Numerical.isMachineZero(cross)) {
|
||||
var dx = p1x - p2x,
|
||||
dy = p1y - p2y,
|
||||
u1 = (v2x * dy - v2y * dx) / cross,
|
||||
|
@ -2654,7 +2658,7 @@ var Line = Base.extend({
|
|||
var v2x = x - px,
|
||||
v2y = y - py,
|
||||
ccw = v2x * vy - v2y * vx;
|
||||
if (!isInfinite && Numerical.isZero(ccw)) {
|
||||
if (!isInfinite && Numerical.isMachineZero(ccw)) {
|
||||
ccw = (v2x * vx + v2x * vx) / (vx * vx + vy * vy);
|
||||
if (ccw >= 0 && ccw <= 1)
|
||||
ccw = 0;
|
||||
|
@ -7284,7 +7288,7 @@ new function() {
|
|||
return locations;
|
||||
}
|
||||
|
||||
function getLoopIntersection(v1, c1, locations, include) {
|
||||
function getSelfIntersection(v1, c1, locations, include) {
|
||||
var info = Curve.classify(v1);
|
||||
if (info.type === 'loop') {
|
||||
var roots = info.roots;
|
||||
|
@ -7318,7 +7322,7 @@ new function() {
|
|||
arrays.push(locations);
|
||||
}
|
||||
if (self) {
|
||||
getLoopIntersection(values1, curve1, locations, include);
|
||||
getSelfIntersection(values1, curve1, locations, include);
|
||||
}
|
||||
for (var j = self ? i + 1 : 0; j < length2; j++) {
|
||||
if (_returnFirst && locations.length)
|
||||
|
@ -7448,7 +7452,7 @@ new function() {
|
|||
var v1 = this.getValues(),
|
||||
v2 = curve && curve !== this && curve.getValues();
|
||||
return v2 ? getCurveIntersections(v1, v2, this, curve, [])
|
||||
: getLoopIntersection(v1, this, []);
|
||||
: getSelfIntersection(v1, this, []);
|
||||
},
|
||||
|
||||
statics: {
|
||||
|
@ -11144,7 +11148,7 @@ var PathFitter = Base.extend({
|
|||
pt2 = this.evaluate(1, curve2, u),
|
||||
diff = pt.subtract(point),
|
||||
df = pt1.dot(pt1) + diff.dot(pt2);
|
||||
return Numerical.isZero(df) ? u : u - diff.dot(pt1) / df;
|
||||
return Numerical.isMachineZero(df) ? u : u - diff.dot(pt1) / df;
|
||||
},
|
||||
|
||||
evaluate: function(degree, curve, t) {
|
||||
|
|
18
dist/paper-core.js
vendored
18
dist/paper-core.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Sat Jun 22 18:48:16 2019 +0200
|
||||
* Date: Sat Jun 22 23:05:50 2019 +0200
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -1040,6 +1040,10 @@ var Numerical = new function() {
|
|||
return val >= -EPSILON && val <= EPSILON;
|
||||
},
|
||||
|
||||
isMachineZero: function(val) {
|
||||
return val >= -MACHINE_EPSILON && val <= MACHINE_EPSILON;
|
||||
},
|
||||
|
||||
clamp: clamp,
|
||||
|
||||
integrate: function(f, a, b, n) {
|
||||
|
@ -2623,7 +2627,7 @@ var Line = Base.extend({
|
|||
v2y -= p2y;
|
||||
}
|
||||
var cross = v1x * v2y - v1y * v2x;
|
||||
if (!Numerical.isZero(cross)) {
|
||||
if (!Numerical.isMachineZero(cross)) {
|
||||
var dx = p1x - p2x,
|
||||
dy = p1y - p2y,
|
||||
u1 = (v2x * dy - v2y * dx) / cross,
|
||||
|
@ -2651,7 +2655,7 @@ var Line = Base.extend({
|
|||
var v2x = x - px,
|
||||
v2y = y - py,
|
||||
ccw = v2x * vy - v2y * vx;
|
||||
if (!isInfinite && Numerical.isZero(ccw)) {
|
||||
if (!isInfinite && Numerical.isMachineZero(ccw)) {
|
||||
ccw = (v2x * vx + v2x * vx) / (vx * vx + vy * vy);
|
||||
if (ccw >= 0 && ccw <= 1)
|
||||
ccw = 0;
|
||||
|
@ -7281,7 +7285,7 @@ new function() {
|
|||
return locations;
|
||||
}
|
||||
|
||||
function getLoopIntersection(v1, c1, locations, include) {
|
||||
function getSelfIntersection(v1, c1, locations, include) {
|
||||
var info = Curve.classify(v1);
|
||||
if (info.type === 'loop') {
|
||||
var roots = info.roots;
|
||||
|
@ -7315,7 +7319,7 @@ new function() {
|
|||
arrays.push(locations);
|
||||
}
|
||||
if (self) {
|
||||
getLoopIntersection(values1, curve1, locations, include);
|
||||
getSelfIntersection(values1, curve1, locations, include);
|
||||
}
|
||||
for (var j = self ? i + 1 : 0; j < length2; j++) {
|
||||
if (_returnFirst && locations.length)
|
||||
|
@ -7445,7 +7449,7 @@ new function() {
|
|||
var v1 = this.getValues(),
|
||||
v2 = curve && curve !== this && curve.getValues();
|
||||
return v2 ? getCurveIntersections(v1, v2, this, curve, [])
|
||||
: getLoopIntersection(v1, this, []);
|
||||
: getSelfIntersection(v1, this, []);
|
||||
},
|
||||
|
||||
statics: {
|
||||
|
@ -11141,7 +11145,7 @@ var PathFitter = Base.extend({
|
|||
pt2 = this.evaluate(1, curve2, u),
|
||||
diff = pt.subtract(point),
|
||||
df = pt1.dot(pt1) + diff.dot(pt2);
|
||||
return Numerical.isZero(df) ? u : u - diff.dot(pt1) / df;
|
||||
return Numerical.isMachineZero(df) ? u : u - diff.dot(pt1) / df;
|
||||
},
|
||||
|
||||
evaluate: function(degree, curve, t) {
|
||||
|
|
16
dist/paper-core.min.js
vendored
16
dist/paper-core.min.js
vendored
File diff suppressed because one or more lines are too long
18
dist/paper-full.js
vendored
18
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Sat Jun 22 18:48:16 2019 +0200
|
||||
* Date: Sat Jun 22 23:05:50 2019 +0200
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -1043,6 +1043,10 @@ var Numerical = new function() {
|
|||
return val >= -EPSILON && val <= EPSILON;
|
||||
},
|
||||
|
||||
isMachineZero: function(val) {
|
||||
return val >= -MACHINE_EPSILON && val <= MACHINE_EPSILON;
|
||||
},
|
||||
|
||||
clamp: clamp,
|
||||
|
||||
integrate: function(f, a, b, n) {
|
||||
|
@ -2626,7 +2630,7 @@ var Line = Base.extend({
|
|||
v2y -= p2y;
|
||||
}
|
||||
var cross = v1x * v2y - v1y * v2x;
|
||||
if (!Numerical.isZero(cross)) {
|
||||
if (!Numerical.isMachineZero(cross)) {
|
||||
var dx = p1x - p2x,
|
||||
dy = p1y - p2y,
|
||||
u1 = (v2x * dy - v2y * dx) / cross,
|
||||
|
@ -2654,7 +2658,7 @@ var Line = Base.extend({
|
|||
var v2x = x - px,
|
||||
v2y = y - py,
|
||||
ccw = v2x * vy - v2y * vx;
|
||||
if (!isInfinite && Numerical.isZero(ccw)) {
|
||||
if (!isInfinite && Numerical.isMachineZero(ccw)) {
|
||||
ccw = (v2x * vx + v2x * vx) / (vx * vx + vy * vy);
|
||||
if (ccw >= 0 && ccw <= 1)
|
||||
ccw = 0;
|
||||
|
@ -7284,7 +7288,7 @@ new function() {
|
|||
return locations;
|
||||
}
|
||||
|
||||
function getLoopIntersection(v1, c1, locations, include) {
|
||||
function getSelfIntersection(v1, c1, locations, include) {
|
||||
var info = Curve.classify(v1);
|
||||
if (info.type === 'loop') {
|
||||
var roots = info.roots;
|
||||
|
@ -7318,7 +7322,7 @@ new function() {
|
|||
arrays.push(locations);
|
||||
}
|
||||
if (self) {
|
||||
getLoopIntersection(values1, curve1, locations, include);
|
||||
getSelfIntersection(values1, curve1, locations, include);
|
||||
}
|
||||
for (var j = self ? i + 1 : 0; j < length2; j++) {
|
||||
if (_returnFirst && locations.length)
|
||||
|
@ -7448,7 +7452,7 @@ new function() {
|
|||
var v1 = this.getValues(),
|
||||
v2 = curve && curve !== this && curve.getValues();
|
||||
return v2 ? getCurveIntersections(v1, v2, this, curve, [])
|
||||
: getLoopIntersection(v1, this, []);
|
||||
: getSelfIntersection(v1, this, []);
|
||||
},
|
||||
|
||||
statics: {
|
||||
|
@ -11144,7 +11148,7 @@ var PathFitter = Base.extend({
|
|||
pt2 = this.evaluate(1, curve2, u),
|
||||
diff = pt.subtract(point),
|
||||
df = pt1.dot(pt1) + diff.dot(pt2);
|
||||
return Numerical.isZero(df) ? u : u - diff.dot(pt1) / df;
|
||||
return Numerical.isMachineZero(df) ? u : u - diff.dot(pt1) / df;
|
||||
},
|
||||
|
||||
evaluate: function(degree, curve, t) {
|
||||
|
|
18
dist/paper-full.min.js
vendored
18
dist/paper-full.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/paper.d.ts
vendored
2
dist/paper.d.ts
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Sat Jun 22 18:48:16 2019 +0200
|
||||
* Date: Sat Jun 22 23:05:50 2019 +0200
|
||||
*
|
||||
* This is an auto-generated type definition.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue