@leafer-game/worker 1.12.1 → 1.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/worker.js +225 -138
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +232 -138
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +12 -12
package/dist/worker.module.js
CHANGED
|
@@ -461,9 +461,9 @@ function getMatrixData() {
|
|
|
461
461
|
|
|
462
462
|
const {sin: sin$6, cos: cos$6, acos: acos, sqrt: sqrt$5} = Math;
|
|
463
463
|
|
|
464
|
-
const {float: float$
|
|
464
|
+
const {float: float$5} = MathHelper;
|
|
465
465
|
|
|
466
|
-
const tempPoint$
|
|
466
|
+
const tempPoint$5 = {};
|
|
467
467
|
|
|
468
468
|
function getWorld() {
|
|
469
469
|
return Object.assign(Object.assign(Object.assign({}, getMatrixData()), getBoundsData()), {
|
|
@@ -522,8 +522,8 @@ const MatrixHelper = {
|
|
|
522
522
|
to.f = t.f * pixelRatio;
|
|
523
523
|
},
|
|
524
524
|
scaleOfOuter(t, origin, scaleX, scaleY) {
|
|
525
|
-
M$7.toInnerPoint(t, origin, tempPoint$
|
|
526
|
-
M$7.scaleOfInner(t, tempPoint$
|
|
525
|
+
M$7.toInnerPoint(t, origin, tempPoint$5);
|
|
526
|
+
M$7.scaleOfInner(t, tempPoint$5, scaleX, scaleY);
|
|
527
527
|
},
|
|
528
528
|
scaleOfInner(t, origin, scaleX, scaleY = scaleX) {
|
|
529
529
|
M$7.translateInner(t, origin.x, origin.y);
|
|
@@ -541,8 +541,8 @@ const MatrixHelper = {
|
|
|
541
541
|
t.d = c * sinR + d * cosR;
|
|
542
542
|
},
|
|
543
543
|
rotateOfOuter(t, origin, rotation) {
|
|
544
|
-
M$7.toInnerPoint(t, origin, tempPoint$
|
|
545
|
-
M$7.rotateOfInner(t, tempPoint$
|
|
544
|
+
M$7.toInnerPoint(t, origin, tempPoint$5);
|
|
545
|
+
M$7.rotateOfInner(t, tempPoint$5, rotation);
|
|
546
546
|
},
|
|
547
547
|
rotateOfInner(t, origin, rotation) {
|
|
548
548
|
M$7.translateInner(t, origin.x, origin.y);
|
|
@@ -563,8 +563,8 @@ const MatrixHelper = {
|
|
|
563
563
|
}
|
|
564
564
|
},
|
|
565
565
|
skewOfOuter(t, origin, skewX, skewY) {
|
|
566
|
-
M$7.toInnerPoint(t, origin, tempPoint$
|
|
567
|
-
M$7.skewOfInner(t, tempPoint$
|
|
566
|
+
M$7.toInnerPoint(t, origin, tempPoint$5);
|
|
567
|
+
M$7.skewOfInner(t, tempPoint$5, skewX, skewY);
|
|
568
568
|
},
|
|
569
569
|
skewOfInner(t, origin, skewX, skewY = 0) {
|
|
570
570
|
M$7.translateInner(t, origin.x, origin.y);
|
|
@@ -712,12 +712,12 @@ const MatrixHelper = {
|
|
|
712
712
|
const cosR = c / scaleY;
|
|
713
713
|
rotation = PI_2 - (d > 0 ? acos(-cosR) : -acos(cosR));
|
|
714
714
|
}
|
|
715
|
-
const cosR = float$
|
|
715
|
+
const cosR = float$5(cos$6(rotation));
|
|
716
716
|
const sinR = sin$6(rotation);
|
|
717
|
-
scaleX = float$
|
|
718
|
-
skewX = cosR ? float$
|
|
719
|
-
skewY = cosR ? float$
|
|
720
|
-
rotation = float$
|
|
717
|
+
scaleX = float$5(scaleX), scaleY = float$5(scaleY);
|
|
718
|
+
skewX = cosR ? float$5((c / scaleY + sinR) / cosR / OneRadian, 9) : 0;
|
|
719
|
+
skewY = cosR ? float$5((b / scaleX - sinR) / cosR / OneRadian, 9) : 0;
|
|
720
|
+
rotation = float$5(rotation / OneRadian);
|
|
721
721
|
} else {
|
|
722
722
|
scaleX = a;
|
|
723
723
|
scaleY = d;
|
|
@@ -761,6 +761,8 @@ const MatrixHelper = {
|
|
|
761
761
|
|
|
762
762
|
const M$7 = MatrixHelper;
|
|
763
763
|
|
|
764
|
+
const {float: float$4} = MathHelper;
|
|
765
|
+
|
|
764
766
|
const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
|
|
765
767
|
|
|
766
768
|
const {sin: sin$5, cos: cos$5, abs: abs$6, sqrt: sqrt$4, atan2: atan2$2, min: min$2, round: round$5} = Math;
|
|
@@ -812,22 +814,27 @@ const PointHelper = {
|
|
|
812
814
|
},
|
|
813
815
|
tempToInnerOf(t, matrix) {
|
|
814
816
|
const {tempPoint: temp} = P$5;
|
|
815
|
-
copy$
|
|
817
|
+
copy$9(temp, t);
|
|
816
818
|
toInnerPoint$2(matrix, temp, temp);
|
|
817
819
|
return temp;
|
|
818
820
|
},
|
|
819
821
|
tempToOuterOf(t, matrix) {
|
|
820
822
|
const {tempPoint: temp} = P$5;
|
|
821
|
-
copy$
|
|
823
|
+
copy$9(temp, t);
|
|
822
824
|
toOuterPoint$3(matrix, temp, temp);
|
|
823
825
|
return temp;
|
|
824
826
|
},
|
|
825
827
|
tempToInnerRadiusPointOf(t, matrix) {
|
|
826
828
|
const {tempRadiusPoint: temp} = P$5;
|
|
827
|
-
copy$
|
|
829
|
+
copy$9(temp, t);
|
|
828
830
|
P$5.toInnerRadiusPointOf(t, matrix, temp);
|
|
829
831
|
return temp;
|
|
830
832
|
},
|
|
833
|
+
copyRadiusPoint(t, point, x, y) {
|
|
834
|
+
copy$9(t, point);
|
|
835
|
+
setRadius(t, x, y);
|
|
836
|
+
return t;
|
|
837
|
+
},
|
|
831
838
|
toInnerRadiusPointOf(t, matrix, to) {
|
|
832
839
|
to || (to = t);
|
|
833
840
|
toInnerPoint$2(matrix, t, to);
|
|
@@ -895,7 +902,7 @@ const PointHelper = {
|
|
|
895
902
|
return points;
|
|
896
903
|
},
|
|
897
904
|
isSame(t, point) {
|
|
898
|
-
return t.x === point.x && t.y === point.y;
|
|
905
|
+
return float$4(t.x) === float$4(point.x) && float$4(t.y) === float$4(point.y);
|
|
899
906
|
},
|
|
900
907
|
reset(t) {
|
|
901
908
|
P$5.reset(t);
|
|
@@ -904,7 +911,7 @@ const PointHelper = {
|
|
|
904
911
|
|
|
905
912
|
const P$5 = PointHelper;
|
|
906
913
|
|
|
907
|
-
const {getDistanceFrom: getDistanceFrom, copy: copy$
|
|
914
|
+
const {getDistanceFrom: getDistanceFrom, copy: copy$9, setRadius: setRadius, getAtan2: getAtan2} = P$5;
|
|
908
915
|
|
|
909
916
|
class Point {
|
|
910
917
|
constructor(x, y) {
|
|
@@ -979,7 +986,7 @@ class Point {
|
|
|
979
986
|
}
|
|
980
987
|
}
|
|
981
988
|
|
|
982
|
-
const tempPoint$
|
|
989
|
+
const tempPoint$4 = new Point;
|
|
983
990
|
|
|
984
991
|
class Matrix {
|
|
985
992
|
constructor(a, b, c, d, e, f) {
|
|
@@ -1250,7 +1257,7 @@ const {tempPointBounds: tempPointBounds$1, setPoint: setPoint$2, addPoint: addPo
|
|
|
1250
1257
|
|
|
1251
1258
|
const {toOuterPoint: toOuterPoint$2} = MatrixHelper;
|
|
1252
1259
|
|
|
1253
|
-
const {float: float$
|
|
1260
|
+
const {float: float$3, fourNumber: fourNumber$1} = MathHelper;
|
|
1254
1261
|
|
|
1255
1262
|
const {floor: floor$1, ceil: ceil$2} = Math;
|
|
1256
1263
|
|
|
@@ -1315,7 +1322,7 @@ const BoundsHelper = {
|
|
|
1315
1322
|
return t;
|
|
1316
1323
|
},
|
|
1317
1324
|
toOffsetOutBounds(t, to, offsetBounds) {
|
|
1318
|
-
if (!to) to = t; else copy$
|
|
1325
|
+
if (!to) to = t; else copy$8(to, t);
|
|
1319
1326
|
if (!offsetBounds) offsetBounds = t;
|
|
1320
1327
|
to.offsetX = B.maxX(offsetBounds);
|
|
1321
1328
|
to.offsetY = B.maxY(offsetBounds);
|
|
@@ -1425,10 +1432,10 @@ const BoundsHelper = {
|
|
|
1425
1432
|
}
|
|
1426
1433
|
},
|
|
1427
1434
|
float(t, maxLength) {
|
|
1428
|
-
t.x = float$
|
|
1429
|
-
t.y = float$
|
|
1430
|
-
t.width = float$
|
|
1431
|
-
t.height = float$
|
|
1435
|
+
t.x = float$3(t.x, maxLength);
|
|
1436
|
+
t.y = float$3(t.y, maxLength);
|
|
1437
|
+
t.width = float$3(t.width, maxLength);
|
|
1438
|
+
t.height = float$3(t.height, maxLength);
|
|
1432
1439
|
},
|
|
1433
1440
|
add(t, bounds, isPoint) {
|
|
1434
1441
|
right$1 = t.x + t.width;
|
|
@@ -1462,7 +1469,7 @@ const BoundsHelper = {
|
|
|
1462
1469
|
if (bounds && (bounds.width || bounds.height)) {
|
|
1463
1470
|
if (first) {
|
|
1464
1471
|
first = false;
|
|
1465
|
-
if (!addMode) copy$
|
|
1472
|
+
if (!addMode) copy$8(t, bounds);
|
|
1466
1473
|
} else {
|
|
1467
1474
|
add$2(t, bounds);
|
|
1468
1475
|
}
|
|
@@ -1549,7 +1556,7 @@ const BoundsHelper = {
|
|
|
1549
1556
|
|
|
1550
1557
|
const B = BoundsHelper;
|
|
1551
1558
|
|
|
1552
|
-
const {add: add$2, copy: copy$
|
|
1559
|
+
const {add: add$2, copy: copy$8} = B;
|
|
1553
1560
|
|
|
1554
1561
|
class Bounds {
|
|
1555
1562
|
get minX() {
|
|
@@ -2247,7 +2254,7 @@ __decorate([ contextMethod() ], Canvas$1.prototype, "measureText", null);
|
|
|
2247
2254
|
|
|
2248
2255
|
__decorate([ contextMethod() ], Canvas$1.prototype, "strokeText", null);
|
|
2249
2256
|
|
|
2250
|
-
const {copy: copy$
|
|
2257
|
+
const {copy: copy$7, multiplyParent: multiplyParent$4, pixelScale: pixelScale} = MatrixHelper, {round: round$4} = Math, tempPixelBounds = new Bounds, tempPixelBounds2 = new Bounds;
|
|
2251
2258
|
|
|
2252
2259
|
const minSize = {
|
|
2253
2260
|
width: 1,
|
|
@@ -2407,7 +2414,7 @@ class LeaferCanvasBase extends Canvas$1 {
|
|
|
2407
2414
|
const {pixelRatio: pixelRatio} = this;
|
|
2408
2415
|
this.filter = `blur(${blur * pixelRatio}px)`;
|
|
2409
2416
|
}
|
|
2410
|
-
copyWorld(canvas, from, to, blendMode, ceilPixel
|
|
2417
|
+
copyWorld(canvas, from, to, blendMode, ceilPixel) {
|
|
2411
2418
|
if (blendMode) this.blendMode = blendMode;
|
|
2412
2419
|
if (from) {
|
|
2413
2420
|
this.setTempPixelBounds(from, ceilPixel);
|
|
@@ -2418,7 +2425,7 @@ class LeaferCanvasBase extends Canvas$1 {
|
|
|
2418
2425
|
}
|
|
2419
2426
|
if (blendMode) this.blendMode = "source-over";
|
|
2420
2427
|
}
|
|
2421
|
-
copyWorldToInner(canvas, fromWorld, toInnerBounds, blendMode, ceilPixel
|
|
2428
|
+
copyWorldToInner(canvas, fromWorld, toInnerBounds, blendMode, ceilPixel) {
|
|
2422
2429
|
if (fromWorld.b || fromWorld.c) {
|
|
2423
2430
|
this.save();
|
|
2424
2431
|
this.resetTransform();
|
|
@@ -2431,7 +2438,7 @@ class LeaferCanvasBase extends Canvas$1 {
|
|
|
2431
2438
|
if (blendMode) this.blendMode = "source-over";
|
|
2432
2439
|
}
|
|
2433
2440
|
}
|
|
2434
|
-
copyWorldByReset(canvas, from, to, blendMode, onlyResetTransform, ceilPixel
|
|
2441
|
+
copyWorldByReset(canvas, from, to, blendMode, onlyResetTransform, ceilPixel) {
|
|
2435
2442
|
this.resetTransform();
|
|
2436
2443
|
this.copyWorld(canvas, from, to, blendMode, ceilPixel);
|
|
2437
2444
|
if (!onlyResetTransform) this.useWorldTransform();
|
|
@@ -2501,7 +2508,7 @@ class LeaferCanvasBase extends Canvas$1 {
|
|
|
2501
2508
|
getSameCanvas(useSameWorldTransform, useSameSmooth) {
|
|
2502
2509
|
const {size: size, pixelSnap: pixelSnap} = this, canvas = this.manager ? this.manager.get(size) : Creator.canvas(Object.assign({}, size));
|
|
2503
2510
|
canvas.save();
|
|
2504
|
-
if (useSameWorldTransform) copy$
|
|
2511
|
+
if (useSameWorldTransform) copy$7(canvas.worldTransform, this.worldTransform), canvas.useWorldTransform();
|
|
2505
2512
|
if (useSameSmooth) canvas.smooth = this.smooth;
|
|
2506
2513
|
canvas.pixelSnap !== pixelSnap && (canvas.pixelSnap = pixelSnap);
|
|
2507
2514
|
return canvas;
|
|
@@ -2650,7 +2657,7 @@ const {set: set$1, toNumberPoints: toNumberPoints} = PointHelper;
|
|
|
2650
2657
|
|
|
2651
2658
|
const {M: M$6, L: L$7, C: C$5, Q: Q$4, Z: Z$6} = PathCommandMap;
|
|
2652
2659
|
|
|
2653
|
-
const tempPoint$
|
|
2660
|
+
const tempPoint$3 = {};
|
|
2654
2661
|
|
|
2655
2662
|
const BezierHelper = {
|
|
2656
2663
|
points(data, originPoints, curve, close) {
|
|
@@ -2658,7 +2665,7 @@ const BezierHelper = {
|
|
|
2658
2665
|
data.push(M$6, points[0], points[1]);
|
|
2659
2666
|
if (curve && points.length > 5) {
|
|
2660
2667
|
let aX, aY, bX, bY, cX, cY, c1X, c1Y, c2X, c2Y;
|
|
2661
|
-
let ba, cb, d, len = points.length;
|
|
2668
|
+
let baX, baY, ba, cb, d, len = points.length;
|
|
2662
2669
|
const t = curve === true ? .5 : curve;
|
|
2663
2670
|
if (close) {
|
|
2664
2671
|
points = [ points[len - 2], points[len - 1], ...points, points[0], points[1], points[2], points[3] ];
|
|
@@ -2671,7 +2678,9 @@ const BezierHelper = {
|
|
|
2671
2678
|
bY = points[i + 1];
|
|
2672
2679
|
cX = points[i + 2];
|
|
2673
2680
|
cY = points[i + 3];
|
|
2674
|
-
|
|
2681
|
+
baX = bX - aX;
|
|
2682
|
+
baY = bY - aY;
|
|
2683
|
+
ba = sqrt$3(pow$1(baX, 2) + pow$1(baY, 2));
|
|
2675
2684
|
cb = sqrt$3(pow$1(cX - bX, 2) + pow$1(cY - bY, 2));
|
|
2676
2685
|
if (!ba && !cb) continue;
|
|
2677
2686
|
d = ba + cb;
|
|
@@ -2684,7 +2693,7 @@ const BezierHelper = {
|
|
|
2684
2693
|
if (i === 2) {
|
|
2685
2694
|
if (!close) data.push(Q$4, c1X, c1Y, bX, bY);
|
|
2686
2695
|
} else {
|
|
2687
|
-
data.push(C$5, c2X, c2Y, c1X, c1Y, bX, bY);
|
|
2696
|
+
if (baX || baY) data.push(C$5, c2X, c2Y, c1X, c1Y, bX, bY);
|
|
2688
2697
|
}
|
|
2689
2698
|
c2X = bX + cb * cX;
|
|
2690
2699
|
c2Y = bY + cb * cY;
|
|
@@ -2819,8 +2828,8 @@ const BezierHelper = {
|
|
|
2819
2828
|
addMode ? addPoint$1(pointBounds, fromX, fromY) : setPoint$1(pointBounds, fromX, fromY);
|
|
2820
2829
|
addPoint$1(pointBounds, toX, toY);
|
|
2821
2830
|
for (let i = 0, len = tList.length; i < len; i++) {
|
|
2822
|
-
getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$
|
|
2823
|
-
addPoint$1(pointBounds, tempPoint$
|
|
2831
|
+
getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$3);
|
|
2832
|
+
addPoint$1(pointBounds, tempPoint$3.x, tempPoint$3.y);
|
|
2824
2833
|
}
|
|
2825
2834
|
},
|
|
2826
2835
|
getPointAndSet(t, fromX, fromY, x1, y1, x2, y2, toX, toY, setPoint) {
|
|
@@ -3269,6 +3278,7 @@ const PathCommandDataHelper = {
|
|
|
3269
3278
|
}
|
|
3270
3279
|
},
|
|
3271
3280
|
ellipse(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
|
|
3281
|
+
if (radiusX === radiusY) return arc$2(data, x, y, radiusX, startAngle, endAngle, anticlockwise);
|
|
3272
3282
|
if (isNull(rotation)) {
|
|
3273
3283
|
data.push(F$3, x, y, radiusX, radiusY);
|
|
3274
3284
|
} else {
|
|
@@ -3281,6 +3291,7 @@ const PathCommandDataHelper = {
|
|
|
3281
3291
|
if (isNull(startAngle)) {
|
|
3282
3292
|
data.push(P$2, x, y, radius);
|
|
3283
3293
|
} else {
|
|
3294
|
+
if (isNull(startAngle)) startAngle = 0;
|
|
3284
3295
|
if (isNull(endAngle)) endAngle = 360;
|
|
3285
3296
|
data.push(O$2, x, y, radius, startAngle, endAngle, anticlockwise ? 1 : 0);
|
|
3286
3297
|
}
|
|
@@ -3490,7 +3501,7 @@ const {M: M$2, L: L$3, C: C$1, Q: Q, Z: Z$2, N: N, D: D$1, X: X, G: G, F: F$1, O
|
|
|
3490
3501
|
|
|
3491
3502
|
const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc: arc, ellipse: ellipse$1} = BezierHelper;
|
|
3492
3503
|
|
|
3493
|
-
const {addPointBounds: addPointBounds, copy: copy$
|
|
3504
|
+
const {addPointBounds: addPointBounds, copy: copy$6, addPoint: addPoint, setPoint: setPoint, addBounds: addBounds, toBounds: toBounds$1} = TwoPointBoundsHelper;
|
|
3494
3505
|
|
|
3495
3506
|
const debug$a = Debug.get("PathBounds");
|
|
3496
3507
|
|
|
@@ -3572,7 +3583,7 @@ const PathBounds = {
|
|
|
3572
3583
|
|
|
3573
3584
|
case G:
|
|
3574
3585
|
ellipse$1(null, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], data[i + 7], data[i + 8], tempPointBounds, setEndPoint);
|
|
3575
|
-
i === 0 ? copy$
|
|
3586
|
+
i === 0 ? copy$6(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
|
|
3576
3587
|
x = setEndPoint.x;
|
|
3577
3588
|
y = setEndPoint.y;
|
|
3578
3589
|
i += 9;
|
|
@@ -3590,7 +3601,7 @@ const PathBounds = {
|
|
|
3590
3601
|
|
|
3591
3602
|
case O:
|
|
3592
3603
|
arc(null, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], tempPointBounds, setEndPoint);
|
|
3593
|
-
i === 0 ? copy$
|
|
3604
|
+
i === 0 ? copy$6(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
|
|
3594
3605
|
x = setEndPoint.x;
|
|
3595
3606
|
y = setEndPoint.y;
|
|
3596
3607
|
i += 7;
|
|
@@ -3607,7 +3618,7 @@ const PathBounds = {
|
|
|
3607
3618
|
|
|
3608
3619
|
case U:
|
|
3609
3620
|
arcTo$1(null, x, y, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], tempPointBounds, setEndPoint);
|
|
3610
|
-
i === 0 ? copy$
|
|
3621
|
+
i === 0 ? copy$6(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
|
|
3611
3622
|
x = setEndPoint.x;
|
|
3612
3623
|
y = setEndPoint.y;
|
|
3613
3624
|
i += 6;
|
|
@@ -3631,6 +3642,7 @@ const PathCorner = {
|
|
|
3631
3642
|
smooth(data, cornerRadius, _cornerSmoothing) {
|
|
3632
3643
|
let command, lastCommand, commandLen;
|
|
3633
3644
|
let i = 0, x = 0, y = 0, startX = 0, startY = 0, secondX = 0, secondY = 0, lastX = 0, lastY = 0;
|
|
3645
|
+
if (isArray(cornerRadius)) cornerRadius = cornerRadius[0] || 0;
|
|
3634
3646
|
const len = data.length;
|
|
3635
3647
|
const smooth = [];
|
|
3636
3648
|
while (i < len) {
|
|
@@ -4046,7 +4058,9 @@ const R = Resource;
|
|
|
4046
4058
|
const ImageManager = {
|
|
4047
4059
|
maxRecycled: 10,
|
|
4048
4060
|
recycledList: [],
|
|
4049
|
-
patternTasker: new TaskProcessor
|
|
4061
|
+
patternTasker: new TaskProcessor({
|
|
4062
|
+
parallel: 1
|
|
4063
|
+
}),
|
|
4050
4064
|
get(config) {
|
|
4051
4065
|
let image = Resource.get(config.url);
|
|
4052
4066
|
if (!image) Resource.set(config.url, image = Creator.image(config));
|
|
@@ -4103,6 +4117,10 @@ class LeaferImage {
|
|
|
4103
4117
|
get url() {
|
|
4104
4118
|
return this.config.url;
|
|
4105
4119
|
}
|
|
4120
|
+
get crossOrigin() {
|
|
4121
|
+
const {crossOrigin: crossOrigin} = this.config;
|
|
4122
|
+
return isUndefined(crossOrigin) ? Platform.image.crossOrigin : crossOrigin;
|
|
4123
|
+
}
|
|
4106
4124
|
get completed() {
|
|
4107
4125
|
return this.ready || !!this.error;
|
|
4108
4126
|
}
|
|
@@ -4120,12 +4138,14 @@ class LeaferImage {
|
|
|
4120
4138
|
ImageManager.isFormat("svg", config) && (this.isSVG = true);
|
|
4121
4139
|
ImageManager.hasAlphaPixel(config) && (this.hasAlphaPixel = true);
|
|
4122
4140
|
}
|
|
4123
|
-
load(onSuccess, onError) {
|
|
4141
|
+
load(onSuccess, onError, thumbSize) {
|
|
4124
4142
|
if (!this.loading) {
|
|
4125
4143
|
this.loading = true;
|
|
4126
|
-
const {crossOrigin: crossOrigin} = this.config;
|
|
4127
4144
|
Resource.tasker.add(() => __awaiter(this, void 0, void 0, function*() {
|
|
4128
|
-
return yield Platform.origin.loadImage(this.
|
|
4145
|
+
return yield Platform.origin.loadImage(this.getLoadUrl(thumbSize), this.crossOrigin, this).then(img => {
|
|
4146
|
+
if (thumbSize) this.setThumbView(img);
|
|
4147
|
+
this.setView(img);
|
|
4148
|
+
}).catch(e => {
|
|
4129
4149
|
this.error = e;
|
|
4130
4150
|
this.onComplete(false);
|
|
4131
4151
|
});
|
|
@@ -4146,9 +4166,11 @@ class LeaferImage {
|
|
|
4146
4166
|
}
|
|
4147
4167
|
setView(img) {
|
|
4148
4168
|
this.ready = true;
|
|
4149
|
-
this.width
|
|
4150
|
-
|
|
4151
|
-
|
|
4169
|
+
if (!this.width) {
|
|
4170
|
+
this.width = img.width;
|
|
4171
|
+
this.height = img.height;
|
|
4172
|
+
this.view = img;
|
|
4173
|
+
}
|
|
4152
4174
|
this.onComplete(true);
|
|
4153
4175
|
}
|
|
4154
4176
|
onComplete(isSuccess) {
|
|
@@ -4194,6 +4216,19 @@ class LeaferImage {
|
|
|
4194
4216
|
Platform.image.setPatternTransform(pattern, transform, paint);
|
|
4195
4217
|
return pattern;
|
|
4196
4218
|
}
|
|
4219
|
+
getLoadUrl(_thumbSize) {
|
|
4220
|
+
return this.url;
|
|
4221
|
+
}
|
|
4222
|
+
setThumbView(_view) {}
|
|
4223
|
+
getThumbSize() {
|
|
4224
|
+
return undefined;
|
|
4225
|
+
}
|
|
4226
|
+
getMinLevel() {
|
|
4227
|
+
return undefined;
|
|
4228
|
+
}
|
|
4229
|
+
getLevelData(_level) {
|
|
4230
|
+
return undefined;
|
|
4231
|
+
}
|
|
4197
4232
|
clearLevels(_checkUse) {}
|
|
4198
4233
|
destroy() {
|
|
4199
4234
|
this.clearLevels();
|
|
@@ -4627,7 +4662,7 @@ function registerUIEvent() {
|
|
|
4627
4662
|
};
|
|
4628
4663
|
}
|
|
4629
4664
|
|
|
4630
|
-
const {copy: copy$
|
|
4665
|
+
const {copy: copy$5, toInnerPoint: toInnerPoint$1, toOuterPoint: toOuterPoint$1, scaleOfOuter: scaleOfOuter$2, rotateOfOuter: rotateOfOuter$2, skewOfOuter: skewOfOuter, multiplyParent: multiplyParent$3, divideParent: divideParent, getLayout: getLayout} = MatrixHelper;
|
|
4631
4666
|
|
|
4632
4667
|
const matrix$1 = {}, {round: round$3} = Math;
|
|
4633
4668
|
|
|
@@ -4725,7 +4760,7 @@ const LeafHelper = {
|
|
|
4725
4760
|
if (scaleY) transition = scaleY;
|
|
4726
4761
|
scaleY = scaleX;
|
|
4727
4762
|
}
|
|
4728
|
-
copy$
|
|
4763
|
+
copy$5(matrix$1, o);
|
|
4729
4764
|
scaleOfOuter$2(matrix$1, origin, scaleX, scaleY);
|
|
4730
4765
|
if (L$1.hasHighPosition(t)) {
|
|
4731
4766
|
L$1.setTransform(t, matrix$1, resize, transition);
|
|
@@ -4744,7 +4779,7 @@ const LeafHelper = {
|
|
|
4744
4779
|
},
|
|
4745
4780
|
rotateOfLocal(t, origin, angle, transition) {
|
|
4746
4781
|
const o = t.__localMatrix;
|
|
4747
|
-
copy$
|
|
4782
|
+
copy$5(matrix$1, o);
|
|
4748
4783
|
rotateOfOuter$2(matrix$1, origin, angle);
|
|
4749
4784
|
if (L$1.hasHighPosition(t)) L$1.setTransform(t, matrix$1, false, transition); else t.set({
|
|
4750
4785
|
x: t.x + matrix$1.e - o.e,
|
|
@@ -4756,18 +4791,18 @@ const LeafHelper = {
|
|
|
4756
4791
|
L$1.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize, transition);
|
|
4757
4792
|
},
|
|
4758
4793
|
skewOfLocal(t, origin, skewX, skewY = 0, resize, transition) {
|
|
4759
|
-
copy$
|
|
4794
|
+
copy$5(matrix$1, t.__localMatrix);
|
|
4760
4795
|
skewOfOuter(matrix$1, origin, skewX, skewY);
|
|
4761
4796
|
L$1.setTransform(t, matrix$1, resize, transition);
|
|
4762
4797
|
},
|
|
4763
4798
|
transformWorld(t, transform, resize, transition) {
|
|
4764
|
-
copy$
|
|
4799
|
+
copy$5(matrix$1, t.worldTransform);
|
|
4765
4800
|
multiplyParent$3(matrix$1, transform);
|
|
4766
4801
|
if (t.parent) divideParent(matrix$1, t.parent.scrollWorldTransform);
|
|
4767
4802
|
L$1.setTransform(t, matrix$1, resize, transition);
|
|
4768
4803
|
},
|
|
4769
4804
|
transform(t, transform, resize, transition) {
|
|
4770
|
-
copy$
|
|
4805
|
+
copy$5(matrix$1, t.localTransform);
|
|
4771
4806
|
multiplyParent$3(matrix$1, transform);
|
|
4772
4807
|
L$1.setTransform(t, matrix$1, resize, transition);
|
|
4773
4808
|
},
|
|
@@ -4805,7 +4840,7 @@ const LeafHelper = {
|
|
|
4805
4840
|
return innerOrigin;
|
|
4806
4841
|
},
|
|
4807
4842
|
getRelativeWorld(t, relative, temp) {
|
|
4808
|
-
copy$
|
|
4843
|
+
copy$5(matrix$1, t.worldTransform);
|
|
4809
4844
|
divideParent(matrix$1, relative.scrollWorldTransform);
|
|
4810
4845
|
return temp ? matrix$1 : Object.assign({}, matrix$1);
|
|
4811
4846
|
},
|
|
@@ -5013,7 +5048,7 @@ const WaitHelper = {
|
|
|
5013
5048
|
|
|
5014
5049
|
const {getRelativeWorld: getRelativeWorld$1, updateBounds: updateBounds$3} = LeafHelper;
|
|
5015
5050
|
|
|
5016
|
-
const {toOuterOf: toOuterOf$3, getPoints: getPoints, copy: copy$
|
|
5051
|
+
const {toOuterOf: toOuterOf$3, getPoints: getPoints, copy: copy$4} = BoundsHelper;
|
|
5017
5052
|
|
|
5018
5053
|
const localContent = "_localContentBounds";
|
|
5019
5054
|
|
|
@@ -5252,7 +5287,7 @@ class LeafLayout {
|
|
|
5252
5287
|
matrix = getRelativeWorld$1(leaf, relative, true);
|
|
5253
5288
|
}
|
|
5254
5289
|
if (!layoutBounds) layoutBounds = MatrixHelper.getLayout(matrix);
|
|
5255
|
-
copy$
|
|
5290
|
+
copy$4(layoutBounds, bounds);
|
|
5256
5291
|
PointHelper.copy(layoutBounds, point);
|
|
5257
5292
|
if (unscale) {
|
|
5258
5293
|
const {scaleX: scaleX, scaleY: scaleY} = layoutBounds;
|
|
@@ -5874,7 +5909,7 @@ const LeafDataProxy = {
|
|
|
5874
5909
|
|
|
5875
5910
|
const {setLayout: setLayout, multiplyParent: multiplyParent$2, translateInner: translateInner, defaultWorld: defaultWorld} = MatrixHelper;
|
|
5876
5911
|
|
|
5877
|
-
const {toPoint: toPoint$3, tempPoint: tempPoint$
|
|
5912
|
+
const {toPoint: toPoint$3, tempPoint: tempPoint$2} = AroundHelper;
|
|
5878
5913
|
|
|
5879
5914
|
const LeafMatrix = {
|
|
5880
5915
|
__updateWorldMatrix() {
|
|
@@ -5894,8 +5929,8 @@ const LeafMatrix = {
|
|
|
5894
5929
|
local.e = data.x + data.offsetX;
|
|
5895
5930
|
local.f = data.y + data.offsetY;
|
|
5896
5931
|
if (data.around || data.origin) {
|
|
5897
|
-
toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint$
|
|
5898
|
-
translateInner(local, -tempPoint$
|
|
5932
|
+
toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint$2);
|
|
5933
|
+
translateInner(local, -tempPoint$2.x, -tempPoint$2.y, !data.around);
|
|
5899
5934
|
}
|
|
5900
5935
|
}
|
|
5901
5936
|
this.__layout.matrixChanged = undefined;
|
|
@@ -5906,7 +5941,7 @@ const {updateMatrix: updateMatrix$2, updateAllMatrix: updateAllMatrix$3} = LeafH
|
|
|
5906
5941
|
|
|
5907
5942
|
const {updateBounds: updateBounds$2} = BranchHelper;
|
|
5908
5943
|
|
|
5909
|
-
const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$2, copy: copy$
|
|
5944
|
+
const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$2, copy: copy$3} = BoundsHelper;
|
|
5910
5945
|
|
|
5911
5946
|
const {toBounds: toBounds} = PathBounds;
|
|
5912
5947
|
|
|
@@ -6017,7 +6052,7 @@ const LeafBounds = {
|
|
|
6017
6052
|
},
|
|
6018
6053
|
__updateRenderBounds(_bounds) {
|
|
6019
6054
|
const layout = this.__layout, {renderSpread: renderSpread} = layout;
|
|
6020
|
-
isNumber(renderSpread) && renderSpread <= 0 ? copy$
|
|
6055
|
+
isNumber(renderSpread) && renderSpread <= 0 ? copy$3(layout.renderBounds, layout.strokeBounds) : copyAndSpread$2(layout.renderBounds, layout.boxBounds, renderSpread);
|
|
6021
6056
|
}
|
|
6022
6057
|
};
|
|
6023
6058
|
|
|
@@ -6122,7 +6157,7 @@ const {toInnerPoint: toInnerPoint, toOuterPoint: toOuterPoint, multiplyParent: m
|
|
|
6122
6157
|
|
|
6123
6158
|
const {toOuterOf: toOuterOf$1} = BoundsHelper;
|
|
6124
6159
|
|
|
6125
|
-
const {copy: copy$
|
|
6160
|
+
const {copy: copy$2, move: move$2} = PointHelper;
|
|
6126
6161
|
|
|
6127
6162
|
const {moveLocal: moveLocal, zoomOfLocal: zoomOfLocal, rotateOfLocal: rotateOfLocal, skewOfLocal: skewOfLocal, moveWorld: moveWorld, zoomOfWorld: zoomOfWorld, rotateOfWorld: rotateOfWorld, skewOfWorld: skewOfWorld, transform: transform, transformWorld: transformWorld, setTransform: setTransform, getFlipTransform: getFlipTransform, getLocalOrigin: getLocalOrigin, getRelativeWorld: getRelativeWorld, drop: drop} = LeafHelper;
|
|
6128
6163
|
|
|
@@ -6441,14 +6476,14 @@ let Leaf = class Leaf {
|
|
|
6441
6476
|
if (this.parent) {
|
|
6442
6477
|
this.parent.worldToInner(world, to, distance, relative);
|
|
6443
6478
|
} else {
|
|
6444
|
-
if (to) copy$
|
|
6479
|
+
if (to) copy$2(to, world);
|
|
6445
6480
|
}
|
|
6446
6481
|
}
|
|
6447
6482
|
localToWorld(local, to, distance, relative) {
|
|
6448
6483
|
if (this.parent) {
|
|
6449
6484
|
this.parent.innerToWorld(local, to, distance, relative);
|
|
6450
6485
|
} else {
|
|
6451
|
-
if (to) copy$
|
|
6486
|
+
if (to) copy$2(to, local);
|
|
6452
6487
|
}
|
|
6453
6488
|
}
|
|
6454
6489
|
worldToInner(world, to, distance, relative) {
|
|
@@ -6923,7 +6958,7 @@ class LeafLevelList {
|
|
|
6923
6958
|
}
|
|
6924
6959
|
}
|
|
6925
6960
|
|
|
6926
|
-
const version = "1.12.
|
|
6961
|
+
const version = "1.12.3";
|
|
6927
6962
|
|
|
6928
6963
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6929
6964
|
get allowBackgroundColor() {
|
|
@@ -7572,6 +7607,10 @@ class Renderer {
|
|
|
7572
7607
|
|
|
7573
7608
|
Renderer.clipSpread = 10;
|
|
7574
7609
|
|
|
7610
|
+
const tempPoint$1 = {};
|
|
7611
|
+
|
|
7612
|
+
const {copyRadiusPoint: copyRadiusPoint$1} = PointHelper;
|
|
7613
|
+
|
|
7575
7614
|
const {hitRadiusPoint: hitRadiusPoint$1} = BoundsHelper;
|
|
7576
7615
|
|
|
7577
7616
|
class Picker {
|
|
@@ -7698,15 +7737,15 @@ class Picker {
|
|
|
7698
7737
|
this.eachFind(branch.children, branch.__onlyHitMask);
|
|
7699
7738
|
}
|
|
7700
7739
|
eachFind(children, hitMask) {
|
|
7701
|
-
let child, hit;
|
|
7740
|
+
let child, hit, data;
|
|
7702
7741
|
const {point: point} = this, len = children.length;
|
|
7703
7742
|
for (let i = len - 1; i > -1; i--) {
|
|
7704
|
-
child = children[i];
|
|
7705
|
-
if (!
|
|
7706
|
-
hit = child.
|
|
7743
|
+
child = children[i], data = child.__;
|
|
7744
|
+
if (!data.visible || hitMask && !data.mask) continue;
|
|
7745
|
+
hit = hitRadiusPoint$1(child.__world, data.hitRadius ? copyRadiusPoint$1(tempPoint$1, point, data.hitRadius) : point);
|
|
7707
7746
|
if (child.isBranch) {
|
|
7708
7747
|
if (hit || child.__ignoreHitWorld) {
|
|
7709
|
-
if (child.isBranchLeaf &&
|
|
7748
|
+
if (child.isBranchLeaf && data.__clipAfterFill && !child.__hitWorld(point, true)) continue;
|
|
7710
7749
|
if (child.topChildren) this.eachFind(child.topChildren, false);
|
|
7711
7750
|
this.eachFind(child.children, child.__onlyHitMask);
|
|
7712
7751
|
if (child.isBranchLeaf) this.hitChild(child, point);
|
|
@@ -8283,7 +8322,7 @@ const UIRender = {
|
|
|
8283
8322
|
if (stroke && !__fillAfterStroke) data.__isStrokes ? Paint.strokes(stroke, this, canvas, options) : Paint.stroke(stroke, this, canvas, options);
|
|
8284
8323
|
}
|
|
8285
8324
|
} else {
|
|
8286
|
-
if (data.
|
|
8325
|
+
if (data.__pathForRender) drawFast(this, canvas, options); else this.__drawFast(canvas, options);
|
|
8287
8326
|
}
|
|
8288
8327
|
},
|
|
8289
8328
|
__drawShape(canvas, options) {
|
|
@@ -8407,7 +8446,7 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8407
8446
|
getPath(curve, pathForRender) {
|
|
8408
8447
|
this.__layout.update();
|
|
8409
8448
|
let path = pathForRender ? this.__.__pathForRender : this.__.path;
|
|
8410
|
-
if (!path) pen.set(path = []), this.__drawPathByBox(pen);
|
|
8449
|
+
if (!path) pen.set(path = []), this.__drawPathByBox(pen, !pathForRender);
|
|
8411
8450
|
return curve ? PathConvert.toCanvasData(path, true) : path;
|
|
8412
8451
|
}
|
|
8413
8452
|
getPathString(curve, pathForRender, floatLength) {
|
|
@@ -8435,17 +8474,18 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8435
8474
|
}
|
|
8436
8475
|
__drawPath(canvas) {
|
|
8437
8476
|
canvas.beginPath();
|
|
8438
|
-
this.__drawPathByData(canvas, this.__.path);
|
|
8477
|
+
this.__drawPathByData(canvas, this.__.path, true);
|
|
8439
8478
|
}
|
|
8440
|
-
__drawPathByData(drawer, data) {
|
|
8441
|
-
data ? PathDrawer.drawPathByData(drawer, data) : this.__drawPathByBox(drawer);
|
|
8479
|
+
__drawPathByData(drawer, data, ignoreCornerRadius) {
|
|
8480
|
+
data ? PathDrawer.drawPathByData(drawer, data) : this.__drawPathByBox(drawer, ignoreCornerRadius);
|
|
8442
8481
|
}
|
|
8443
|
-
__drawPathByBox(drawer) {
|
|
8482
|
+
__drawPathByBox(drawer, ignoreCornerRadius) {
|
|
8444
8483
|
const {x: x, y: y, width: width, height: height} = this.__layout.boxBounds;
|
|
8445
|
-
if (this.__.cornerRadius) {
|
|
8484
|
+
if (this.__.cornerRadius && !ignoreCornerRadius) {
|
|
8446
8485
|
const {cornerRadius: cornerRadius} = this.__;
|
|
8447
8486
|
drawer.roundRect(x, y, width, height, isNumber(cornerRadius) ? [ cornerRadius ] : cornerRadius);
|
|
8448
8487
|
} else drawer.rect(x, y, width, height);
|
|
8488
|
+
drawer.closePath();
|
|
8449
8489
|
}
|
|
8450
8490
|
drawImagePlaceholder(_paint, canvas, renderOptions) {
|
|
8451
8491
|
Paint.fill(this.__.placeholderColor, this, canvas, renderOptions);
|
|
@@ -8714,6 +8754,9 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8714
8754
|
get layoutLocked() {
|
|
8715
8755
|
return !this.layouter.running;
|
|
8716
8756
|
}
|
|
8757
|
+
get view() {
|
|
8758
|
+
return this.canvas && this.canvas.view;
|
|
8759
|
+
}
|
|
8717
8760
|
get FPS() {
|
|
8718
8761
|
return this.renderer ? this.renderer.FPS : 60;
|
|
8719
8762
|
}
|
|
@@ -8765,7 +8808,6 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8765
8808
|
this.__controllers.push(this.renderer = Creator.renderer(this, canvas, config), this.watcher = Creator.watcher(this, config), this.layouter = Creator.layouter(this, config));
|
|
8766
8809
|
if (this.isApp) this.__setApp();
|
|
8767
8810
|
this.__checkAutoLayout();
|
|
8768
|
-
this.view = canvas.view;
|
|
8769
8811
|
if (!parentApp) {
|
|
8770
8812
|
this.selector = Creator.selector(this);
|
|
8771
8813
|
this.interaction = Creator.interaction(this, canvas, this.selector, config);
|
|
@@ -9045,7 +9087,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
9045
9087
|
if (this.canvasManager) this.canvasManager.destroy();
|
|
9046
9088
|
}
|
|
9047
9089
|
if (this.canvas) this.canvas.destroy();
|
|
9048
|
-
this.config.view = this.
|
|
9090
|
+
this.config.view = this.parentApp = null;
|
|
9049
9091
|
if (this.userConfig) this.userConfig.view = null;
|
|
9050
9092
|
super.destroy();
|
|
9051
9093
|
setTimeout(() => {
|
|
@@ -9229,7 +9271,6 @@ let Ellipse = class Ellipse extends UI {
|
|
|
9229
9271
|
if (startAngle || endAngle) {
|
|
9230
9272
|
if (innerRadius < 1) ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false);
|
|
9231
9273
|
ellipse(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
|
|
9232
|
-
if (innerRadius < 1) closePath$2(path);
|
|
9233
9274
|
} else {
|
|
9234
9275
|
if (innerRadius < 1) {
|
|
9235
9276
|
ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
|
|
@@ -9237,16 +9278,16 @@ let Ellipse = class Ellipse extends UI {
|
|
|
9237
9278
|
}
|
|
9238
9279
|
ellipse(path, rx, ry, rx, ry, 0, 360, 0, true);
|
|
9239
9280
|
}
|
|
9240
|
-
if (Platform.ellipseToCurve) this.__.path = this.getPath(true);
|
|
9241
9281
|
} else {
|
|
9242
9282
|
if (startAngle || endAngle) {
|
|
9243
9283
|
moveTo$3(path, rx, ry);
|
|
9244
9284
|
ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
|
|
9245
|
-
closePath$2(path);
|
|
9246
9285
|
} else {
|
|
9247
9286
|
ellipse(path, rx, ry, rx, ry);
|
|
9248
9287
|
}
|
|
9249
9288
|
}
|
|
9289
|
+
closePath$2(path);
|
|
9290
|
+
if (Platform.ellipseToCurve) this.__.path = this.getPath(true);
|
|
9250
9291
|
}
|
|
9251
9292
|
};
|
|
9252
9293
|
|
|
@@ -9897,7 +9938,7 @@ class UIEvent extends Event {
|
|
|
9897
9938
|
}
|
|
9898
9939
|
}
|
|
9899
9940
|
|
|
9900
|
-
const {min: min, max: max$1, abs: abs$3} = Math, {float: float$
|
|
9941
|
+
const {min: min, max: max$1, abs: abs$3} = Math, {float: float$2, sign: sign} = MathHelper, {minX: minX, maxX: maxX, minY: minY, maxY: maxY} = BoundsHelper;
|
|
9901
9942
|
|
|
9902
9943
|
const tempContent = new Bounds, tempDragBounds = new Bounds;
|
|
9903
9944
|
|
|
@@ -9937,8 +9978,8 @@ const DragBoundsHelper = {
|
|
|
9937
9978
|
} else {
|
|
9938
9979
|
if (y < dragBounds.y) move.y += dragBounds.y - y; else if (bottom > boundsBottom) move.y += boundsBottom - bottom;
|
|
9939
9980
|
}
|
|
9940
|
-
move.x = float$
|
|
9941
|
-
move.y = float$
|
|
9981
|
+
move.x = float$2(move.x);
|
|
9982
|
+
move.y = float$2(move.y);
|
|
9942
9983
|
return move;
|
|
9943
9984
|
},
|
|
9944
9985
|
getValidScaleOf(content, dragBounds, dragBoundsType, origin, scale, lockRatio, change) {
|
|
@@ -9950,26 +9991,26 @@ const DragBoundsHelper = {
|
|
|
9950
9991
|
let correctScaleX = 1, correctScaleY = 1, aScale, bScale, aSize, bSize;
|
|
9951
9992
|
if (D.isInnerMode(content, dragBounds, dragBoundsType, "width")) {
|
|
9952
9993
|
if (scale.x < 0) tempContent.scaleOf(origin, correctScaleX = 1 / scale.x, 1);
|
|
9953
|
-
aSize = float$
|
|
9954
|
-
bSize = float$
|
|
9994
|
+
aSize = float$2(tempContent.minX - tempDragBounds.minX);
|
|
9995
|
+
bSize = float$2(tempDragBounds.maxX - tempContent.maxX);
|
|
9955
9996
|
aScale = originLeftScale && aSize > 0 ? 1 + aSize / (originLeftScale * tempContent.width) : 1;
|
|
9956
9997
|
bScale = originRightScale && bSize > 0 ? 1 + bSize / (originRightScale * tempContent.width) : 1;
|
|
9957
9998
|
correctScaleX *= max$1(aScale, bScale);
|
|
9958
9999
|
} else {
|
|
9959
10000
|
if (scale.x < 0) {
|
|
9960
|
-
if (float$
|
|
10001
|
+
if (float$2(minX(content) - minX(dragBounds)) <= 0 || float$2(maxX(dragBounds) - maxX(content)) <= 0) tempContent.scaleOf(origin, correctScaleX = 1 / scale.x, 1);
|
|
9961
10002
|
tempContent.unsign();
|
|
9962
10003
|
}
|
|
9963
|
-
aSize = float$
|
|
9964
|
-
bSize = float$
|
|
10004
|
+
aSize = float$2(tempDragBounds.minX - tempContent.minX);
|
|
10005
|
+
bSize = float$2(tempContent.maxX - tempDragBounds.maxX);
|
|
9965
10006
|
aScale = originLeftScale && aSize > 0 ? 1 - aSize / (originLeftScale * tempContent.width) : 1;
|
|
9966
10007
|
bScale = originRightScale && bSize > 0 ? 1 - bSize / (originRightScale * tempContent.width) : 1;
|
|
9967
10008
|
correctScaleX *= min(aScale, bScale);
|
|
9968
10009
|
}
|
|
9969
10010
|
if (D.isInnerMode(content, dragBounds, dragBoundsType, "height")) {
|
|
9970
10011
|
if (scale.y < 0) tempContent.scaleOf(origin, 1, correctScaleY = 1 / scale.y);
|
|
9971
|
-
aSize = float$
|
|
9972
|
-
bSize = float$
|
|
10012
|
+
aSize = float$2(tempContent.minY - tempDragBounds.minY);
|
|
10013
|
+
bSize = float$2(tempDragBounds.maxY - tempContent.maxY);
|
|
9973
10014
|
aScale = originTopScale && aSize > 0 ? 1 + aSize / (originTopScale * tempContent.height) : 1;
|
|
9974
10015
|
bScale = originBottomScale && bSize > 0 ? 1 + bSize / (originBottomScale * tempContent.height) : 1;
|
|
9975
10016
|
correctScaleY *= max$1(aScale, bScale);
|
|
@@ -9980,11 +10021,11 @@ const DragBoundsHelper = {
|
|
|
9980
10021
|
}
|
|
9981
10022
|
} else {
|
|
9982
10023
|
if (scale.y < 0) {
|
|
9983
|
-
if (float$
|
|
10024
|
+
if (float$2(minY(content) - minY(dragBounds)) <= 0 || float$2(maxY(dragBounds) - maxY(content)) <= 0) tempContent.scaleOf(origin, 1, correctScaleY = 1 / scale.y);
|
|
9984
10025
|
tempContent.unsign();
|
|
9985
10026
|
}
|
|
9986
|
-
aSize = float$
|
|
9987
|
-
bSize = float$
|
|
10027
|
+
aSize = float$2(tempDragBounds.minY - tempContent.minY);
|
|
10028
|
+
bSize = float$2(tempContent.maxY - tempDragBounds.maxY);
|
|
9988
10029
|
aScale = originTopScale && aSize > 0 ? 1 - aSize / (originTopScale * tempContent.height) : 1;
|
|
9989
10030
|
bScale = originBottomScale && bSize > 0 ? 1 - bSize / (originBottomScale * tempContent.height) : 1;
|
|
9990
10031
|
correctScaleY *= min(aScale, bScale);
|
|
@@ -10136,8 +10177,14 @@ MoveEvent.START = "move.start";
|
|
|
10136
10177
|
|
|
10137
10178
|
MoveEvent.MOVE = "move";
|
|
10138
10179
|
|
|
10180
|
+
MoveEvent.DRAG_ANIMATE = "move.drag_animate";
|
|
10181
|
+
|
|
10139
10182
|
MoveEvent.END = "move.end";
|
|
10140
10183
|
|
|
10184
|
+
MoveEvent.PULL_DOWN = "move.pull_down";
|
|
10185
|
+
|
|
10186
|
+
MoveEvent.REACH_BOTTOM = "move.reach_bottom";
|
|
10187
|
+
|
|
10141
10188
|
MoveEvent = __decorate([ registerUIEvent() ], MoveEvent);
|
|
10142
10189
|
|
|
10143
10190
|
let TouchEvent = class TouchEvent extends UIEvent {};
|
|
@@ -10234,6 +10281,7 @@ const InteractionHelper = {
|
|
|
10234
10281
|
ctrlKey: e.ctrlKey,
|
|
10235
10282
|
shiftKey: e.shiftKey,
|
|
10236
10283
|
metaKey: e.metaKey,
|
|
10284
|
+
time: Date.now(),
|
|
10237
10285
|
buttons: isUndefined(e.buttons) ? 1 : e.buttons === 0 ? pointerUpButtons : e.buttons,
|
|
10238
10286
|
origin: e
|
|
10239
10287
|
};
|
|
@@ -10269,6 +10317,7 @@ const {getDragEventData: getDragEventData, getDropEventData: getDropEventData, g
|
|
|
10269
10317
|
|
|
10270
10318
|
class Dragger {
|
|
10271
10319
|
constructor(interaction) {
|
|
10320
|
+
this.dragDataList = [];
|
|
10272
10321
|
this.interaction = interaction;
|
|
10273
10322
|
}
|
|
10274
10323
|
setDragData(data) {
|
|
@@ -10331,6 +10380,7 @@ class Dragger {
|
|
|
10331
10380
|
this.dragData = getDragEventData(downData, dragData, data);
|
|
10332
10381
|
if (throughPath) this.dragData.throughPath = throughPath;
|
|
10333
10382
|
this.dragData.path = path;
|
|
10383
|
+
this.dragDataList.push(this.dragData);
|
|
10334
10384
|
if (this.moving) {
|
|
10335
10385
|
data.moving = true;
|
|
10336
10386
|
this.dragData.moveType = "drag";
|
|
@@ -10381,9 +10431,9 @@ class Dragger {
|
|
|
10381
10431
|
interaction.emit(DragEvent.ENTER, data, path, dragEnterPath);
|
|
10382
10432
|
this.dragEnterPath = path;
|
|
10383
10433
|
}
|
|
10384
|
-
dragEnd(data
|
|
10434
|
+
dragEnd(data) {
|
|
10385
10435
|
if (!this.dragging && !this.moving) return;
|
|
10386
|
-
if (this.checkDragEndAnimate(data
|
|
10436
|
+
if (this.checkDragEndAnimate(data)) return;
|
|
10387
10437
|
this.dragEndReal(data);
|
|
10388
10438
|
}
|
|
10389
10439
|
dragEndReal(data) {
|
|
@@ -10425,11 +10475,13 @@ class Dragger {
|
|
|
10425
10475
|
}
|
|
10426
10476
|
dragReset() {
|
|
10427
10477
|
DragEvent.list = DragEvent.data = this.draggableList = this.dragData = this.downData = this.dragOverPath = this.dragEnterPath = null;
|
|
10478
|
+
this.dragDataList = [];
|
|
10428
10479
|
}
|
|
10429
10480
|
checkDragEndAnimate(_data, _speed) {
|
|
10430
10481
|
return false;
|
|
10431
10482
|
}
|
|
10432
10483
|
animate(_func, _off) {}
|
|
10484
|
+
stopAnimate() {}
|
|
10433
10485
|
checkDragOut(_data) {}
|
|
10434
10486
|
autoMoveOnDragOut(_data) {}
|
|
10435
10487
|
autoMoveCancel() {}
|
|
@@ -10823,6 +10875,9 @@ class InteractionBase {
|
|
|
10823
10875
|
this.pointerHover(hoverData);
|
|
10824
10876
|
}
|
|
10825
10877
|
}
|
|
10878
|
+
stopDragAnimate() {
|
|
10879
|
+
this.dragger.stopAnimate();
|
|
10880
|
+
}
|
|
10826
10881
|
updateDownData(data, options, merge) {
|
|
10827
10882
|
const {downData: downData} = this;
|
|
10828
10883
|
if (!data && downData) data = downData;
|
|
@@ -11006,7 +11061,7 @@ Platform.getSelector = function(leaf) {
|
|
|
11006
11061
|
return leaf.leafer ? leaf.leafer.selector : Platform.selector || (Platform.selector = Creator.selector());
|
|
11007
11062
|
};
|
|
11008
11063
|
|
|
11009
|
-
const {toInnerRadiusPointOf: toInnerRadiusPointOf,
|
|
11064
|
+
const {toInnerRadiusPointOf: toInnerRadiusPointOf, copyRadiusPoint: copyRadiusPoint} = PointHelper;
|
|
11010
11065
|
|
|
11011
11066
|
const {hitRadiusPoint: hitRadiusPoint, hitPoint: hitPoint} = BoundsHelper;
|
|
11012
11067
|
|
|
@@ -11016,8 +11071,7 @@ const leaf = Leaf.prototype;
|
|
|
11016
11071
|
|
|
11017
11072
|
leaf.hit = function(worldPoint, hitRadius = 0) {
|
|
11018
11073
|
this.updateLayout();
|
|
11019
|
-
|
|
11020
|
-
setRadius(worldRadiusPoint, hitRadius);
|
|
11074
|
+
copyRadiusPoint(worldRadiusPoint, worldPoint, hitRadius);
|
|
11021
11075
|
const world = this.__world;
|
|
11022
11076
|
if (hitRadius ? !hitRadiusPoint(world, worldRadiusPoint) : !hitPoint(world, worldRadiusPoint)) return false;
|
|
11023
11077
|
return this.isBranch ? Platform.getSelector(this).hitPoint(Object.assign({}, worldRadiusPoint), hitRadius, {
|
|
@@ -11031,8 +11085,8 @@ leaf.__hitWorld = function(point, forceHitFill) {
|
|
|
11031
11085
|
const world = this.__world, layout = this.__layout;
|
|
11032
11086
|
const isSmall = world.width < 10 && world.height < 10;
|
|
11033
11087
|
if (data.hitRadius) {
|
|
11034
|
-
|
|
11035
|
-
|
|
11088
|
+
copyRadiusPoint(inner, point, data.hitRadius);
|
|
11089
|
+
point = inner;
|
|
11036
11090
|
}
|
|
11037
11091
|
toInnerRadiusPointOf(point, world, inner);
|
|
11038
11092
|
if (data.hitBox || isSmall) {
|
|
@@ -11600,7 +11654,7 @@ function image(ui, attrName, paint, boxBounds, firstUse) {
|
|
|
11600
11654
|
ignoreRender(ui, false);
|
|
11601
11655
|
onLoadError(ui, event, error);
|
|
11602
11656
|
leafPaint.loadId = undefined;
|
|
11603
|
-
});
|
|
11657
|
+
}, paint.lod && image.getThumbSize());
|
|
11604
11658
|
if (ui.placeholderColor) {
|
|
11605
11659
|
if (!ui.placeholderDelay) image.isPlacehold = true; else setTimeout(() => {
|
|
11606
11660
|
if (!image.ready) {
|
|
@@ -11840,10 +11894,12 @@ const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$2} = Math;
|
|
|
11840
11894
|
function createPatternTask(paint, ui, canvas, renderOptions) {
|
|
11841
11895
|
if (!paint.patternTask) {
|
|
11842
11896
|
paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function*() {
|
|
11843
|
-
paint
|
|
11844
|
-
if (canvas.bounds.hit(ui.__nowWorld)) PaintImage.createPattern(paint, ui, canvas, renderOptions);
|
|
11897
|
+
PaintImage.createPattern(paint, ui, canvas, renderOptions);
|
|
11845
11898
|
ui.forceUpdate("surface");
|
|
11846
|
-
}),
|
|
11899
|
+
}), 0, () => {
|
|
11900
|
+
paint.patternTask = null;
|
|
11901
|
+
return canvas.bounds.hit(ui.__nowWorld);
|
|
11902
|
+
});
|
|
11847
11903
|
}
|
|
11848
11904
|
}
|
|
11849
11905
|
|
|
@@ -13572,6 +13628,8 @@ let Animate = class Animate extends Eventer {
|
|
|
13572
13628
|
}
|
|
13573
13629
|
constructor(target, keyframe, options, isTemp) {
|
|
13574
13630
|
super();
|
|
13631
|
+
this.nowIndex = 0;
|
|
13632
|
+
this.playedTotalTime = 0;
|
|
13575
13633
|
if (keyframe) {
|
|
13576
13634
|
if (keyframe.keyframes) options = keyframe, keyframe = keyframe.keyframes; else if (keyframe.style) options = keyframe,
|
|
13577
13635
|
keyframe = keyframe.style;
|
|
@@ -13618,7 +13676,7 @@ let Animate = class Animate extends Eventer {
|
|
|
13618
13676
|
play() {
|
|
13619
13677
|
if (this.destroyed) return;
|
|
13620
13678
|
this.running = true;
|
|
13621
|
-
if (!this.started) this.clearTimer(), this.start(); else if (!this.timer) this.
|
|
13679
|
+
if (!this.started) this.clearTimer(), this.start(); else if (!this.timer) this.startRequestAnimate();
|
|
13622
13680
|
this.emitType(AnimateEvent.PLAY);
|
|
13623
13681
|
}
|
|
13624
13682
|
pause() {
|
|
@@ -13632,14 +13690,28 @@ let Animate = class Animate extends Eventer {
|
|
|
13632
13690
|
this.complete();
|
|
13633
13691
|
this.emitType(AnimateEvent.STOP);
|
|
13634
13692
|
}
|
|
13635
|
-
seek(time) {
|
|
13693
|
+
seek(time, includeDelay) {
|
|
13636
13694
|
if (this.destroyed) return;
|
|
13637
|
-
|
|
13695
|
+
const {delay: delay} = this;
|
|
13696
|
+
if (isObject(time)) time = UnitConvert.number(time, this.duration + (includeDelay ? delay : 0));
|
|
13697
|
+
if (includeDelay) time -= delay;
|
|
13638
13698
|
if (time) time /= this.speed;
|
|
13639
|
-
|
|
13699
|
+
let waitBeginTime;
|
|
13700
|
+
if (time < 0) {
|
|
13701
|
+
waitBeginTime = -time;
|
|
13702
|
+
time = 0;
|
|
13703
|
+
}
|
|
13704
|
+
if (!this.started || time < this.time || !time) this.start(true);
|
|
13640
13705
|
this.time = time;
|
|
13641
|
-
this.animate(0, true);
|
|
13642
|
-
this.clearTimer(() =>
|
|
13706
|
+
if (!waitBeginTime) this.animate(0, true);
|
|
13707
|
+
this.clearTimer(() => {
|
|
13708
|
+
if (waitBeginTime) {
|
|
13709
|
+
this.timer = setTimeout(() => {
|
|
13710
|
+
this.timer = 0;
|
|
13711
|
+
this.begin();
|
|
13712
|
+
}, waitBeginTime * 1e3);
|
|
13713
|
+
} else this.startRequestAnimate();
|
|
13714
|
+
});
|
|
13643
13715
|
this.emitType(AnimateEvent.SEEK);
|
|
13644
13716
|
}
|
|
13645
13717
|
kill(complete = true, killStyle) {
|
|
@@ -13722,14 +13794,24 @@ let Animate = class Animate extends Eventer {
|
|
|
13722
13794
|
}
|
|
13723
13795
|
}
|
|
13724
13796
|
}
|
|
13725
|
-
|
|
13797
|
+
startRequestAnimate() {
|
|
13726
13798
|
this.requestAnimateTime = Date.now();
|
|
13799
|
+
this.requestAnimatePageTime = 0;
|
|
13800
|
+
if (!this.waitRequestRender) this.requestAnimate();
|
|
13801
|
+
}
|
|
13802
|
+
requestAnimate() {
|
|
13803
|
+
this.waitRequestRender = true;
|
|
13727
13804
|
Platform.requestRender(this.animate.bind(this));
|
|
13728
13805
|
}
|
|
13729
|
-
animate(
|
|
13806
|
+
animate(pageTime, seek) {
|
|
13730
13807
|
if (!seek) {
|
|
13808
|
+
this.waitRequestRender = false;
|
|
13731
13809
|
if (!this.running) return;
|
|
13732
|
-
|
|
13810
|
+
let frameTime;
|
|
13811
|
+
if (pageTime && this.requestAnimatePageTime) frameTime = pageTime - this.requestAnimatePageTime; else frameTime = Date.now() - this.requestAnimateTime;
|
|
13812
|
+
this.time += frameTime / 1e3;
|
|
13813
|
+
this.requestAnimatePageTime = pageTime;
|
|
13814
|
+
this.requestAnimateTime = Date.now();
|
|
13733
13815
|
}
|
|
13734
13816
|
const {duration: duration} = this, realTime = this.time * this.speed;
|
|
13735
13817
|
if (realTime < duration) {
|
|
@@ -13770,21 +13852,24 @@ let Animate = class Animate extends Eventer {
|
|
|
13770
13852
|
}
|
|
13771
13853
|
start(seek) {
|
|
13772
13854
|
this.requestAnimateTime = 1;
|
|
13773
|
-
const {reverse: reverse} = this;
|
|
13855
|
+
const {reverse: reverse, jump: jump} = this;
|
|
13774
13856
|
if (reverse || this.mainReverse) this.mainReverse = reverse;
|
|
13775
13857
|
if (this.looped) this.looped = 0;
|
|
13776
13858
|
if (seek) this.begin(true); else {
|
|
13777
13859
|
const {delay: delay} = this;
|
|
13778
|
-
if (delay)
|
|
13779
|
-
this.
|
|
13780
|
-
this.
|
|
13781
|
-
|
|
13860
|
+
if (delay) {
|
|
13861
|
+
if (jump) this.begin(true);
|
|
13862
|
+
this.timer = setTimeout(() => {
|
|
13863
|
+
this.timer = 0;
|
|
13864
|
+
this.begin();
|
|
13865
|
+
}, delay / this.speed * 1e3);
|
|
13866
|
+
} else this.begin();
|
|
13782
13867
|
}
|
|
13783
13868
|
}
|
|
13784
13869
|
begin(seek) {
|
|
13785
13870
|
this.playedTotalTime = this.time = 0;
|
|
13786
13871
|
this.mainReverse ? this.setTo() : this.setFrom();
|
|
13787
|
-
if (!seek) this.
|
|
13872
|
+
if (!seek) this.startRequestAnimate();
|
|
13788
13873
|
}
|
|
13789
13874
|
end() {
|
|
13790
13875
|
this.mainReverse ? this.setFrom() : this.setTo();
|
|
@@ -13900,6 +13985,8 @@ __decorate([ animateAttr(true) ], Animate.prototype, "autoplay", void 0);
|
|
|
13900
13985
|
|
|
13901
13986
|
__decorate([ animateAttr() ], Animate.prototype, "join", void 0);
|
|
13902
13987
|
|
|
13988
|
+
__decorate([ animateAttr() ], Animate.prototype, "jump", void 0);
|
|
13989
|
+
|
|
13903
13990
|
__decorate([ animateAttr() ], Animate.prototype, "attrs", void 0);
|
|
13904
13991
|
|
|
13905
13992
|
Animate = __decorate([ useModule(LeafEventer) ], Animate);
|
|
@@ -13946,8 +14033,8 @@ let AnimateList = class AnimateList extends Animate {
|
|
|
13946
14033
|
this.each(item => item.stop());
|
|
13947
14034
|
this.emitType(AnimateEvent.STOP);
|
|
13948
14035
|
}
|
|
13949
|
-
seek(time) {
|
|
13950
|
-
this.each(item => item.seek(time));
|
|
14036
|
+
seek(time, includeDelay) {
|
|
14037
|
+
this.each(item => item.seek(time, includeDelay));
|
|
13951
14038
|
this.emitType(AnimateEvent.SEEK);
|
|
13952
14039
|
}
|
|
13953
14040
|
kill(complete, killStyle) {
|
|
@@ -14138,7 +14225,7 @@ const hslMatch = /^hsl\((\d+),\s*(\d+)%\s*,\s*(\d+)%/i;
|
|
|
14138
14225
|
|
|
14139
14226
|
const hslaMatch = /^hsla\((\d+),\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d*\.?\d+)/i;
|
|
14140
14227
|
|
|
14141
|
-
const int = parseInt, float = parseFloat, {round: round$1} = Math;
|
|
14228
|
+
const int = parseInt, float$1 = parseFloat, {round: round$1} = Math;
|
|
14142
14229
|
|
|
14143
14230
|
let cache = {}, totalCache = 0;
|
|
14144
14231
|
|
|
@@ -14251,18 +14338,18 @@ function rgbaToRGBA(color) {
|
|
|
14251
14338
|
r: int(match[1]),
|
|
14252
14339
|
g: int(match[2]),
|
|
14253
14340
|
b: int(match[3]),
|
|
14254
|
-
a: float(match[4])
|
|
14341
|
+
a: float$1(match[4])
|
|
14255
14342
|
};
|
|
14256
14343
|
}
|
|
14257
14344
|
|
|
14258
14345
|
function hslToRGBA(color) {
|
|
14259
14346
|
const match = hslMatch.exec(color);
|
|
14260
|
-
return hsla(float(match[1]), float(match[2]), float(match[3]), 1);
|
|
14347
|
+
return hsla(float$1(match[1]), float$1(match[2]), float$1(match[3]), 1);
|
|
14261
14348
|
}
|
|
14262
14349
|
|
|
14263
14350
|
function hslaToRGBA(color) {
|
|
14264
14351
|
const match = hslaMatch.exec(color);
|
|
14265
|
-
return hsla(float(match[1]), float(match[2]), float(match[3]), float(match[4]));
|
|
14352
|
+
return hsla(float$1(match[1]), float$1(match[2]), float$1(match[3]), float$1(match[4]));
|
|
14266
14353
|
}
|
|
14267
14354
|
|
|
14268
14355
|
const n1 = 1 / 6, n2 = .5, n3 = 2 / 3, n4 = 1 / 3;
|
|
@@ -14501,7 +14588,7 @@ const HighBezierHelper = {
|
|
|
14501
14588
|
|
|
14502
14589
|
const {getDistance: getDistance} = HighBezierHelper;
|
|
14503
14590
|
|
|
14504
|
-
const {M: M, L: L, C: C, Z: Z} = PathCommandMap;
|
|
14591
|
+
const {M: M, L: L, C: C, Z: Z} = PathCommandMap, {float: float} = MathHelper;
|
|
14505
14592
|
|
|
14506
14593
|
const tempPoint = {}, tempFrom = {};
|
|
14507
14594
|
|
|
@@ -14638,7 +14725,7 @@ const HighCurveHelper = {
|
|
|
14638
14725
|
getDistancePath(distanceData, motionDistance, motionPrecision) {
|
|
14639
14726
|
const {segments: segments, data: data} = distanceData, path = [];
|
|
14640
14727
|
motionDistance = UnitConvert.number(motionDistance, distanceData.total);
|
|
14641
|
-
let total = 0, distance, to = {};
|
|
14728
|
+
let total = 0, distance, cutDistance, to = {};
|
|
14642
14729
|
let i = 0, index = 0, x = 0, y = 0, toX, toY, command;
|
|
14643
14730
|
let x1, y1, x2, y2, t;
|
|
14644
14731
|
const len = data.length;
|
|
@@ -14650,14 +14737,17 @@ const HighCurveHelper = {
|
|
|
14650
14737
|
toX = data[i + 1];
|
|
14651
14738
|
toY = data[i + 2];
|
|
14652
14739
|
distance = segments[index];
|
|
14653
|
-
if (total + distance
|
|
14740
|
+
if (total + distance > motionDistance || !distanceData.total) {
|
|
14654
14741
|
if (!i) x = toX, y = toY;
|
|
14655
14742
|
tempFrom.x = x;
|
|
14656
14743
|
tempFrom.y = y;
|
|
14657
14744
|
to.x = toX;
|
|
14658
14745
|
to.y = toY;
|
|
14659
|
-
|
|
14660
|
-
|
|
14746
|
+
cutDistance = float(motionDistance - total);
|
|
14747
|
+
if (cutDistance) {
|
|
14748
|
+
PointHelper.getDistancePoint(tempFrom, to, cutDistance, true);
|
|
14749
|
+
path.push(command, to.x, to.y);
|
|
14750
|
+
}
|
|
14661
14751
|
return path;
|
|
14662
14752
|
}
|
|
14663
14753
|
x = toX;
|
|
@@ -14671,9 +14761,12 @@ const HighCurveHelper = {
|
|
|
14671
14761
|
toX = data[i + 5];
|
|
14672
14762
|
toY = data[i + 6];
|
|
14673
14763
|
distance = segments[index];
|
|
14674
|
-
if (total + distance
|
|
14675
|
-
|
|
14676
|
-
|
|
14764
|
+
if (total + distance > motionDistance) {
|
|
14765
|
+
cutDistance = float(motionDistance - total);
|
|
14766
|
+
if (cutDistance) {
|
|
14767
|
+
t = HighBezierHelper.getT(cutDistance, distance, x, y, x1, y1, x2, y2, toX, toY, motionPrecision);
|
|
14768
|
+
HighBezierHelper.cut(path, t, x, y, x1, y1, x2, y2, toX, toY);
|
|
14769
|
+
}
|
|
14677
14770
|
return path;
|
|
14678
14771
|
}
|
|
14679
14772
|
x = toX;
|
|
@@ -14882,6 +14975,7 @@ class Finder {
|
|
|
14882
14975
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
14883
14976
|
child = children[i];
|
|
14884
14977
|
result = method(child, options);
|
|
14978
|
+
if (typeof result === "boolean") result = result ? 1 : 0;
|
|
14885
14979
|
if (result === Yes || result === YesAndSkip) {
|
|
14886
14980
|
if (list) {
|
|
14887
14981
|
list.push(child);
|
|
@@ -14946,4 +15040,4 @@ Creator.finder = function(target) {
|
|
|
14946
15040
|
return new Finder(target);
|
|
14947
15041
|
};
|
|
14948
15042
|
|
|
14949
|
-
export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, FourNumberHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TouchEvent, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$2 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$
|
|
15043
|
+
export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, FourNumberHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TouchEvent, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$2 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$4 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
|