@leafer-game/miniapp 1.12.0 → 1.12.2
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/miniapp.module.js +248 -136
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +12 -12
package/dist/miniapp.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));
|
|
@@ -4627,7 +4641,7 @@ function registerUIEvent() {
|
|
|
4627
4641
|
};
|
|
4628
4642
|
}
|
|
4629
4643
|
|
|
4630
|
-
const {copy: copy$
|
|
4644
|
+
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
4645
|
|
|
4632
4646
|
const matrix$1 = {}, {round: round$3} = Math;
|
|
4633
4647
|
|
|
@@ -4725,7 +4739,7 @@ const LeafHelper = {
|
|
|
4725
4739
|
if (scaleY) transition = scaleY;
|
|
4726
4740
|
scaleY = scaleX;
|
|
4727
4741
|
}
|
|
4728
|
-
copy$
|
|
4742
|
+
copy$5(matrix$1, o);
|
|
4729
4743
|
scaleOfOuter$2(matrix$1, origin, scaleX, scaleY);
|
|
4730
4744
|
if (L$1.hasHighPosition(t)) {
|
|
4731
4745
|
L$1.setTransform(t, matrix$1, resize, transition);
|
|
@@ -4744,7 +4758,7 @@ const LeafHelper = {
|
|
|
4744
4758
|
},
|
|
4745
4759
|
rotateOfLocal(t, origin, angle, transition) {
|
|
4746
4760
|
const o = t.__localMatrix;
|
|
4747
|
-
copy$
|
|
4761
|
+
copy$5(matrix$1, o);
|
|
4748
4762
|
rotateOfOuter$2(matrix$1, origin, angle);
|
|
4749
4763
|
if (L$1.hasHighPosition(t)) L$1.setTransform(t, matrix$1, false, transition); else t.set({
|
|
4750
4764
|
x: t.x + matrix$1.e - o.e,
|
|
@@ -4756,18 +4770,18 @@ const LeafHelper = {
|
|
|
4756
4770
|
L$1.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize, transition);
|
|
4757
4771
|
},
|
|
4758
4772
|
skewOfLocal(t, origin, skewX, skewY = 0, resize, transition) {
|
|
4759
|
-
copy$
|
|
4773
|
+
copy$5(matrix$1, t.__localMatrix);
|
|
4760
4774
|
skewOfOuter(matrix$1, origin, skewX, skewY);
|
|
4761
4775
|
L$1.setTransform(t, matrix$1, resize, transition);
|
|
4762
4776
|
},
|
|
4763
4777
|
transformWorld(t, transform, resize, transition) {
|
|
4764
|
-
copy$
|
|
4778
|
+
copy$5(matrix$1, t.worldTransform);
|
|
4765
4779
|
multiplyParent$3(matrix$1, transform);
|
|
4766
4780
|
if (t.parent) divideParent(matrix$1, t.parent.scrollWorldTransform);
|
|
4767
4781
|
L$1.setTransform(t, matrix$1, resize, transition);
|
|
4768
4782
|
},
|
|
4769
4783
|
transform(t, transform, resize, transition) {
|
|
4770
|
-
copy$
|
|
4784
|
+
copy$5(matrix$1, t.localTransform);
|
|
4771
4785
|
multiplyParent$3(matrix$1, transform);
|
|
4772
4786
|
L$1.setTransform(t, matrix$1, resize, transition);
|
|
4773
4787
|
},
|
|
@@ -4805,7 +4819,7 @@ const LeafHelper = {
|
|
|
4805
4819
|
return innerOrigin;
|
|
4806
4820
|
},
|
|
4807
4821
|
getRelativeWorld(t, relative, temp) {
|
|
4808
|
-
copy$
|
|
4822
|
+
copy$5(matrix$1, t.worldTransform);
|
|
4809
4823
|
divideParent(matrix$1, relative.scrollWorldTransform);
|
|
4810
4824
|
return temp ? matrix$1 : Object.assign({}, matrix$1);
|
|
4811
4825
|
},
|
|
@@ -4951,10 +4965,53 @@ const BranchHelper = {
|
|
|
4951
4965
|
if (exclude && exclude === branch) continue;
|
|
4952
4966
|
updateBounds$4(branch);
|
|
4953
4967
|
}
|
|
4968
|
+
},
|
|
4969
|
+
move(branch, x, y) {
|
|
4970
|
+
let w;
|
|
4971
|
+
const {children: children} = branch;
|
|
4972
|
+
for (let i = 0, len = children.length; i < len; i++) {
|
|
4973
|
+
branch = children[i];
|
|
4974
|
+
w = branch.__world;
|
|
4975
|
+
w.e += x;
|
|
4976
|
+
w.f += y;
|
|
4977
|
+
w.x += x;
|
|
4978
|
+
w.y += y;
|
|
4979
|
+
if (branch.isBranch) move$3(branch, x, y);
|
|
4980
|
+
}
|
|
4981
|
+
},
|
|
4982
|
+
scale(branch, x, y, scaleX, scaleY, a, b) {
|
|
4983
|
+
let w;
|
|
4984
|
+
const {children: children} = branch;
|
|
4985
|
+
const changeScaleX = scaleX - 1;
|
|
4986
|
+
const changeScaleY = scaleY - 1;
|
|
4987
|
+
for (let i = 0, len = children.length; i < len; i++) {
|
|
4988
|
+
branch = children[i];
|
|
4989
|
+
w = branch.__world;
|
|
4990
|
+
w.a *= scaleX;
|
|
4991
|
+
w.d *= scaleY;
|
|
4992
|
+
if (w.b || w.c) {
|
|
4993
|
+
w.b *= scaleX;
|
|
4994
|
+
w.c *= scaleY;
|
|
4995
|
+
}
|
|
4996
|
+
if (w.e === w.x && w.f === w.y) {
|
|
4997
|
+
w.x = w.e += (w.e - a) * changeScaleX + x;
|
|
4998
|
+
w.y = w.f += (w.f - b) * changeScaleY + y;
|
|
4999
|
+
} else {
|
|
5000
|
+
w.e += (w.e - a) * changeScaleX + x;
|
|
5001
|
+
w.f += (w.f - b) * changeScaleY + y;
|
|
5002
|
+
w.x += (w.x - a) * changeScaleX + x;
|
|
5003
|
+
w.y += (w.y - b) * changeScaleY + y;
|
|
5004
|
+
}
|
|
5005
|
+
w.width *= scaleX;
|
|
5006
|
+
w.height *= scaleY;
|
|
5007
|
+
w.scaleX *= scaleX;
|
|
5008
|
+
w.scaleY *= scaleY;
|
|
5009
|
+
if (branch.isBranch) scale$1(branch, x, y, scaleX, scaleY, a, b);
|
|
5010
|
+
}
|
|
4954
5011
|
}
|
|
4955
5012
|
};
|
|
4956
5013
|
|
|
4957
|
-
const {pushAllChildBranch: pushAllChildBranch$1, pushAllBranchStack: pushAllBranchStack, updateBoundsByBranchStack: updateBoundsByBranchStack} = BranchHelper;
|
|
5014
|
+
const {pushAllChildBranch: pushAllChildBranch$1, pushAllBranchStack: pushAllBranchStack, updateBoundsByBranchStack: updateBoundsByBranchStack, move: move$3, scale: scale$1} = BranchHelper;
|
|
4958
5015
|
|
|
4959
5016
|
const WaitHelper = {
|
|
4960
5017
|
run(wait) {
|
|
@@ -4970,7 +5027,7 @@ const WaitHelper = {
|
|
|
4970
5027
|
|
|
4971
5028
|
const {getRelativeWorld: getRelativeWorld$1, updateBounds: updateBounds$3} = LeafHelper;
|
|
4972
5029
|
|
|
4973
|
-
const {toOuterOf: toOuterOf$3, getPoints: getPoints, copy: copy$
|
|
5030
|
+
const {toOuterOf: toOuterOf$3, getPoints: getPoints, copy: copy$4} = BoundsHelper;
|
|
4974
5031
|
|
|
4975
5032
|
const localContent = "_localContentBounds";
|
|
4976
5033
|
|
|
@@ -5209,7 +5266,7 @@ class LeafLayout {
|
|
|
5209
5266
|
matrix = getRelativeWorld$1(leaf, relative, true);
|
|
5210
5267
|
}
|
|
5211
5268
|
if (!layoutBounds) layoutBounds = MatrixHelper.getLayout(matrix);
|
|
5212
|
-
copy$
|
|
5269
|
+
copy$4(layoutBounds, bounds);
|
|
5213
5270
|
PointHelper.copy(layoutBounds, point);
|
|
5214
5271
|
if (unscale) {
|
|
5215
5272
|
const {scaleX: scaleX, scaleY: scaleY} = layoutBounds;
|
|
@@ -5831,7 +5888,7 @@ const LeafDataProxy = {
|
|
|
5831
5888
|
|
|
5832
5889
|
const {setLayout: setLayout, multiplyParent: multiplyParent$2, translateInner: translateInner, defaultWorld: defaultWorld} = MatrixHelper;
|
|
5833
5890
|
|
|
5834
|
-
const {toPoint: toPoint$3, tempPoint: tempPoint$
|
|
5891
|
+
const {toPoint: toPoint$3, tempPoint: tempPoint$2} = AroundHelper;
|
|
5835
5892
|
|
|
5836
5893
|
const LeafMatrix = {
|
|
5837
5894
|
__updateWorldMatrix() {
|
|
@@ -5851,8 +5908,8 @@ const LeafMatrix = {
|
|
|
5851
5908
|
local.e = data.x + data.offsetX;
|
|
5852
5909
|
local.f = data.y + data.offsetY;
|
|
5853
5910
|
if (data.around || data.origin) {
|
|
5854
|
-
toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint$
|
|
5855
|
-
translateInner(local, -tempPoint$
|
|
5911
|
+
toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint$2);
|
|
5912
|
+
translateInner(local, -tempPoint$2.x, -tempPoint$2.y, !data.around);
|
|
5856
5913
|
}
|
|
5857
5914
|
}
|
|
5858
5915
|
this.__layout.matrixChanged = undefined;
|
|
@@ -5863,7 +5920,7 @@ const {updateMatrix: updateMatrix$2, updateAllMatrix: updateAllMatrix$3} = LeafH
|
|
|
5863
5920
|
|
|
5864
5921
|
const {updateBounds: updateBounds$2} = BranchHelper;
|
|
5865
5922
|
|
|
5866
|
-
const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$2, copy: copy$
|
|
5923
|
+
const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$2, copy: copy$3} = BoundsHelper;
|
|
5867
5924
|
|
|
5868
5925
|
const {toBounds: toBounds} = PathBounds;
|
|
5869
5926
|
|
|
@@ -5974,7 +6031,7 @@ const LeafBounds = {
|
|
|
5974
6031
|
},
|
|
5975
6032
|
__updateRenderBounds(_bounds) {
|
|
5976
6033
|
const layout = this.__layout, {renderSpread: renderSpread} = layout;
|
|
5977
|
-
isNumber(renderSpread) && renderSpread <= 0 ? copy$
|
|
6034
|
+
isNumber(renderSpread) && renderSpread <= 0 ? copy$3(layout.renderBounds, layout.strokeBounds) : copyAndSpread$2(layout.renderBounds, layout.boxBounds, renderSpread);
|
|
5978
6035
|
}
|
|
5979
6036
|
};
|
|
5980
6037
|
|
|
@@ -6079,7 +6136,7 @@ const {toInnerPoint: toInnerPoint, toOuterPoint: toOuterPoint, multiplyParent: m
|
|
|
6079
6136
|
|
|
6080
6137
|
const {toOuterOf: toOuterOf$1} = BoundsHelper;
|
|
6081
6138
|
|
|
6082
|
-
const {copy: copy$
|
|
6139
|
+
const {copy: copy$2, move: move$2} = PointHelper;
|
|
6083
6140
|
|
|
6084
6141
|
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;
|
|
6085
6142
|
|
|
@@ -6398,14 +6455,14 @@ let Leaf = class Leaf {
|
|
|
6398
6455
|
if (this.parent) {
|
|
6399
6456
|
this.parent.worldToInner(world, to, distance, relative);
|
|
6400
6457
|
} else {
|
|
6401
|
-
if (to) copy$
|
|
6458
|
+
if (to) copy$2(to, world);
|
|
6402
6459
|
}
|
|
6403
6460
|
}
|
|
6404
6461
|
localToWorld(local, to, distance, relative) {
|
|
6405
6462
|
if (this.parent) {
|
|
6406
6463
|
this.parent.innerToWorld(local, to, distance, relative);
|
|
6407
6464
|
} else {
|
|
6408
|
-
if (to) copy$
|
|
6465
|
+
if (to) copy$2(to, local);
|
|
6409
6466
|
}
|
|
6410
6467
|
}
|
|
6411
6468
|
worldToInner(world, to, distance, relative) {
|
|
@@ -6518,10 +6575,10 @@ let Leaf = class Leaf {
|
|
|
6518
6575
|
hit(_world, _hitRadius) {
|
|
6519
6576
|
return true;
|
|
6520
6577
|
}
|
|
6521
|
-
__hitWorld(_point) {
|
|
6578
|
+
__hitWorld(_point, _forceHitFill) {
|
|
6522
6579
|
return true;
|
|
6523
6580
|
}
|
|
6524
|
-
__hit(_local) {
|
|
6581
|
+
__hit(_local, _forceHitFill) {
|
|
6525
6582
|
return true;
|
|
6526
6583
|
}
|
|
6527
6584
|
__hitFill(_inner) {
|
|
@@ -6880,7 +6937,7 @@ class LeafLevelList {
|
|
|
6880
6937
|
}
|
|
6881
6938
|
}
|
|
6882
6939
|
|
|
6883
|
-
const version = "1.12.
|
|
6940
|
+
const version = "1.12.2";
|
|
6884
6941
|
|
|
6885
6942
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6886
6943
|
get allowBackgroundColor() {
|
|
@@ -7682,6 +7739,10 @@ class Renderer {
|
|
|
7682
7739
|
|
|
7683
7740
|
Renderer.clipSpread = 10;
|
|
7684
7741
|
|
|
7742
|
+
const tempPoint$1 = {};
|
|
7743
|
+
|
|
7744
|
+
const {copyRadiusPoint: copyRadiusPoint$1} = PointHelper;
|
|
7745
|
+
|
|
7685
7746
|
const {hitRadiusPoint: hitRadiusPoint$1} = BoundsHelper;
|
|
7686
7747
|
|
|
7687
7748
|
class Picker {
|
|
@@ -7808,15 +7869,15 @@ class Picker {
|
|
|
7808
7869
|
this.eachFind(branch.children, branch.__onlyHitMask);
|
|
7809
7870
|
}
|
|
7810
7871
|
eachFind(children, hitMask) {
|
|
7811
|
-
let child, hit;
|
|
7872
|
+
let child, hit, data;
|
|
7812
7873
|
const {point: point} = this, len = children.length;
|
|
7813
7874
|
for (let i = len - 1; i > -1; i--) {
|
|
7814
|
-
child = children[i];
|
|
7815
|
-
if (!
|
|
7816
|
-
hit = child.
|
|
7875
|
+
child = children[i], data = child.__;
|
|
7876
|
+
if (!data.visible || hitMask && !data.mask) continue;
|
|
7877
|
+
hit = hitRadiusPoint$1(child.__world, data.hitRadius ? copyRadiusPoint$1(tempPoint$1, point, data.hitRadius) : point);
|
|
7817
7878
|
if (child.isBranch) {
|
|
7818
7879
|
if (hit || child.__ignoreHitWorld) {
|
|
7819
|
-
if (child.isBranchLeaf &&
|
|
7880
|
+
if (child.isBranchLeaf && data.__clipAfterFill && !child.__hitWorld(point, true)) continue;
|
|
7820
7881
|
if (child.topChildren) this.eachFind(child.topChildren, false);
|
|
7821
7882
|
this.eachFind(child.children, child.__onlyHitMask);
|
|
7822
7883
|
if (child.isBranchLeaf) this.hitChild(child, point);
|
|
@@ -8393,7 +8454,7 @@ const UIRender = {
|
|
|
8393
8454
|
if (stroke && !__fillAfterStroke) data.__isStrokes ? Paint.strokes(stroke, this, canvas, options) : Paint.stroke(stroke, this, canvas, options);
|
|
8394
8455
|
}
|
|
8395
8456
|
} else {
|
|
8396
|
-
if (data.
|
|
8457
|
+
if (data.__pathForRender) drawFast(this, canvas, options); else this.__drawFast(canvas, options);
|
|
8397
8458
|
}
|
|
8398
8459
|
},
|
|
8399
8460
|
__drawShape(canvas, options) {
|
|
@@ -8517,7 +8578,7 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8517
8578
|
getPath(curve, pathForRender) {
|
|
8518
8579
|
this.__layout.update();
|
|
8519
8580
|
let path = pathForRender ? this.__.__pathForRender : this.__.path;
|
|
8520
|
-
if (!path) pen.set(path = []), this.__drawPathByBox(pen);
|
|
8581
|
+
if (!path) pen.set(path = []), this.__drawPathByBox(pen, !pathForRender);
|
|
8521
8582
|
return curve ? PathConvert.toCanvasData(path, true) : path;
|
|
8522
8583
|
}
|
|
8523
8584
|
getPathString(curve, pathForRender, floatLength) {
|
|
@@ -8545,17 +8606,18 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8545
8606
|
}
|
|
8546
8607
|
__drawPath(canvas) {
|
|
8547
8608
|
canvas.beginPath();
|
|
8548
|
-
this.__drawPathByData(canvas, this.__.path);
|
|
8609
|
+
this.__drawPathByData(canvas, this.__.path, true);
|
|
8549
8610
|
}
|
|
8550
|
-
__drawPathByData(drawer, data) {
|
|
8551
|
-
data ? PathDrawer.drawPathByData(drawer, data) : this.__drawPathByBox(drawer);
|
|
8611
|
+
__drawPathByData(drawer, data, ignoreCornerRadius) {
|
|
8612
|
+
data ? PathDrawer.drawPathByData(drawer, data) : this.__drawPathByBox(drawer, ignoreCornerRadius);
|
|
8552
8613
|
}
|
|
8553
|
-
__drawPathByBox(drawer) {
|
|
8614
|
+
__drawPathByBox(drawer, ignoreCornerRadius) {
|
|
8554
8615
|
const {x: x, y: y, width: width, height: height} = this.__layout.boxBounds;
|
|
8555
|
-
if (this.__.cornerRadius) {
|
|
8616
|
+
if (this.__.cornerRadius && !ignoreCornerRadius) {
|
|
8556
8617
|
const {cornerRadius: cornerRadius} = this.__;
|
|
8557
8618
|
drawer.roundRect(x, y, width, height, isNumber(cornerRadius) ? [ cornerRadius ] : cornerRadius);
|
|
8558
8619
|
} else drawer.rect(x, y, width, height);
|
|
8620
|
+
drawer.closePath();
|
|
8559
8621
|
}
|
|
8560
8622
|
drawImagePlaceholder(_paint, canvas, renderOptions) {
|
|
8561
8623
|
Paint.fill(this.__.placeholderColor, this, canvas, renderOptions);
|
|
@@ -8824,6 +8886,9 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8824
8886
|
get layoutLocked() {
|
|
8825
8887
|
return !this.layouter.running;
|
|
8826
8888
|
}
|
|
8889
|
+
get view() {
|
|
8890
|
+
return this.canvas && this.canvas.view;
|
|
8891
|
+
}
|
|
8827
8892
|
get FPS() {
|
|
8828
8893
|
return this.renderer ? this.renderer.FPS : 60;
|
|
8829
8894
|
}
|
|
@@ -8875,7 +8940,6 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8875
8940
|
this.__controllers.push(this.renderer = Creator.renderer(this, canvas, config), this.watcher = Creator.watcher(this, config), this.layouter = Creator.layouter(this, config));
|
|
8876
8941
|
if (this.isApp) this.__setApp();
|
|
8877
8942
|
this.__checkAutoLayout();
|
|
8878
|
-
this.view = canvas.view;
|
|
8879
8943
|
if (!parentApp) {
|
|
8880
8944
|
this.selector = Creator.selector(this);
|
|
8881
8945
|
this.interaction = Creator.interaction(this, canvas, this.selector, config);
|
|
@@ -9155,7 +9219,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
9155
9219
|
if (this.canvasManager) this.canvasManager.destroy();
|
|
9156
9220
|
}
|
|
9157
9221
|
if (this.canvas) this.canvas.destroy();
|
|
9158
|
-
this.config.view = this.
|
|
9222
|
+
this.config.view = this.parentApp = null;
|
|
9159
9223
|
if (this.userConfig) this.userConfig.view = null;
|
|
9160
9224
|
super.destroy();
|
|
9161
9225
|
setTimeout(() => {
|
|
@@ -9339,7 +9403,6 @@ let Ellipse = class Ellipse extends UI {
|
|
|
9339
9403
|
if (startAngle || endAngle) {
|
|
9340
9404
|
if (innerRadius < 1) ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false);
|
|
9341
9405
|
ellipse(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
|
|
9342
|
-
if (innerRadius < 1) closePath$2(path);
|
|
9343
9406
|
} else {
|
|
9344
9407
|
if (innerRadius < 1) {
|
|
9345
9408
|
ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
|
|
@@ -9347,16 +9410,16 @@ let Ellipse = class Ellipse extends UI {
|
|
|
9347
9410
|
}
|
|
9348
9411
|
ellipse(path, rx, ry, rx, ry, 0, 360, 0, true);
|
|
9349
9412
|
}
|
|
9350
|
-
if (Platform.ellipseToCurve) this.__.path = this.getPath(true);
|
|
9351
9413
|
} else {
|
|
9352
9414
|
if (startAngle || endAngle) {
|
|
9353
9415
|
moveTo$3(path, rx, ry);
|
|
9354
9416
|
ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
|
|
9355
|
-
closePath$2(path);
|
|
9356
9417
|
} else {
|
|
9357
9418
|
ellipse(path, rx, ry, rx, ry);
|
|
9358
9419
|
}
|
|
9359
9420
|
}
|
|
9421
|
+
closePath$2(path);
|
|
9422
|
+
if (Platform.ellipseToCurve) this.__.path = this.getPath(true);
|
|
9360
9423
|
}
|
|
9361
9424
|
};
|
|
9362
9425
|
|
|
@@ -10007,7 +10070,7 @@ class UIEvent extends Event {
|
|
|
10007
10070
|
}
|
|
10008
10071
|
}
|
|
10009
10072
|
|
|
10010
|
-
const {min: min, max: max$1, abs: abs$3} = Math, {float: float$
|
|
10073
|
+
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;
|
|
10011
10074
|
|
|
10012
10075
|
const tempContent = new Bounds, tempDragBounds = new Bounds;
|
|
10013
10076
|
|
|
@@ -10047,8 +10110,8 @@ const DragBoundsHelper = {
|
|
|
10047
10110
|
} else {
|
|
10048
10111
|
if (y < dragBounds.y) move.y += dragBounds.y - y; else if (bottom > boundsBottom) move.y += boundsBottom - bottom;
|
|
10049
10112
|
}
|
|
10050
|
-
move.x = float$
|
|
10051
|
-
move.y = float$
|
|
10113
|
+
move.x = float$2(move.x);
|
|
10114
|
+
move.y = float$2(move.y);
|
|
10052
10115
|
return move;
|
|
10053
10116
|
},
|
|
10054
10117
|
getValidScaleOf(content, dragBounds, dragBoundsType, origin, scale, lockRatio, change) {
|
|
@@ -10060,26 +10123,26 @@ const DragBoundsHelper = {
|
|
|
10060
10123
|
let correctScaleX = 1, correctScaleY = 1, aScale, bScale, aSize, bSize;
|
|
10061
10124
|
if (D.isInnerMode(content, dragBounds, dragBoundsType, "width")) {
|
|
10062
10125
|
if (scale.x < 0) tempContent.scaleOf(origin, correctScaleX = 1 / scale.x, 1);
|
|
10063
|
-
aSize = float$
|
|
10064
|
-
bSize = float$
|
|
10126
|
+
aSize = float$2(tempContent.minX - tempDragBounds.minX);
|
|
10127
|
+
bSize = float$2(tempDragBounds.maxX - tempContent.maxX);
|
|
10065
10128
|
aScale = originLeftScale && aSize > 0 ? 1 + aSize / (originLeftScale * tempContent.width) : 1;
|
|
10066
10129
|
bScale = originRightScale && bSize > 0 ? 1 + bSize / (originRightScale * tempContent.width) : 1;
|
|
10067
10130
|
correctScaleX *= max$1(aScale, bScale);
|
|
10068
10131
|
} else {
|
|
10069
10132
|
if (scale.x < 0) {
|
|
10070
|
-
if (float$
|
|
10133
|
+
if (float$2(minX(content) - minX(dragBounds)) <= 0 || float$2(maxX(dragBounds) - maxX(content)) <= 0) tempContent.scaleOf(origin, correctScaleX = 1 / scale.x, 1);
|
|
10071
10134
|
tempContent.unsign();
|
|
10072
10135
|
}
|
|
10073
|
-
aSize = float$
|
|
10074
|
-
bSize = float$
|
|
10136
|
+
aSize = float$2(tempDragBounds.minX - tempContent.minX);
|
|
10137
|
+
bSize = float$2(tempContent.maxX - tempDragBounds.maxX);
|
|
10075
10138
|
aScale = originLeftScale && aSize > 0 ? 1 - aSize / (originLeftScale * tempContent.width) : 1;
|
|
10076
10139
|
bScale = originRightScale && bSize > 0 ? 1 - bSize / (originRightScale * tempContent.width) : 1;
|
|
10077
10140
|
correctScaleX *= min(aScale, bScale);
|
|
10078
10141
|
}
|
|
10079
10142
|
if (D.isInnerMode(content, dragBounds, dragBoundsType, "height")) {
|
|
10080
10143
|
if (scale.y < 0) tempContent.scaleOf(origin, 1, correctScaleY = 1 / scale.y);
|
|
10081
|
-
aSize = float$
|
|
10082
|
-
bSize = float$
|
|
10144
|
+
aSize = float$2(tempContent.minY - tempDragBounds.minY);
|
|
10145
|
+
bSize = float$2(tempDragBounds.maxY - tempContent.maxY);
|
|
10083
10146
|
aScale = originTopScale && aSize > 0 ? 1 + aSize / (originTopScale * tempContent.height) : 1;
|
|
10084
10147
|
bScale = originBottomScale && bSize > 0 ? 1 + bSize / (originBottomScale * tempContent.height) : 1;
|
|
10085
10148
|
correctScaleY *= max$1(aScale, bScale);
|
|
@@ -10090,11 +10153,11 @@ const DragBoundsHelper = {
|
|
|
10090
10153
|
}
|
|
10091
10154
|
} else {
|
|
10092
10155
|
if (scale.y < 0) {
|
|
10093
|
-
if (float$
|
|
10156
|
+
if (float$2(minY(content) - minY(dragBounds)) <= 0 || float$2(maxY(dragBounds) - maxY(content)) <= 0) tempContent.scaleOf(origin, 1, correctScaleY = 1 / scale.y);
|
|
10094
10157
|
tempContent.unsign();
|
|
10095
10158
|
}
|
|
10096
|
-
aSize = float$
|
|
10097
|
-
bSize = float$
|
|
10159
|
+
aSize = float$2(tempDragBounds.minY - tempContent.minY);
|
|
10160
|
+
bSize = float$2(tempContent.maxY - tempDragBounds.maxY);
|
|
10098
10161
|
aScale = originTopScale && aSize > 0 ? 1 - aSize / (originTopScale * tempContent.height) : 1;
|
|
10099
10162
|
bScale = originBottomScale && bSize > 0 ? 1 - bSize / (originBottomScale * tempContent.height) : 1;
|
|
10100
10163
|
correctScaleY *= min(aScale, bScale);
|
|
@@ -10246,6 +10309,8 @@ MoveEvent.START = "move.start";
|
|
|
10246
10309
|
|
|
10247
10310
|
MoveEvent.MOVE = "move";
|
|
10248
10311
|
|
|
10312
|
+
MoveEvent.DRAG_ANIMATE = "move.drag_animate";
|
|
10313
|
+
|
|
10249
10314
|
MoveEvent.END = "move.end";
|
|
10250
10315
|
|
|
10251
10316
|
MoveEvent = __decorate([ registerUIEvent() ], MoveEvent);
|
|
@@ -10344,6 +10409,7 @@ const InteractionHelper = {
|
|
|
10344
10409
|
ctrlKey: e.ctrlKey,
|
|
10345
10410
|
shiftKey: e.shiftKey,
|
|
10346
10411
|
metaKey: e.metaKey,
|
|
10412
|
+
time: Date.now(),
|
|
10347
10413
|
buttons: isUndefined(e.buttons) ? 1 : e.buttons === 0 ? pointerUpButtons : e.buttons,
|
|
10348
10414
|
origin: e
|
|
10349
10415
|
};
|
|
@@ -10379,6 +10445,7 @@ const {getDragEventData: getDragEventData, getDropEventData: getDropEventData, g
|
|
|
10379
10445
|
|
|
10380
10446
|
class Dragger {
|
|
10381
10447
|
constructor(interaction) {
|
|
10448
|
+
this.dragDataList = [];
|
|
10382
10449
|
this.interaction = interaction;
|
|
10383
10450
|
}
|
|
10384
10451
|
setDragData(data) {
|
|
@@ -10441,6 +10508,7 @@ class Dragger {
|
|
|
10441
10508
|
this.dragData = getDragEventData(downData, dragData, data);
|
|
10442
10509
|
if (throughPath) this.dragData.throughPath = throughPath;
|
|
10443
10510
|
this.dragData.path = path;
|
|
10511
|
+
this.dragDataList.push(this.dragData);
|
|
10444
10512
|
if (this.moving) {
|
|
10445
10513
|
data.moving = true;
|
|
10446
10514
|
this.dragData.moveType = "drag";
|
|
@@ -10491,9 +10559,9 @@ class Dragger {
|
|
|
10491
10559
|
interaction.emit(DragEvent.ENTER, data, path, dragEnterPath);
|
|
10492
10560
|
this.dragEnterPath = path;
|
|
10493
10561
|
}
|
|
10494
|
-
dragEnd(data
|
|
10562
|
+
dragEnd(data) {
|
|
10495
10563
|
if (!this.dragging && !this.moving) return;
|
|
10496
|
-
if (this.checkDragEndAnimate(data
|
|
10564
|
+
if (this.checkDragEndAnimate(data)) return;
|
|
10497
10565
|
this.dragEndReal(data);
|
|
10498
10566
|
}
|
|
10499
10567
|
dragEndReal(data) {
|
|
@@ -10535,11 +10603,13 @@ class Dragger {
|
|
|
10535
10603
|
}
|
|
10536
10604
|
dragReset() {
|
|
10537
10605
|
DragEvent.list = DragEvent.data = this.draggableList = this.dragData = this.downData = this.dragOverPath = this.dragEnterPath = null;
|
|
10606
|
+
this.dragDataList = [];
|
|
10538
10607
|
}
|
|
10539
10608
|
checkDragEndAnimate(_data, _speed) {
|
|
10540
10609
|
return false;
|
|
10541
10610
|
}
|
|
10542
10611
|
animate(_func, _off) {}
|
|
10612
|
+
stopAnimate() {}
|
|
10543
10613
|
checkDragOut(_data) {}
|
|
10544
10614
|
autoMoveOnDragOut(_data) {}
|
|
10545
10615
|
autoMoveCancel() {}
|
|
@@ -10933,6 +11003,9 @@ class InteractionBase {
|
|
|
10933
11003
|
this.pointerHover(hoverData);
|
|
10934
11004
|
}
|
|
10935
11005
|
}
|
|
11006
|
+
stopDragAnimate() {
|
|
11007
|
+
this.dragger.stopAnimate();
|
|
11008
|
+
}
|
|
10936
11009
|
updateDownData(data, options, merge) {
|
|
10937
11010
|
const {downData: downData} = this;
|
|
10938
11011
|
if (!data && downData) data = downData;
|
|
@@ -11116,7 +11189,7 @@ Platform.getSelector = function(leaf) {
|
|
|
11116
11189
|
return leaf.leafer ? leaf.leafer.selector : Platform.selector || (Platform.selector = Creator.selector());
|
|
11117
11190
|
};
|
|
11118
11191
|
|
|
11119
|
-
const {toInnerRadiusPointOf: toInnerRadiusPointOf,
|
|
11192
|
+
const {toInnerRadiusPointOf: toInnerRadiusPointOf, copyRadiusPoint: copyRadiusPoint} = PointHelper;
|
|
11120
11193
|
|
|
11121
11194
|
const {hitRadiusPoint: hitRadiusPoint, hitPoint: hitPoint} = BoundsHelper;
|
|
11122
11195
|
|
|
@@ -11126,8 +11199,7 @@ const leaf = Leaf.prototype;
|
|
|
11126
11199
|
|
|
11127
11200
|
leaf.hit = function(worldPoint, hitRadius = 0) {
|
|
11128
11201
|
this.updateLayout();
|
|
11129
|
-
|
|
11130
|
-
setRadius(worldRadiusPoint, hitRadius);
|
|
11202
|
+
copyRadiusPoint(worldRadiusPoint, worldPoint, hitRadius);
|
|
11131
11203
|
const world = this.__world;
|
|
11132
11204
|
if (hitRadius ? !hitRadiusPoint(world, worldRadiusPoint) : !hitPoint(world, worldRadiusPoint)) return false;
|
|
11133
11205
|
return this.isBranch ? Platform.getSelector(this).hitPoint(Object.assign({}, worldRadiusPoint), hitRadius, {
|
|
@@ -11135,14 +11207,14 @@ leaf.hit = function(worldPoint, hitRadius = 0) {
|
|
|
11135
11207
|
}) : this.__hitWorld(worldRadiusPoint);
|
|
11136
11208
|
};
|
|
11137
11209
|
|
|
11138
|
-
leaf.__hitWorld = function(point) {
|
|
11210
|
+
leaf.__hitWorld = function(point, forceHitFill) {
|
|
11139
11211
|
const data = this.__;
|
|
11140
11212
|
if (!data.hitSelf) return false;
|
|
11141
11213
|
const world = this.__world, layout = this.__layout;
|
|
11142
11214
|
const isSmall = world.width < 10 && world.height < 10;
|
|
11143
11215
|
if (data.hitRadius) {
|
|
11144
|
-
|
|
11145
|
-
|
|
11216
|
+
copyRadiusPoint(inner, point, data.hitRadius);
|
|
11217
|
+
point = inner;
|
|
11146
11218
|
}
|
|
11147
11219
|
toInnerRadiusPointOf(point, world, inner);
|
|
11148
11220
|
if (data.hitBox || isSmall) {
|
|
@@ -11153,7 +11225,7 @@ leaf.__hitWorld = function(point) {
|
|
|
11153
11225
|
this.__updateHitCanvas();
|
|
11154
11226
|
if (!layout.boundsChanged) layout.hitCanvasChanged = false;
|
|
11155
11227
|
}
|
|
11156
|
-
return this.__hit(inner);
|
|
11228
|
+
return this.__hit(inner, forceHitFill);
|
|
11157
11229
|
};
|
|
11158
11230
|
|
|
11159
11231
|
leaf.__hitFill = function(inner) {
|
|
@@ -11220,12 +11292,12 @@ ui$5.__updateHitCanvas = function() {
|
|
|
11220
11292
|
h.setStrokeOptions(data);
|
|
11221
11293
|
};
|
|
11222
11294
|
|
|
11223
|
-
ui$5.__hit = function(inner) {
|
|
11295
|
+
ui$5.__hit = function(inner, forceHitFill) {
|
|
11224
11296
|
if (this.__box && this.__box.__hit(inner)) return true;
|
|
11225
11297
|
const data = this.__;
|
|
11226
11298
|
if (data.__isHitPixel && this.__hitPixel(inner)) return true;
|
|
11227
11299
|
const {hitFill: hitFill} = data;
|
|
11228
|
-
const needHitFillPath = (data.fill || data.__isCanvas) && (hitFill === "path" || hitFill === "pixel" && !(data.__isAlphaPixelFill || data.__isCanvas)) || hitFill === "all";
|
|
11300
|
+
const needHitFillPath = (data.fill || data.__isCanvas) && (hitFill === "path" || hitFill === "pixel" && !(data.__isAlphaPixelFill || data.__isCanvas)) || hitFill === "all" || forceHitFill;
|
|
11229
11301
|
if (needHitFillPath && this.__hitFill(inner)) return true;
|
|
11230
11302
|
const {hitStroke: hitStroke, __maxStrokeWidth: strokeWidth} = data;
|
|
11231
11303
|
const needHitStrokePath = data.stroke && (hitStroke === "path" || hitStroke === "pixel" && !data.__isAlphaPixelStroke) || hitStroke === "all";
|
|
@@ -12062,10 +12134,12 @@ const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$2} = Math;
|
|
|
12062
12134
|
function createPatternTask(paint, ui, canvas, renderOptions) {
|
|
12063
12135
|
if (!paint.patternTask) {
|
|
12064
12136
|
paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function*() {
|
|
12065
|
-
paint
|
|
12066
|
-
if (canvas.bounds.hit(ui.__nowWorld)) PaintImage.createPattern(paint, ui, canvas, renderOptions);
|
|
12137
|
+
PaintImage.createPattern(paint, ui, canvas, renderOptions);
|
|
12067
12138
|
ui.forceUpdate("surface");
|
|
12068
|
-
}),
|
|
12139
|
+
}), 0, () => {
|
|
12140
|
+
paint.patternTask = null;
|
|
12141
|
+
return canvas.bounds.hit(ui.__nowWorld);
|
|
12142
|
+
});
|
|
12069
12143
|
}
|
|
12070
12144
|
}
|
|
12071
12145
|
|
|
@@ -13800,6 +13874,8 @@ let Animate = class Animate extends Eventer {
|
|
|
13800
13874
|
}
|
|
13801
13875
|
constructor(target, keyframe, options, isTemp) {
|
|
13802
13876
|
super();
|
|
13877
|
+
this.nowIndex = 0;
|
|
13878
|
+
this.playedTotalTime = 0;
|
|
13803
13879
|
if (keyframe) {
|
|
13804
13880
|
if (keyframe.keyframes) options = keyframe, keyframe = keyframe.keyframes; else if (keyframe.style) options = keyframe,
|
|
13805
13881
|
keyframe = keyframe.style;
|
|
@@ -13846,7 +13922,7 @@ let Animate = class Animate extends Eventer {
|
|
|
13846
13922
|
play() {
|
|
13847
13923
|
if (this.destroyed) return;
|
|
13848
13924
|
this.running = true;
|
|
13849
|
-
if (!this.started) this.clearTimer(), this.start(); else if (!this.timer) this.
|
|
13925
|
+
if (!this.started) this.clearTimer(), this.start(); else if (!this.timer) this.startRequestAnimate();
|
|
13850
13926
|
this.emitType(AnimateEvent.PLAY);
|
|
13851
13927
|
}
|
|
13852
13928
|
pause() {
|
|
@@ -13860,14 +13936,28 @@ let Animate = class Animate extends Eventer {
|
|
|
13860
13936
|
this.complete();
|
|
13861
13937
|
this.emitType(AnimateEvent.STOP);
|
|
13862
13938
|
}
|
|
13863
|
-
seek(time) {
|
|
13939
|
+
seek(time, includeDelay) {
|
|
13864
13940
|
if (this.destroyed) return;
|
|
13865
|
-
|
|
13941
|
+
const {delay: delay} = this;
|
|
13942
|
+
if (isObject(time)) time = UnitConvert.number(time, this.duration + (includeDelay ? delay : 0));
|
|
13943
|
+
if (includeDelay) time -= delay;
|
|
13866
13944
|
if (time) time /= this.speed;
|
|
13867
|
-
|
|
13945
|
+
let waitBeginTime;
|
|
13946
|
+
if (time < 0) {
|
|
13947
|
+
waitBeginTime = -time;
|
|
13948
|
+
time = 0;
|
|
13949
|
+
}
|
|
13950
|
+
if (!this.started || time < this.time || !time) this.start(true);
|
|
13868
13951
|
this.time = time;
|
|
13869
|
-
this.animate(0, true);
|
|
13870
|
-
this.clearTimer(() =>
|
|
13952
|
+
if (!waitBeginTime) this.animate(0, true);
|
|
13953
|
+
this.clearTimer(() => {
|
|
13954
|
+
if (waitBeginTime) {
|
|
13955
|
+
this.timer = setTimeout(() => {
|
|
13956
|
+
this.timer = 0;
|
|
13957
|
+
this.begin();
|
|
13958
|
+
}, waitBeginTime * 1e3);
|
|
13959
|
+
} else this.startRequestAnimate();
|
|
13960
|
+
});
|
|
13871
13961
|
this.emitType(AnimateEvent.SEEK);
|
|
13872
13962
|
}
|
|
13873
13963
|
kill(complete = true, killStyle) {
|
|
@@ -13950,14 +14040,24 @@ let Animate = class Animate extends Eventer {
|
|
|
13950
14040
|
}
|
|
13951
14041
|
}
|
|
13952
14042
|
}
|
|
13953
|
-
|
|
14043
|
+
startRequestAnimate() {
|
|
13954
14044
|
this.requestAnimateTime = Date.now();
|
|
14045
|
+
this.requestAnimatePageTime = 0;
|
|
14046
|
+
if (!this.waitRequestRender) this.requestAnimate();
|
|
14047
|
+
}
|
|
14048
|
+
requestAnimate() {
|
|
14049
|
+
this.waitRequestRender = true;
|
|
13955
14050
|
Platform.requestRender(this.animate.bind(this));
|
|
13956
14051
|
}
|
|
13957
|
-
animate(
|
|
14052
|
+
animate(pageTime, seek) {
|
|
13958
14053
|
if (!seek) {
|
|
14054
|
+
this.waitRequestRender = false;
|
|
13959
14055
|
if (!this.running) return;
|
|
13960
|
-
|
|
14056
|
+
let frameTime;
|
|
14057
|
+
if (pageTime && this.requestAnimatePageTime) frameTime = pageTime - this.requestAnimatePageTime; else frameTime = Date.now() - this.requestAnimateTime;
|
|
14058
|
+
this.time += frameTime / 1e3;
|
|
14059
|
+
this.requestAnimatePageTime = pageTime;
|
|
14060
|
+
this.requestAnimateTime = Date.now();
|
|
13961
14061
|
}
|
|
13962
14062
|
const {duration: duration} = this, realTime = this.time * this.speed;
|
|
13963
14063
|
if (realTime < duration) {
|
|
@@ -13998,21 +14098,24 @@ let Animate = class Animate extends Eventer {
|
|
|
13998
14098
|
}
|
|
13999
14099
|
start(seek) {
|
|
14000
14100
|
this.requestAnimateTime = 1;
|
|
14001
|
-
const {reverse: reverse} = this;
|
|
14101
|
+
const {reverse: reverse, jump: jump} = this;
|
|
14002
14102
|
if (reverse || this.mainReverse) this.mainReverse = reverse;
|
|
14003
14103
|
if (this.looped) this.looped = 0;
|
|
14004
14104
|
if (seek) this.begin(true); else {
|
|
14005
14105
|
const {delay: delay} = this;
|
|
14006
|
-
if (delay)
|
|
14007
|
-
this.
|
|
14008
|
-
this.
|
|
14009
|
-
|
|
14106
|
+
if (delay) {
|
|
14107
|
+
if (jump) this.begin(true);
|
|
14108
|
+
this.timer = setTimeout(() => {
|
|
14109
|
+
this.timer = 0;
|
|
14110
|
+
this.begin();
|
|
14111
|
+
}, delay / this.speed * 1e3);
|
|
14112
|
+
} else this.begin();
|
|
14010
14113
|
}
|
|
14011
14114
|
}
|
|
14012
14115
|
begin(seek) {
|
|
14013
14116
|
this.playedTotalTime = this.time = 0;
|
|
14014
14117
|
this.mainReverse ? this.setTo() : this.setFrom();
|
|
14015
|
-
if (!seek) this.
|
|
14118
|
+
if (!seek) this.startRequestAnimate();
|
|
14016
14119
|
}
|
|
14017
14120
|
end() {
|
|
14018
14121
|
this.mainReverse ? this.setFrom() : this.setTo();
|
|
@@ -14128,6 +14231,8 @@ __decorate([ animateAttr(true) ], Animate.prototype, "autoplay", void 0);
|
|
|
14128
14231
|
|
|
14129
14232
|
__decorate([ animateAttr() ], Animate.prototype, "join", void 0);
|
|
14130
14233
|
|
|
14234
|
+
__decorate([ animateAttr() ], Animate.prototype, "jump", void 0);
|
|
14235
|
+
|
|
14131
14236
|
__decorate([ animateAttr() ], Animate.prototype, "attrs", void 0);
|
|
14132
14237
|
|
|
14133
14238
|
Animate = __decorate([ useModule(LeafEventer) ], Animate);
|
|
@@ -14366,7 +14471,7 @@ const hslMatch = /^hsl\((\d+),\s*(\d+)%\s*,\s*(\d+)%/i;
|
|
|
14366
14471
|
|
|
14367
14472
|
const hslaMatch = /^hsla\((\d+),\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d*\.?\d+)/i;
|
|
14368
14473
|
|
|
14369
|
-
const int = parseInt, float = parseFloat, {round: round$1} = Math;
|
|
14474
|
+
const int = parseInt, float$1 = parseFloat, {round: round$1} = Math;
|
|
14370
14475
|
|
|
14371
14476
|
let cache = {}, totalCache = 0;
|
|
14372
14477
|
|
|
@@ -14479,18 +14584,18 @@ function rgbaToRGBA(color) {
|
|
|
14479
14584
|
r: int(match[1]),
|
|
14480
14585
|
g: int(match[2]),
|
|
14481
14586
|
b: int(match[3]),
|
|
14482
|
-
a: float(match[4])
|
|
14587
|
+
a: float$1(match[4])
|
|
14483
14588
|
};
|
|
14484
14589
|
}
|
|
14485
14590
|
|
|
14486
14591
|
function hslToRGBA(color) {
|
|
14487
14592
|
const match = hslMatch.exec(color);
|
|
14488
|
-
return hsla(float(match[1]), float(match[2]), float(match[3]), 1);
|
|
14593
|
+
return hsla(float$1(match[1]), float$1(match[2]), float$1(match[3]), 1);
|
|
14489
14594
|
}
|
|
14490
14595
|
|
|
14491
14596
|
function hslaToRGBA(color) {
|
|
14492
14597
|
const match = hslaMatch.exec(color);
|
|
14493
|
-
return hsla(float(match[1]), float(match[2]), float(match[3]), float(match[4]));
|
|
14598
|
+
return hsla(float$1(match[1]), float$1(match[2]), float$1(match[3]), float$1(match[4]));
|
|
14494
14599
|
}
|
|
14495
14600
|
|
|
14496
14601
|
const n1 = 1 / 6, n2 = .5, n3 = 2 / 3, n4 = 1 / 3;
|
|
@@ -14729,7 +14834,7 @@ const HighBezierHelper = {
|
|
|
14729
14834
|
|
|
14730
14835
|
const {getDistance: getDistance} = HighBezierHelper;
|
|
14731
14836
|
|
|
14732
|
-
const {M: M, L: L, C: C, Z: Z} = PathCommandMap;
|
|
14837
|
+
const {M: M, L: L, C: C, Z: Z} = PathCommandMap, {float: float} = MathHelper;
|
|
14733
14838
|
|
|
14734
14839
|
const tempPoint = {}, tempFrom = {};
|
|
14735
14840
|
|
|
@@ -14866,7 +14971,7 @@ const HighCurveHelper = {
|
|
|
14866
14971
|
getDistancePath(distanceData, motionDistance, motionPrecision) {
|
|
14867
14972
|
const {segments: segments, data: data} = distanceData, path = [];
|
|
14868
14973
|
motionDistance = UnitConvert.number(motionDistance, distanceData.total);
|
|
14869
|
-
let total = 0, distance, to = {};
|
|
14974
|
+
let total = 0, distance, cutDistance, to = {};
|
|
14870
14975
|
let i = 0, index = 0, x = 0, y = 0, toX, toY, command;
|
|
14871
14976
|
let x1, y1, x2, y2, t;
|
|
14872
14977
|
const len = data.length;
|
|
@@ -14878,14 +14983,17 @@ const HighCurveHelper = {
|
|
|
14878
14983
|
toX = data[i + 1];
|
|
14879
14984
|
toY = data[i + 2];
|
|
14880
14985
|
distance = segments[index];
|
|
14881
|
-
if (total + distance
|
|
14986
|
+
if (total + distance > motionDistance || !distanceData.total) {
|
|
14882
14987
|
if (!i) x = toX, y = toY;
|
|
14883
14988
|
tempFrom.x = x;
|
|
14884
14989
|
tempFrom.y = y;
|
|
14885
14990
|
to.x = toX;
|
|
14886
14991
|
to.y = toY;
|
|
14887
|
-
|
|
14888
|
-
|
|
14992
|
+
cutDistance = float(motionDistance - total);
|
|
14993
|
+
if (cutDistance) {
|
|
14994
|
+
PointHelper.getDistancePoint(tempFrom, to, cutDistance, true);
|
|
14995
|
+
path.push(command, to.x, to.y);
|
|
14996
|
+
}
|
|
14889
14997
|
return path;
|
|
14890
14998
|
}
|
|
14891
14999
|
x = toX;
|
|
@@ -14899,9 +15007,12 @@ const HighCurveHelper = {
|
|
|
14899
15007
|
toX = data[i + 5];
|
|
14900
15008
|
toY = data[i + 6];
|
|
14901
15009
|
distance = segments[index];
|
|
14902
|
-
if (total + distance
|
|
14903
|
-
|
|
14904
|
-
|
|
15010
|
+
if (total + distance > motionDistance) {
|
|
15011
|
+
cutDistance = float(motionDistance - total);
|
|
15012
|
+
if (cutDistance) {
|
|
15013
|
+
t = HighBezierHelper.getT(cutDistance, distance, x, y, x1, y1, x2, y2, toX, toY, motionPrecision);
|
|
15014
|
+
HighBezierHelper.cut(path, t, x, y, x1, y1, x2, y2, toX, toY);
|
|
15015
|
+
}
|
|
14905
15016
|
return path;
|
|
14906
15017
|
}
|
|
14907
15018
|
x = toX;
|
|
@@ -15110,6 +15221,7 @@ class Finder {
|
|
|
15110
15221
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
15111
15222
|
child = children[i];
|
|
15112
15223
|
result = method(child, options);
|
|
15224
|
+
if (typeof result === "boolean") result = result ? 1 : 0;
|
|
15113
15225
|
if (result === Yes || result === YesAndSkip) {
|
|
15114
15226
|
if (list) {
|
|
15115
15227
|
list.push(child);
|
|
@@ -15174,4 +15286,4 @@ Creator.finder = function(target) {
|
|
|
15174
15286
|
return new Finder(target);
|
|
15175
15287
|
};
|
|
15176
15288
|
|
|
15177
|
-
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, Interaction, 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$
|
|
15289
|
+
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, Interaction, 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 };
|