@leafer/miniapp 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/miniapp.module.js +357 -202
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +21 -21
package/dist/miniapp.module.js
CHANGED
|
@@ -216,7 +216,7 @@ class LeafData {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
const {floor: floor$3, max: max$
|
|
219
|
+
const {floor: floor$3, max: max$7} = Math;
|
|
220
220
|
|
|
221
221
|
const Platform = {
|
|
222
222
|
toURL(text, fileType) {
|
|
@@ -242,7 +242,7 @@ const Platform = {
|
|
|
242
242
|
return url;
|
|
243
243
|
},
|
|
244
244
|
resize(image, width, height, xGap, yGap, clip, smooth, opacity, _filters) {
|
|
245
|
-
const canvas = Platform.origin.createCanvas(max$
|
|
245
|
+
const canvas = Platform.origin.createCanvas(max$7(floor$3(width + (xGap || 0)), 1), max$7(floor$3(height + (yGap || 0)), 1));
|
|
246
246
|
const ctx = canvas.getContext("2d");
|
|
247
247
|
if (opacity) ctx.globalAlpha = opacity;
|
|
248
248
|
ctx.imageSmoothingEnabled = smooth === false ? false : true;
|
|
@@ -289,7 +289,7 @@ const I$2 = IncrementId;
|
|
|
289
289
|
|
|
290
290
|
let tempA, tempB, tempTo;
|
|
291
291
|
|
|
292
|
-
const {max: max$
|
|
292
|
+
const {max: max$6} = Math, tempFour = [ 0, 0, 0, 0 ];
|
|
293
293
|
|
|
294
294
|
const FourNumberHelper = {
|
|
295
295
|
zero: [ ...tempFour ],
|
|
@@ -341,9 +341,9 @@ const FourNumberHelper = {
|
|
|
341
341
|
return data;
|
|
342
342
|
},
|
|
343
343
|
max(t, other, change) {
|
|
344
|
-
if (isNumber(t) && isNumber(other)) return max$
|
|
344
|
+
if (isNumber(t) && isNumber(other)) return max$6(t, other);
|
|
345
345
|
toTempAB(t, other, change);
|
|
346
|
-
return set$2(tempTo, max$
|
|
346
|
+
return set$2(tempTo, max$6(tempA[0], tempB[0]), max$6(tempA[1], tempB[1]), max$6(tempA[2], tempB[2]), max$6(tempA[3], tempB[3]));
|
|
347
347
|
},
|
|
348
348
|
add(t, other, change) {
|
|
349
349
|
if (isNumber(t) && isNumber(other)) return t + other;
|
|
@@ -360,7 +360,7 @@ const FourNumberHelper = {
|
|
|
360
360
|
|
|
361
361
|
const {set: set$2, get: get$5, setTemp: setTemp, toTempAB: toTempAB} = FourNumberHelper;
|
|
362
362
|
|
|
363
|
-
const {round: round$6, pow: pow$2, max: max$
|
|
363
|
+
const {round: round$6, pow: pow$2, max: max$5, floor: floor$2, PI: PI$4} = Math;
|
|
364
364
|
|
|
365
365
|
const MathHelper = {
|
|
366
366
|
within(value, min, max) {
|
|
@@ -414,7 +414,7 @@ const MathHelper = {
|
|
|
414
414
|
}
|
|
415
415
|
},
|
|
416
416
|
getFloorScale(num, min = 1) {
|
|
417
|
-
return max$
|
|
417
|
+
return max$5(floor$2(num), min) / num;
|
|
418
418
|
},
|
|
419
419
|
randInt: randInt,
|
|
420
420
|
randColor(opacity) {
|
|
@@ -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$b.toInnerPoint(t, origin, tempPoint$
|
|
526
|
-
M$b.scaleOfInner(t, tempPoint$
|
|
525
|
+
M$b.toInnerPoint(t, origin, tempPoint$5);
|
|
526
|
+
M$b.scaleOfInner(t, tempPoint$5, scaleX, scaleY);
|
|
527
527
|
},
|
|
528
528
|
scaleOfInner(t, origin, scaleX, scaleY = scaleX) {
|
|
529
529
|
M$b.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$b.toInnerPoint(t, origin, tempPoint$
|
|
545
|
-
M$b.rotateOfInner(t, tempPoint$
|
|
544
|
+
M$b.toInnerPoint(t, origin, tempPoint$5);
|
|
545
|
+
M$b.rotateOfInner(t, tempPoint$5, rotation);
|
|
546
546
|
},
|
|
547
547
|
rotateOfInner(t, origin, rotation) {
|
|
548
548
|
M$b.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$b.toInnerPoint(t, origin, tempPoint$
|
|
567
|
-
M$b.skewOfInner(t, tempPoint$
|
|
566
|
+
M$b.toInnerPoint(t, origin, tempPoint$5);
|
|
567
|
+
M$b.skewOfInner(t, tempPoint$5, skewX, skewY);
|
|
568
568
|
},
|
|
569
569
|
skewOfInner(t, origin, skewX, skewY = 0) {
|
|
570
570
|
M$b.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,9 +761,11 @@ const MatrixHelper = {
|
|
|
761
761
|
|
|
762
762
|
const M$b = MatrixHelper;
|
|
763
763
|
|
|
764
|
+
const {float: float$4} = MathHelper;
|
|
765
|
+
|
|
764
766
|
const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
|
|
765
767
|
|
|
766
|
-
const {sin: sin$5, cos: cos$5, abs: abs$a, sqrt: sqrt$4, atan2: atan2$2, min: min$
|
|
768
|
+
const {sin: sin$5, cos: cos$5, abs: abs$a, sqrt: sqrt$4, atan2: atan2$2, min: min$3, round: round$5} = Math;
|
|
767
769
|
|
|
768
770
|
const PointHelper = {
|
|
769
771
|
defaultPoint: getPointData(),
|
|
@@ -812,22 +814,27 @@ const PointHelper = {
|
|
|
812
814
|
},
|
|
813
815
|
tempToInnerOf(t, matrix) {
|
|
814
816
|
const {tempPoint: temp} = P$7;
|
|
815
|
-
copy$
|
|
817
|
+
copy$c(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$7;
|
|
821
|
-
copy$
|
|
823
|
+
copy$c(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$7;
|
|
827
|
-
copy$
|
|
829
|
+
copy$c(temp, t);
|
|
828
830
|
P$7.toInnerRadiusPointOf(t, matrix, temp);
|
|
829
831
|
return temp;
|
|
830
832
|
},
|
|
833
|
+
copyRadiusPoint(t, point, x, y) {
|
|
834
|
+
copy$c(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);
|
|
@@ -861,7 +868,7 @@ const PointHelper = {
|
|
|
861
868
|
return sqrt$4(x * x + y * y);
|
|
862
869
|
},
|
|
863
870
|
getMinDistanceFrom(x1, y1, x2, y2, x3, y3) {
|
|
864
|
-
return min$
|
|
871
|
+
return min$3(getDistanceFrom(x1, y1, x2, y2), getDistanceFrom(x2, y2, x3, y3));
|
|
865
872
|
},
|
|
866
873
|
getAngle(t, to) {
|
|
867
874
|
return getAtan2(t, to) / OneRadian;
|
|
@@ -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$7.reset(t);
|
|
@@ -904,7 +911,7 @@ const PointHelper = {
|
|
|
904
911
|
|
|
905
912
|
const P$7 = PointHelper;
|
|
906
913
|
|
|
907
|
-
const {getDistanceFrom: getDistanceFrom, copy: copy$
|
|
914
|
+
const {getDistanceFrom: getDistanceFrom, copy: copy$c, setRadius: setRadius, getAtan2: getAtan2} = P$7;
|
|
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$5, 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$b(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$4 = 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$b(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$b} = 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$a, 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$a(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;
|
|
@@ -2642,7 +2649,7 @@ const RectHelper = {
|
|
|
2642
2649
|
}
|
|
2643
2650
|
};
|
|
2644
2651
|
|
|
2645
|
-
const {sin: sin$4, cos: cos$4, hypot: hypot, atan2: atan2$1, ceil: ceil$1, abs: abs$9, PI: PI$3, sqrt: sqrt$3, pow: pow$1} = Math;
|
|
2652
|
+
const {sin: sin$4, cos: cos$4, hypot: hypot$1, atan2: atan2$1, ceil: ceil$1, abs: abs$9, PI: PI$3, sqrt: sqrt$3, pow: pow$1} = Math;
|
|
2646
2653
|
|
|
2647
2654
|
const {setPoint: setPoint$4, addPoint: addPoint$2} = TwoPointBoundsHelper;
|
|
2648
2655
|
|
|
@@ -2650,7 +2657,7 @@ const {set: set$1, toNumberPoints: toNumberPoints$1} = PointHelper;
|
|
|
2650
2657
|
|
|
2651
2658
|
const {M: M$a, L: L$a, C: C$8, Q: Q$7, Z: Z$8} = 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$a, 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$7, c1X, c1Y, bX, bY);
|
|
2686
2695
|
} else {
|
|
2687
|
-
data.push(C$8, c2X, c2Y, c1X, c1Y, bX, bY);
|
|
2696
|
+
if (baX || baY) data.push(C$8, c2X, c2Y, c1X, c1Y, bX, bY);
|
|
2688
2697
|
}
|
|
2689
2698
|
c2X = bX + cb * cX;
|
|
2690
2699
|
c2Y = bY + cb * cY;
|
|
@@ -2713,8 +2722,8 @@ const BezierHelper = {
|
|
|
2713
2722
|
const CBy = toY - y1;
|
|
2714
2723
|
let startRadian = atan2$1(BAy, BAx);
|
|
2715
2724
|
let endRadian = atan2$1(CBy, CBx);
|
|
2716
|
-
const lenBA = hypot(BAx, BAy);
|
|
2717
|
-
const lenCB = hypot(CBx, CBy);
|
|
2725
|
+
const lenBA = hypot$1(BAx, BAy);
|
|
2726
|
+
const lenCB = hypot$1(CBx, CBy);
|
|
2718
2727
|
let totalRadian = endRadian - startRadian;
|
|
2719
2728
|
if (totalRadian < 0) totalRadian += PI2;
|
|
2720
2729
|
if (lenBA < 1e-12 || lenCB < 1e-12 || totalRadian < 1e-12 || abs$9(totalRadian - PI$3) < 1e-12) {
|
|
@@ -2819,8 +2828,8 @@ const BezierHelper = {
|
|
|
2819
2828
|
addMode ? addPoint$2(pointBounds, fromX, fromY) : setPoint$4(pointBounds, fromX, fromY);
|
|
2820
2829
|
addPoint$2(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$2(pointBounds, tempPoint$
|
|
2831
|
+
getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$3);
|
|
2832
|
+
addPoint$2(pointBounds, tempPoint$3.x, tempPoint$3.y);
|
|
2824
2833
|
}
|
|
2825
2834
|
},
|
|
2826
2835
|
getPointAndSet(t, fromX, fromY, x1, y1, x2, y2, toX, toY, setPoint) {
|
|
@@ -3230,7 +3239,7 @@ const {M: M$8, L: L$8, C: C$6, Q: Q$5, Z: Z$6, N: N$4, D: D$5, X: X$4, G: G$4, F
|
|
|
3230
3239
|
|
|
3231
3240
|
const {getMinDistanceFrom: getMinDistanceFrom, getRadianFrom: getRadianFrom} = PointHelper;
|
|
3232
3241
|
|
|
3233
|
-
const {tan: tan, min: min$
|
|
3242
|
+
const {tan: tan, min: min$2, abs: abs$8} = Math;
|
|
3234
3243
|
|
|
3235
3244
|
const startPoint = {};
|
|
3236
3245
|
|
|
@@ -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$5, x, y, radiusX, radiusY);
|
|
3274
3284
|
} else {
|
|
@@ -3281,6 +3291,7 @@ const PathCommandDataHelper = {
|
|
|
3281
3291
|
if (isNull(startAngle)) {
|
|
3282
3292
|
data.push(P$4, x, y, radius);
|
|
3283
3293
|
} else {
|
|
3294
|
+
if (isNull(startAngle)) startAngle = 0;
|
|
3284
3295
|
if (isNull(endAngle)) endAngle = 360;
|
|
3285
3296
|
data.push(O$5, x, y, radius, startAngle, endAngle, anticlockwise ? 1 : 0);
|
|
3286
3297
|
}
|
|
@@ -3288,7 +3299,7 @@ const PathCommandDataHelper = {
|
|
|
3288
3299
|
arcTo(data, x1, y1, x2, y2, radius, lastX, lastY) {
|
|
3289
3300
|
if (!isUndefined(lastX)) {
|
|
3290
3301
|
const d = getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2);
|
|
3291
|
-
radius = min$
|
|
3302
|
+
radius = min$2(radius, min$2(d / 2, d / 2 * abs$8(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
|
|
3292
3303
|
}
|
|
3293
3304
|
data.push(U$4, x1, y1, x2, y2, radius);
|
|
3294
3305
|
},
|
|
@@ -3490,7 +3501,7 @@ const {M: M$6, L: L$6, C: C$4, Q: Q$3, Z: Z$4, N: N$2, D: D$3, X: X$2, G: G$2, F
|
|
|
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$9, addPoint: addPoint$1, setPoint: setPoint$3, addBounds: addBounds, toBounds: toBounds$2} = TwoPointBoundsHelper;
|
|
3494
3505
|
|
|
3495
3506
|
const debug$d = Debug.get("PathBounds");
|
|
3496
3507
|
|
|
@@ -3572,7 +3583,7 @@ const PathBounds = {
|
|
|
3572
3583
|
|
|
3573
3584
|
case G$2:
|
|
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$9(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$3:
|
|
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$9(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$2:
|
|
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$9(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$8, 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$3 = {}, {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$8(matrix$3, o);
|
|
4729
4764
|
scaleOfOuter$2(matrix$3, origin, scaleX, scaleY);
|
|
4730
4765
|
if (L$4.hasHighPosition(t)) {
|
|
4731
4766
|
L$4.setTransform(t, matrix$3, 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$8(matrix$3, o);
|
|
4748
4783
|
rotateOfOuter$2(matrix$3, origin, angle);
|
|
4749
4784
|
if (L$4.hasHighPosition(t)) L$4.setTransform(t, matrix$3, false, transition); else t.set({
|
|
4750
4785
|
x: t.x + matrix$3.e - o.e,
|
|
@@ -4756,18 +4791,18 @@ const LeafHelper = {
|
|
|
4756
4791
|
L$4.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$8(matrix$3, t.__localMatrix);
|
|
4760
4795
|
skewOfOuter(matrix$3, origin, skewX, skewY);
|
|
4761
4796
|
L$4.setTransform(t, matrix$3, resize, transition);
|
|
4762
4797
|
},
|
|
4763
4798
|
transformWorld(t, transform, resize, transition) {
|
|
4764
|
-
copy$
|
|
4799
|
+
copy$8(matrix$3, t.worldTransform);
|
|
4765
4800
|
multiplyParent$3(matrix$3, transform);
|
|
4766
4801
|
if (t.parent) divideParent(matrix$3, t.parent.scrollWorldTransform);
|
|
4767
4802
|
L$4.setTransform(t, matrix$3, resize, transition);
|
|
4768
4803
|
},
|
|
4769
4804
|
transform(t, transform, resize, transition) {
|
|
4770
|
-
copy$
|
|
4805
|
+
copy$8(matrix$3, t.localTransform);
|
|
4771
4806
|
multiplyParent$3(matrix$3, transform);
|
|
4772
4807
|
L$4.setTransform(t, matrix$3, 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$8(matrix$3, t.worldTransform);
|
|
4809
4844
|
divideParent(matrix$3, relative.scrollWorldTransform);
|
|
4810
4845
|
return temp ? matrix$3 : Object.assign({}, matrix$3);
|
|
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$7} = 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$7(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$4, tempPoint: tempPoint$
|
|
5912
|
+
const {toPoint: toPoint$4, 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$4(data.around || data.origin, layout.boxBounds, tempPoint$
|
|
5898
|
-
translateInner(local, -tempPoint$
|
|
5932
|
+
toPoint$4(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$3, updateAllMatrix: updateAllMatrix$3} = LeafH
|
|
|
5906
5941
|
|
|
5907
5942
|
const {updateBounds: updateBounds$2} = BranchHelper;
|
|
5908
5943
|
|
|
5909
|
-
const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$3, copy: copy$
|
|
5944
|
+
const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$3, copy: copy$6} = BoundsHelper;
|
|
5910
5945
|
|
|
5911
5946
|
const {toBounds: toBounds$1} = 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$6(layout.renderBounds, layout.strokeBounds) : copyAndSpread$3(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$5, move: move$8} = 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$5(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$5(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() {
|
|
@@ -7725,6 +7760,10 @@ class Renderer {
|
|
|
7725
7760
|
|
|
7726
7761
|
Renderer.clipSpread = 10;
|
|
7727
7762
|
|
|
7763
|
+
const tempPoint$1 = {};
|
|
7764
|
+
|
|
7765
|
+
const {copyRadiusPoint: copyRadiusPoint$1} = PointHelper;
|
|
7766
|
+
|
|
7728
7767
|
const {hitRadiusPoint: hitRadiusPoint$1} = BoundsHelper;
|
|
7729
7768
|
|
|
7730
7769
|
class Picker {
|
|
@@ -7851,15 +7890,15 @@ class Picker {
|
|
|
7851
7890
|
this.eachFind(branch.children, branch.__onlyHitMask);
|
|
7852
7891
|
}
|
|
7853
7892
|
eachFind(children, hitMask) {
|
|
7854
|
-
let child, hit;
|
|
7893
|
+
let child, hit, data;
|
|
7855
7894
|
const {point: point} = this, len = children.length;
|
|
7856
7895
|
for (let i = len - 1; i > -1; i--) {
|
|
7857
|
-
child = children[i];
|
|
7858
|
-
if (!
|
|
7859
|
-
hit = child.
|
|
7896
|
+
child = children[i], data = child.__;
|
|
7897
|
+
if (!data.visible || hitMask && !data.mask) continue;
|
|
7898
|
+
hit = hitRadiusPoint$1(child.__world, data.hitRadius ? copyRadiusPoint$1(tempPoint$1, point, data.hitRadius) : point);
|
|
7860
7899
|
if (child.isBranch) {
|
|
7861
7900
|
if (hit || child.__ignoreHitWorld) {
|
|
7862
|
-
if (child.isBranchLeaf &&
|
|
7901
|
+
if (child.isBranchLeaf && data.__clipAfterFill && !child.__hitWorld(point, true)) continue;
|
|
7863
7902
|
if (child.topChildren) this.eachFind(child.topChildren, false);
|
|
7864
7903
|
this.eachFind(child.children, child.__onlyHitMask);
|
|
7865
7904
|
if (child.isBranchLeaf) this.hitChild(child, point);
|
|
@@ -8346,7 +8385,7 @@ class CanvasData extends RectData {
|
|
|
8346
8385
|
}
|
|
8347
8386
|
}
|
|
8348
8387
|
|
|
8349
|
-
const {max: max$
|
|
8388
|
+
const {max: max$4, add: add$1} = FourNumberHelper;
|
|
8350
8389
|
|
|
8351
8390
|
const UIBounds = {
|
|
8352
8391
|
__updateStrokeSpread() {
|
|
@@ -8362,7 +8401,7 @@ const UIBounds = {
|
|
|
8362
8401
|
}
|
|
8363
8402
|
if (data.__useArrow) spread += strokeWidth * 5;
|
|
8364
8403
|
if (box) {
|
|
8365
|
-
spread = max$
|
|
8404
|
+
spread = max$4(spread, box.__layout.strokeSpread = box.__updateStrokeSpread());
|
|
8366
8405
|
boxSpread = Math.max(boxSpread, box.__layout.strokeBoxSpread);
|
|
8367
8406
|
}
|
|
8368
8407
|
this.__layout.strokeBoxSpread = boxSpread;
|
|
@@ -8372,15 +8411,15 @@ const UIBounds = {
|
|
|
8372
8411
|
let spread = 0;
|
|
8373
8412
|
const {shadow: shadow, innerShadow: innerShadow, blur: blur, backgroundBlur: backgroundBlur, filter: filter, renderSpread: renderSpread} = this.__, {strokeSpread: strokeSpread} = this.__layout, box = this.__box;
|
|
8374
8413
|
if (shadow) spread = Effect.getShadowRenderSpread(this, shadow);
|
|
8375
|
-
if (blur) spread = max$
|
|
8414
|
+
if (blur) spread = max$4(spread, blur);
|
|
8376
8415
|
if (filter) spread = add$1(spread, Filter.getSpread(filter));
|
|
8377
8416
|
if (renderSpread) spread = add$1(spread, renderSpread);
|
|
8378
8417
|
if (strokeSpread) spread = add$1(spread, strokeSpread);
|
|
8379
8418
|
let shapeSpread = spread;
|
|
8380
|
-
if (innerShadow) shapeSpread = max$
|
|
8381
|
-
if (backgroundBlur) shapeSpread = max$
|
|
8419
|
+
if (innerShadow) shapeSpread = max$4(shapeSpread, Effect.getInnerShadowSpread(this, innerShadow));
|
|
8420
|
+
if (backgroundBlur) shapeSpread = max$4(shapeSpread, backgroundBlur);
|
|
8382
8421
|
this.__layout.renderShapeSpread = shapeSpread;
|
|
8383
|
-
return box ? max$
|
|
8422
|
+
return box ? max$4(box.__updateRenderSpread(), spread) : spread;
|
|
8384
8423
|
}
|
|
8385
8424
|
};
|
|
8386
8425
|
|
|
@@ -8436,7 +8475,7 @@ const UIRender = {
|
|
|
8436
8475
|
if (stroke && !__fillAfterStroke) data.__isStrokes ? Paint.strokes(stroke, this, canvas, options) : Paint.stroke(stroke, this, canvas, options);
|
|
8437
8476
|
}
|
|
8438
8477
|
} else {
|
|
8439
|
-
if (data.
|
|
8478
|
+
if (data.__pathForRender) drawFast(this, canvas, options); else this.__drawFast(canvas, options);
|
|
8440
8479
|
}
|
|
8441
8480
|
},
|
|
8442
8481
|
__drawShape(canvas, options) {
|
|
@@ -8560,7 +8599,7 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8560
8599
|
getPath(curve, pathForRender) {
|
|
8561
8600
|
this.__layout.update();
|
|
8562
8601
|
let path = pathForRender ? this.__.__pathForRender : this.__.path;
|
|
8563
|
-
if (!path) pen.set(path = []), this.__drawPathByBox(pen);
|
|
8602
|
+
if (!path) pen.set(path = []), this.__drawPathByBox(pen, !pathForRender);
|
|
8564
8603
|
return curve ? PathConvert.toCanvasData(path, true) : path;
|
|
8565
8604
|
}
|
|
8566
8605
|
getPathString(curve, pathForRender, floatLength) {
|
|
@@ -8588,17 +8627,18 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8588
8627
|
}
|
|
8589
8628
|
__drawPath(canvas) {
|
|
8590
8629
|
canvas.beginPath();
|
|
8591
|
-
this.__drawPathByData(canvas, this.__.path);
|
|
8630
|
+
this.__drawPathByData(canvas, this.__.path, true);
|
|
8592
8631
|
}
|
|
8593
|
-
__drawPathByData(drawer, data) {
|
|
8594
|
-
data ? PathDrawer.drawPathByData(drawer, data) : this.__drawPathByBox(drawer);
|
|
8632
|
+
__drawPathByData(drawer, data, ignoreCornerRadius) {
|
|
8633
|
+
data ? PathDrawer.drawPathByData(drawer, data) : this.__drawPathByBox(drawer, ignoreCornerRadius);
|
|
8595
8634
|
}
|
|
8596
|
-
__drawPathByBox(drawer) {
|
|
8635
|
+
__drawPathByBox(drawer, ignoreCornerRadius) {
|
|
8597
8636
|
const {x: x, y: y, width: width, height: height} = this.__layout.boxBounds;
|
|
8598
|
-
if (this.__.cornerRadius) {
|
|
8637
|
+
if (this.__.cornerRadius && !ignoreCornerRadius) {
|
|
8599
8638
|
const {cornerRadius: cornerRadius} = this.__;
|
|
8600
8639
|
drawer.roundRect(x, y, width, height, isNumber(cornerRadius) ? [ cornerRadius ] : cornerRadius);
|
|
8601
8640
|
} else drawer.rect(x, y, width, height);
|
|
8641
|
+
drawer.closePath();
|
|
8602
8642
|
}
|
|
8603
8643
|
drawImagePlaceholder(_paint, canvas, renderOptions) {
|
|
8604
8644
|
Paint.fill(this.__.placeholderColor, this, canvas, renderOptions);
|
|
@@ -8867,6 +8907,9 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8867
8907
|
get layoutLocked() {
|
|
8868
8908
|
return !this.layouter.running;
|
|
8869
8909
|
}
|
|
8910
|
+
get view() {
|
|
8911
|
+
return this.canvas && this.canvas.view;
|
|
8912
|
+
}
|
|
8870
8913
|
get FPS() {
|
|
8871
8914
|
return this.renderer ? this.renderer.FPS : 60;
|
|
8872
8915
|
}
|
|
@@ -8918,7 +8961,6 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8918
8961
|
this.__controllers.push(this.renderer = Creator.renderer(this, canvas, config), this.watcher = Creator.watcher(this, config), this.layouter = Creator.layouter(this, config));
|
|
8919
8962
|
if (this.isApp) this.__setApp();
|
|
8920
8963
|
this.__checkAutoLayout();
|
|
8921
|
-
this.view = canvas.view;
|
|
8922
8964
|
if (!parentApp) {
|
|
8923
8965
|
this.selector = Creator.selector(this);
|
|
8924
8966
|
this.interaction = Creator.interaction(this, canvas, this.selector, config);
|
|
@@ -9198,7 +9240,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
9198
9240
|
if (this.canvasManager) this.canvasManager.destroy();
|
|
9199
9241
|
}
|
|
9200
9242
|
if (this.canvas) this.canvas.destroy();
|
|
9201
|
-
this.config.view = this.
|
|
9243
|
+
this.config.view = this.parentApp = null;
|
|
9202
9244
|
if (this.userConfig) this.userConfig.view = null;
|
|
9203
9245
|
super.destroy();
|
|
9204
9246
|
setTimeout(() => {
|
|
@@ -9382,7 +9424,6 @@ let Ellipse = class Ellipse extends UI {
|
|
|
9382
9424
|
if (startAngle || endAngle) {
|
|
9383
9425
|
if (innerRadius < 1) ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false);
|
|
9384
9426
|
ellipse(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
|
|
9385
|
-
if (innerRadius < 1) closePath$2(path);
|
|
9386
9427
|
} else {
|
|
9387
9428
|
if (innerRadius < 1) {
|
|
9388
9429
|
ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
|
|
@@ -9390,16 +9431,16 @@ let Ellipse = class Ellipse extends UI {
|
|
|
9390
9431
|
}
|
|
9391
9432
|
ellipse(path, rx, ry, rx, ry, 0, 360, 0, true);
|
|
9392
9433
|
}
|
|
9393
|
-
if (Platform.ellipseToCurve) this.__.path = this.getPath(true);
|
|
9394
9434
|
} else {
|
|
9395
9435
|
if (startAngle || endAngle) {
|
|
9396
9436
|
moveTo$3(path, rx, ry);
|
|
9397
9437
|
ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
|
|
9398
|
-
closePath$2(path);
|
|
9399
9438
|
} else {
|
|
9400
9439
|
ellipse(path, rx, ry, rx, ry);
|
|
9401
9440
|
}
|
|
9402
9441
|
}
|
|
9442
|
+
closePath$2(path);
|
|
9443
|
+
if (Platform.ellipseToCurve) this.__.path = this.getPath(true);
|
|
9403
9444
|
}
|
|
9404
9445
|
};
|
|
9405
9446
|
|
|
@@ -10050,7 +10091,7 @@ class UIEvent extends Event {
|
|
|
10050
10091
|
}
|
|
10051
10092
|
}
|
|
10052
10093
|
|
|
10053
|
-
const {min: min, max: max$
|
|
10094
|
+
const {min: min$1, max: max$3, abs: abs$7} = Math, {float: float$2, sign: sign$2} = MathHelper, {minX: minX, maxX: maxX, minY: minY, maxY: maxY} = BoundsHelper;
|
|
10054
10095
|
|
|
10055
10096
|
const tempContent = new Bounds, tempDragBounds = new Bounds;
|
|
10056
10097
|
|
|
@@ -10090,8 +10131,8 @@ const DragBoundsHelper = {
|
|
|
10090
10131
|
} else {
|
|
10091
10132
|
if (y < dragBounds.y) move.y += dragBounds.y - y; else if (bottom > boundsBottom) move.y += boundsBottom - bottom;
|
|
10092
10133
|
}
|
|
10093
|
-
move.x = float$
|
|
10094
|
-
move.y = float$
|
|
10134
|
+
move.x = float$2(move.x);
|
|
10135
|
+
move.y = float$2(move.y);
|
|
10095
10136
|
return move;
|
|
10096
10137
|
},
|
|
10097
10138
|
getValidScaleOf(content, dragBounds, dragBoundsType, origin, scale, lockRatio, change) {
|
|
@@ -10103,44 +10144,44 @@ const DragBoundsHelper = {
|
|
|
10103
10144
|
let correctScaleX = 1, correctScaleY = 1, aScale, bScale, aSize, bSize;
|
|
10104
10145
|
if (D$2.isInnerMode(content, dragBounds, dragBoundsType, "width")) {
|
|
10105
10146
|
if (scale.x < 0) tempContent.scaleOf(origin, correctScaleX = 1 / scale.x, 1);
|
|
10106
|
-
aSize = float$
|
|
10107
|
-
bSize = float$
|
|
10147
|
+
aSize = float$2(tempContent.minX - tempDragBounds.minX);
|
|
10148
|
+
bSize = float$2(tempDragBounds.maxX - tempContent.maxX);
|
|
10108
10149
|
aScale = originLeftScale && aSize > 0 ? 1 + aSize / (originLeftScale * tempContent.width) : 1;
|
|
10109
10150
|
bScale = originRightScale && bSize > 0 ? 1 + bSize / (originRightScale * tempContent.width) : 1;
|
|
10110
|
-
correctScaleX *= max$
|
|
10151
|
+
correctScaleX *= max$3(aScale, bScale);
|
|
10111
10152
|
} else {
|
|
10112
10153
|
if (scale.x < 0) {
|
|
10113
|
-
if (float$
|
|
10154
|
+
if (float$2(minX(content) - minX(dragBounds)) <= 0 || float$2(maxX(dragBounds) - maxX(content)) <= 0) tempContent.scaleOf(origin, correctScaleX = 1 / scale.x, 1);
|
|
10114
10155
|
tempContent.unsign();
|
|
10115
10156
|
}
|
|
10116
|
-
aSize = float$
|
|
10117
|
-
bSize = float$
|
|
10157
|
+
aSize = float$2(tempDragBounds.minX - tempContent.minX);
|
|
10158
|
+
bSize = float$2(tempContent.maxX - tempDragBounds.maxX);
|
|
10118
10159
|
aScale = originLeftScale && aSize > 0 ? 1 - aSize / (originLeftScale * tempContent.width) : 1;
|
|
10119
10160
|
bScale = originRightScale && bSize > 0 ? 1 - bSize / (originRightScale * tempContent.width) : 1;
|
|
10120
|
-
correctScaleX *= min(aScale, bScale);
|
|
10161
|
+
correctScaleX *= min$1(aScale, bScale);
|
|
10121
10162
|
}
|
|
10122
10163
|
if (D$2.isInnerMode(content, dragBounds, dragBoundsType, "height")) {
|
|
10123
10164
|
if (scale.y < 0) tempContent.scaleOf(origin, 1, correctScaleY = 1 / scale.y);
|
|
10124
|
-
aSize = float$
|
|
10125
|
-
bSize = float$
|
|
10165
|
+
aSize = float$2(tempContent.minY - tempDragBounds.minY);
|
|
10166
|
+
bSize = float$2(tempDragBounds.maxY - tempContent.maxY);
|
|
10126
10167
|
aScale = originTopScale && aSize > 0 ? 1 + aSize / (originTopScale * tempContent.height) : 1;
|
|
10127
10168
|
bScale = originBottomScale && bSize > 0 ? 1 + bSize / (originBottomScale * tempContent.height) : 1;
|
|
10128
|
-
correctScaleY *= max$
|
|
10169
|
+
correctScaleY *= max$3(aScale, bScale);
|
|
10129
10170
|
if (lockRatio) {
|
|
10130
|
-
aScale = max$
|
|
10171
|
+
aScale = max$3(abs$7(correctScaleX), abs$7(correctScaleY));
|
|
10131
10172
|
correctScaleX = sign$2(correctScaleX) * aScale;
|
|
10132
10173
|
correctScaleY = sign$2(correctScaleY) * aScale;
|
|
10133
10174
|
}
|
|
10134
10175
|
} else {
|
|
10135
10176
|
if (scale.y < 0) {
|
|
10136
|
-
if (float$
|
|
10177
|
+
if (float$2(minY(content) - minY(dragBounds)) <= 0 || float$2(maxY(dragBounds) - maxY(content)) <= 0) tempContent.scaleOf(origin, 1, correctScaleY = 1 / scale.y);
|
|
10137
10178
|
tempContent.unsign();
|
|
10138
10179
|
}
|
|
10139
|
-
aSize = float$
|
|
10140
|
-
bSize = float$
|
|
10180
|
+
aSize = float$2(tempDragBounds.minY - tempContent.minY);
|
|
10181
|
+
bSize = float$2(tempContent.maxY - tempDragBounds.maxY);
|
|
10141
10182
|
aScale = originTopScale && aSize > 0 ? 1 - aSize / (originTopScale * tempContent.height) : 1;
|
|
10142
10183
|
bScale = originBottomScale && bSize > 0 ? 1 - bSize / (originBottomScale * tempContent.height) : 1;
|
|
10143
|
-
correctScaleY *= min(aScale, bScale);
|
|
10184
|
+
correctScaleY *= min$1(aScale, bScale);
|
|
10144
10185
|
}
|
|
10145
10186
|
scale.x *= isFinite$1(correctScaleX) ? correctScaleX : 1;
|
|
10146
10187
|
scale.y *= isFinite$1(correctScaleY) ? correctScaleY : 1;
|
|
@@ -10289,8 +10330,14 @@ MoveEvent.START = "move.start";
|
|
|
10289
10330
|
|
|
10290
10331
|
MoveEvent.MOVE = "move";
|
|
10291
10332
|
|
|
10333
|
+
MoveEvent.DRAG_ANIMATE = "move.drag_animate";
|
|
10334
|
+
|
|
10292
10335
|
MoveEvent.END = "move.end";
|
|
10293
10336
|
|
|
10337
|
+
MoveEvent.PULL_DOWN = "move.pull_down";
|
|
10338
|
+
|
|
10339
|
+
MoveEvent.REACH_BOTTOM = "move.reach_bottom";
|
|
10340
|
+
|
|
10294
10341
|
MoveEvent = __decorate([ registerUIEvent() ], MoveEvent);
|
|
10295
10342
|
|
|
10296
10343
|
let TouchEvent = class TouchEvent extends UIEvent {};
|
|
@@ -10387,6 +10434,7 @@ const InteractionHelper = {
|
|
|
10387
10434
|
ctrlKey: e.ctrlKey,
|
|
10388
10435
|
shiftKey: e.shiftKey,
|
|
10389
10436
|
metaKey: e.metaKey,
|
|
10437
|
+
time: Date.now(),
|
|
10390
10438
|
buttons: isUndefined(e.buttons) ? 1 : e.buttons === 0 ? pointerUpButtons : e.buttons,
|
|
10391
10439
|
origin: e
|
|
10392
10440
|
};
|
|
@@ -10422,6 +10470,7 @@ const {getDragEventData: getDragEventData, getDropEventData: getDropEventData, g
|
|
|
10422
10470
|
|
|
10423
10471
|
class Dragger {
|
|
10424
10472
|
constructor(interaction) {
|
|
10473
|
+
this.dragDataList = [];
|
|
10425
10474
|
this.interaction = interaction;
|
|
10426
10475
|
}
|
|
10427
10476
|
setDragData(data) {
|
|
@@ -10484,6 +10533,7 @@ class Dragger {
|
|
|
10484
10533
|
this.dragData = getDragEventData(downData, dragData, data);
|
|
10485
10534
|
if (throughPath) this.dragData.throughPath = throughPath;
|
|
10486
10535
|
this.dragData.path = path;
|
|
10536
|
+
this.dragDataList.push(this.dragData);
|
|
10487
10537
|
if (this.moving) {
|
|
10488
10538
|
data.moving = true;
|
|
10489
10539
|
this.dragData.moveType = "drag";
|
|
@@ -10534,9 +10584,9 @@ class Dragger {
|
|
|
10534
10584
|
interaction.emit(DragEvent.ENTER, data, path, dragEnterPath);
|
|
10535
10585
|
this.dragEnterPath = path;
|
|
10536
10586
|
}
|
|
10537
|
-
dragEnd(data
|
|
10587
|
+
dragEnd(data) {
|
|
10538
10588
|
if (!this.dragging && !this.moving) return;
|
|
10539
|
-
if (this.checkDragEndAnimate(data
|
|
10589
|
+
if (this.checkDragEndAnimate(data)) return;
|
|
10540
10590
|
this.dragEndReal(data);
|
|
10541
10591
|
}
|
|
10542
10592
|
dragEndReal(data) {
|
|
@@ -10578,11 +10628,13 @@ class Dragger {
|
|
|
10578
10628
|
}
|
|
10579
10629
|
dragReset() {
|
|
10580
10630
|
DragEvent.list = DragEvent.data = this.draggableList = this.dragData = this.downData = this.dragOverPath = this.dragEnterPath = null;
|
|
10631
|
+
this.dragDataList = [];
|
|
10581
10632
|
}
|
|
10582
10633
|
checkDragEndAnimate(_data, _speed) {
|
|
10583
10634
|
return false;
|
|
10584
10635
|
}
|
|
10585
10636
|
animate(_func, _off) {}
|
|
10637
|
+
stopAnimate() {}
|
|
10586
10638
|
checkDragOut(_data) {}
|
|
10587
10639
|
autoMoveOnDragOut(_data) {}
|
|
10588
10640
|
autoMoveCancel() {}
|
|
@@ -10976,6 +11028,9 @@ class InteractionBase {
|
|
|
10976
11028
|
this.pointerHover(hoverData);
|
|
10977
11029
|
}
|
|
10978
11030
|
}
|
|
11031
|
+
stopDragAnimate() {
|
|
11032
|
+
this.dragger.stopAnimate();
|
|
11033
|
+
}
|
|
10979
11034
|
updateDownData(data, options, merge) {
|
|
10980
11035
|
const {downData: downData} = this;
|
|
10981
11036
|
if (!data && downData) data = downData;
|
|
@@ -11159,7 +11214,7 @@ Platform.getSelector = function(leaf) {
|
|
|
11159
11214
|
return leaf.leafer ? leaf.leafer.selector : Platform.selector || (Platform.selector = Creator.selector());
|
|
11160
11215
|
};
|
|
11161
11216
|
|
|
11162
|
-
const {toInnerRadiusPointOf: toInnerRadiusPointOf,
|
|
11217
|
+
const {toInnerRadiusPointOf: toInnerRadiusPointOf, copyRadiusPoint: copyRadiusPoint} = PointHelper;
|
|
11163
11218
|
|
|
11164
11219
|
const {hitRadiusPoint: hitRadiusPoint, hitPoint: hitPoint} = BoundsHelper;
|
|
11165
11220
|
|
|
@@ -11169,8 +11224,7 @@ const leaf$1 = Leaf.prototype;
|
|
|
11169
11224
|
|
|
11170
11225
|
leaf$1.hit = function(worldPoint, hitRadius = 0) {
|
|
11171
11226
|
this.updateLayout();
|
|
11172
|
-
|
|
11173
|
-
setRadius(worldRadiusPoint, hitRadius);
|
|
11227
|
+
copyRadiusPoint(worldRadiusPoint, worldPoint, hitRadius);
|
|
11174
11228
|
const world = this.__world;
|
|
11175
11229
|
if (hitRadius ? !hitRadiusPoint(world, worldRadiusPoint) : !hitPoint(world, worldRadiusPoint)) return false;
|
|
11176
11230
|
return this.isBranch ? Platform.getSelector(this).hitPoint(Object.assign({}, worldRadiusPoint), hitRadius, {
|
|
@@ -11184,8 +11238,8 @@ leaf$1.__hitWorld = function(point, forceHitFill) {
|
|
|
11184
11238
|
const world = this.__world, layout = this.__layout;
|
|
11185
11239
|
const isSmall = world.width < 10 && world.height < 10;
|
|
11186
11240
|
if (data.hitRadius) {
|
|
11187
|
-
|
|
11188
|
-
|
|
11241
|
+
copyRadiusPoint(inner, point, data.hitRadius);
|
|
11242
|
+
point = inner;
|
|
11189
11243
|
}
|
|
11190
11244
|
toInnerRadiusPointOf(point, world, inner);
|
|
11191
11245
|
if (data.hitBox || isSmall) {
|
|
@@ -11865,7 +11919,7 @@ function image(ui, attrName, paint, boxBounds, firstUse) {
|
|
|
11865
11919
|
ignoreRender(ui, false);
|
|
11866
11920
|
onLoadError(ui, event, error);
|
|
11867
11921
|
leafPaint.loadId = undefined;
|
|
11868
|
-
});
|
|
11922
|
+
}, paint.lod && image.getThumbSize());
|
|
11869
11923
|
if (ui.placeholderColor) {
|
|
11870
11924
|
if (!ui.placeholderDelay) image.isPlacehold = true; else setTimeout(() => {
|
|
11871
11925
|
if (!image.ready) {
|
|
@@ -12105,10 +12159,12 @@ const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$6} = Math;
|
|
|
12105
12159
|
function createPatternTask(paint, ui, canvas, renderOptions) {
|
|
12106
12160
|
if (!paint.patternTask) {
|
|
12107
12161
|
paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function*() {
|
|
12108
|
-
paint
|
|
12109
|
-
if (canvas.bounds.hit(ui.__nowWorld)) PaintImage.createPattern(paint, ui, canvas, renderOptions);
|
|
12162
|
+
PaintImage.createPattern(paint, ui, canvas, renderOptions);
|
|
12110
12163
|
ui.forceUpdate("surface");
|
|
12111
|
-
}),
|
|
12164
|
+
}), 0, () => {
|
|
12165
|
+
paint.patternTask = null;
|
|
12166
|
+
return canvas.bounds.hit(ui.__nowWorld);
|
|
12167
|
+
});
|
|
12112
12168
|
}
|
|
12113
12169
|
}
|
|
12114
12170
|
|
|
@@ -12358,7 +12414,7 @@ const PaintGradientModule = {
|
|
|
12358
12414
|
getTransform: getTransform
|
|
12359
12415
|
};
|
|
12360
12416
|
|
|
12361
|
-
const {copy: copy$3, move: move$6, toOffsetOutBounds: toOffsetOutBounds$1} = BoundsHelper, {max: max$
|
|
12417
|
+
const {copy: copy$3, move: move$6, toOffsetOutBounds: toOffsetOutBounds$1} = BoundsHelper, {max: max$2, abs: abs$5} = Math;
|
|
12362
12418
|
|
|
12363
12419
|
const tempBounds = {}, tempMatrix = new Matrix;
|
|
12364
12420
|
|
|
@@ -12403,10 +12459,10 @@ function getShadowRenderSpread(_ui, shadow) {
|
|
|
12403
12459
|
let top = 0, right = 0, bottom = 0, left = 0, x, y, spread, blur;
|
|
12404
12460
|
shadow.forEach(item => {
|
|
12405
12461
|
x = item.x || 0, y = item.y || 0, blur = (item.blur || 0) * 1.5, spread = abs$5(item.spread || 0);
|
|
12406
|
-
top = max$
|
|
12407
|
-
right = max$
|
|
12408
|
-
bottom = max$
|
|
12409
|
-
left = max$
|
|
12462
|
+
top = max$2(top, spread + blur - y);
|
|
12463
|
+
right = max$2(right, spread + blur + x);
|
|
12464
|
+
bottom = max$2(bottom, spread + blur + y);
|
|
12465
|
+
left = max$2(left, spread + blur - x);
|
|
12410
12466
|
});
|
|
12411
12467
|
return top === right && right === bottom && bottom === left ? top : [ top, right, bottom, left ];
|
|
12412
12468
|
}
|
|
@@ -13291,7 +13347,11 @@ class Stroker extends UI {
|
|
|
13291
13347
|
matrix$1.half = strokeWidth % 2;
|
|
13292
13348
|
canvas.setWorld(matrix$1, options.matrix);
|
|
13293
13349
|
canvas.beginPath();
|
|
13294
|
-
if (
|
|
13350
|
+
if (this.strokePathType === "path") {
|
|
13351
|
+
leaf.__drawPath(canvas);
|
|
13352
|
+
} else {
|
|
13353
|
+
if (leaf.__.__useArrow) leaf.__drawPath(canvas); else leaf.__.__pathForRender ? leaf.__drawRenderPath(canvas) : leaf.__drawPathByBox(canvas);
|
|
13354
|
+
}
|
|
13295
13355
|
data.strokeWidth = strokeWidth / Math.max(aScaleX, aScaleY);
|
|
13296
13356
|
if (stroke) isString(stroke) ? Paint.stroke(stroke, this, canvas, options) : Paint.strokes(stroke, this, canvas, options);
|
|
13297
13357
|
if (fill) isString(fill) ? Paint.fill(fill, this, canvas, options) : Paint.fills(fill, this, canvas, options);
|
|
@@ -13308,6 +13368,8 @@ class Stroker extends UI {
|
|
|
13308
13368
|
|
|
13309
13369
|
__decorate([ targetAttr(onTarget$1) ], Stroker.prototype, "target", void 0);
|
|
13310
13370
|
|
|
13371
|
+
__decorate([ surfaceType("render-path") ], Stroker.prototype, "strokePathType", void 0);
|
|
13372
|
+
|
|
13311
13373
|
function onTarget$1(stroker) {
|
|
13312
13374
|
const value = stroker.target;
|
|
13313
13375
|
stroker.list = value ? isArray(value) ? value : [ value ] : [];
|
|
@@ -13422,10 +13484,11 @@ class EditSelect extends Group {
|
|
|
13422
13484
|
}
|
|
13423
13485
|
update() {
|
|
13424
13486
|
this.hoverStroker.update();
|
|
13425
|
-
const {stroke: stroke, strokeWidth: strokeWidth, selectedStyle: selectedStyle} = this.editor.mergedConfig;
|
|
13487
|
+
const {stroke: stroke, strokeWidth: strokeWidth, selectedPathType: selectedPathType, selectedStyle: selectedStyle} = this.editor.mergedConfig;
|
|
13426
13488
|
this.targetStroker.update(Object.assign({
|
|
13427
13489
|
stroke: stroke,
|
|
13428
|
-
strokeWidth: strokeWidth && Math.max(1, strokeWidth / 2)
|
|
13490
|
+
strokeWidth: strokeWidth && Math.max(1, strokeWidth / 2),
|
|
13491
|
+
strokePathType: selectedPathType
|
|
13429
13492
|
}, selectedStyle || {}));
|
|
13430
13493
|
}
|
|
13431
13494
|
onPointerMove(e) {
|
|
@@ -14810,7 +14873,7 @@ class TransformTool {
|
|
|
14810
14873
|
const {target: target, mergeConfig: mergeConfig, single: single, dragStartData: dragStartData} = this.editBox;
|
|
14811
14874
|
let {around: around, lockRatio: lockRatio, flipable: flipable, editSize: editSize} = mergeConfig, totalMove;
|
|
14812
14875
|
if (e instanceof ZoomEvent) {
|
|
14813
|
-
around = target.getBoxPoint(e);
|
|
14876
|
+
if (!around) around = target.getBoxPoint(e);
|
|
14814
14877
|
totalMove = e.totalScale;
|
|
14815
14878
|
} else {
|
|
14816
14879
|
totalMove = e.getInnerTotal(target);
|
|
@@ -15863,11 +15926,28 @@ UI.setEditInner = function(editorName) {
|
|
|
15863
15926
|
this.changeAttr("editInner", editorName);
|
|
15864
15927
|
};
|
|
15865
15928
|
|
|
15929
|
+
function getScrollType(leafer) {
|
|
15930
|
+
const {scroll: scroll, disabled: disabled} = leafer.app.config.move;
|
|
15931
|
+
return !scroll || disabled ? "" : scroll === true ? "free" : scroll;
|
|
15932
|
+
}
|
|
15933
|
+
|
|
15866
15934
|
function addViewport(leafer, mergeConfig, custom) {
|
|
15867
15935
|
addViewportConfig(leafer.parentApp ? leafer.parentApp : leafer, mergeConfig);
|
|
15868
15936
|
if (leafer.isApp || custom) return;
|
|
15869
15937
|
leafer.__eventIds.push(leafer.on_(MoveEvent.BEFORE_MOVE, e => {
|
|
15870
|
-
|
|
15938
|
+
const move = leafer.getValidMove(e.moveX, e.moveY, false);
|
|
15939
|
+
if (getScrollType(leafer).includes("limit")) {
|
|
15940
|
+
const testMove = leafer.getValidMove(0, 0);
|
|
15941
|
+
if (testMove.x || testMove.y) {
|
|
15942
|
+
const maxX = 100, maxY = 200, resistance = e.moveType === "drag" ? .3 : .05;
|
|
15943
|
+
if (Math.abs(testMove.x) > maxX) move.x = 0; else move.x *= resistance;
|
|
15944
|
+
if (Math.abs(testMove.y) > maxY) move.y = 0; else move.y *= resistance;
|
|
15945
|
+
}
|
|
15946
|
+
}
|
|
15947
|
+
leafer.zoomLayer.move(move);
|
|
15948
|
+
}), leafer.on_(MoveEvent.DRAG_ANIMATE, () => {
|
|
15949
|
+
const testMove = leafer.getValidMove(0, 0);
|
|
15950
|
+
if (testMove.x || testMove.y) leafer.interaction.stopDragAnimate();
|
|
15871
15951
|
}), leafer.on_(MoveEvent.END, e => {
|
|
15872
15952
|
LeafHelper.animateMove(leafer.zoomLayer, leafer.getValidMove(e.moveX, e.moveY));
|
|
15873
15953
|
}), leafer.on_(ZoomEvent.BEFORE_ZOOM, e => {
|
|
@@ -16018,7 +16098,7 @@ const MultiTouchHelper = {
|
|
|
16018
16098
|
|
|
16019
16099
|
const M$3 = MultiTouchHelper;
|
|
16020
16100
|
|
|
16021
|
-
const {abs: abs$2, max: max} = Math, {sign: sign, within: within$2} = MathHelper;
|
|
16101
|
+
const {abs: abs$2, max: max$1} = Math, {sign: sign, within: within$2} = MathHelper;
|
|
16022
16102
|
|
|
16023
16103
|
const WheelEventHelper = {
|
|
16024
16104
|
getMove(event, config) {
|
|
@@ -16029,8 +16109,8 @@ const WheelEventHelper = {
|
|
|
16029
16109
|
deltaY = 0;
|
|
16030
16110
|
}
|
|
16031
16111
|
const absX = abs$2(deltaX), absY = abs$2(deltaY);
|
|
16032
|
-
if (absX > 50) deltaX = max(50, absX / 3) * sign(deltaX);
|
|
16033
|
-
if (absY > 50) deltaY = max(50, absY / 3) * sign(deltaY);
|
|
16112
|
+
if (absX > 50) deltaX = max$1(50, absX / 3) * sign(deltaX);
|
|
16113
|
+
if (absY > 50) deltaY = max$1(50, absY / 3) * sign(deltaY);
|
|
16034
16114
|
return {
|
|
16035
16115
|
x: -deltaX * moveSpeed * 2,
|
|
16036
16116
|
y: -deltaY * moveSpeed * 2
|
|
@@ -16173,15 +16253,15 @@ leafer.initType = function(type) {
|
|
|
16173
16253
|
};
|
|
16174
16254
|
|
|
16175
16255
|
leafer.getValidMove = function(moveX, moveY, checkLimit = true) {
|
|
16176
|
-
const {
|
|
16256
|
+
const {disabled: disabled} = this.app.config.move;
|
|
16177
16257
|
move$4.set(moveX, moveY);
|
|
16178
|
-
|
|
16179
|
-
|
|
16180
|
-
if (
|
|
16181
|
-
if (checkLimit &&
|
|
16258
|
+
const scrollType = getScrollType(this);
|
|
16259
|
+
if (scrollType) {
|
|
16260
|
+
if (scrollType.includes("x")) move$4.y = 0; else if (scrollType.includes("y")) move$4.x = 0; else Math.abs(move$4.x) > Math.abs(move$4.y) ? move$4.y = 0 : move$4.x = 0;
|
|
16261
|
+
if (checkLimit && scrollType.includes("limit")) {
|
|
16182
16262
|
bounds.set(this.__world).addPoint(this.zoomLayer);
|
|
16183
|
-
DragBoundsHelper.getValidMove(bounds, this.canvas.bounds, "
|
|
16184
|
-
if (
|
|
16263
|
+
DragBoundsHelper.getValidMove(bounds, this.canvas.bounds, "auto", move$4, true);
|
|
16264
|
+
if (scrollType.includes("x")) move$4.y = 0; else if (scrollType.includes("y")) move$4.x = 0;
|
|
16185
16265
|
}
|
|
16186
16266
|
}
|
|
16187
16267
|
return {
|
|
@@ -16288,22 +16368,52 @@ interaction.multiTouch = function(data, list) {
|
|
|
16288
16368
|
|
|
16289
16369
|
const dragger = Dragger.prototype;
|
|
16290
16370
|
|
|
16291
|
-
const {abs: abs$1} = Math;
|
|
16371
|
+
const {abs: abs$1, min: min, max: max, hypot: hypot} = Math;
|
|
16292
16372
|
|
|
16293
|
-
dragger.checkDragEndAnimate = function(data
|
|
16294
|
-
const {
|
|
16295
|
-
const
|
|
16296
|
-
const dragAnimate = this.canAnimate && this.moving && (absMoveX > minMove || absMoveY > minMove) && this.interaction.m.dragAnimate;
|
|
16373
|
+
dragger.checkDragEndAnimate = function(data) {
|
|
16374
|
+
const {interaction: interaction} = this;
|
|
16375
|
+
const dragAnimate = this.canAnimate && this.moving && interaction.m.dragAnimate;
|
|
16297
16376
|
if (dragAnimate) {
|
|
16298
|
-
const inertia =
|
|
16299
|
-
|
|
16300
|
-
|
|
16301
|
-
|
|
16302
|
-
|
|
16303
|
-
this.
|
|
16304
|
-
|
|
16305
|
-
|
|
16306
|
-
|
|
16377
|
+
const inertia = isNumber(dragAnimate) ? dragAnimate : .95;
|
|
16378
|
+
const stopMove = .15;
|
|
16379
|
+
const maxMove = 150;
|
|
16380
|
+
let moveX = 0, moveY = 0, flickSpeed = 0;
|
|
16381
|
+
let totalWeight = 0, weight, w = 3, s, frame;
|
|
16382
|
+
const {dragDataList: dragDataList} = this, len = dragDataList.length;
|
|
16383
|
+
for (let i = len - 1; i >= max(len - 3, 0); i--) {
|
|
16384
|
+
frame = dragDataList[i];
|
|
16385
|
+
if (frame.time && Date.now() - frame.time > 100) break;
|
|
16386
|
+
weight = w--;
|
|
16387
|
+
moveX += frame.moveX * weight;
|
|
16388
|
+
moveY += frame.moveY * weight;
|
|
16389
|
+
totalWeight += weight;
|
|
16390
|
+
s = hypot(frame.moveX, frame.moveY);
|
|
16391
|
+
if (s > flickSpeed) flickSpeed = s;
|
|
16392
|
+
}
|
|
16393
|
+
if (totalWeight) moveX /= totalWeight, moveY /= totalWeight;
|
|
16394
|
+
if (flickSpeed > 8) {
|
|
16395
|
+
const t = min((flickSpeed - 8) / 17, 1);
|
|
16396
|
+
const boost = 1.15 + t * (1.6 - 1.15);
|
|
16397
|
+
moveX *= boost;
|
|
16398
|
+
moveY *= boost;
|
|
16399
|
+
}
|
|
16400
|
+
const maxAbs = max(abs$1(moveX), abs$1(moveY));
|
|
16401
|
+
if (maxAbs > maxMove) {
|
|
16402
|
+
s = maxMove / maxAbs;
|
|
16403
|
+
moveX *= s;
|
|
16404
|
+
moveY *= s;
|
|
16405
|
+
}
|
|
16406
|
+
const step = () => {
|
|
16407
|
+
moveX *= inertia;
|
|
16408
|
+
moveY *= inertia;
|
|
16409
|
+
data = Object.assign({}, data);
|
|
16410
|
+
if (abs$1(moveX) < stopMove && abs$1(moveY) < stopMove) return this.dragEndReal(data);
|
|
16411
|
+
PointHelper.move(data, moveX, moveY);
|
|
16412
|
+
this.drag(data);
|
|
16413
|
+
this.animate(step);
|
|
16414
|
+
interaction.emit(MoveEvent.DRAG_ANIMATE, data);
|
|
16415
|
+
};
|
|
16416
|
+
this.animate(step);
|
|
16307
16417
|
}
|
|
16308
16418
|
return dragAnimate;
|
|
16309
16419
|
};
|
|
@@ -16314,6 +16424,13 @@ dragger.animate = function(func, off) {
|
|
|
16314
16424
|
this.animateWait = func;
|
|
16315
16425
|
};
|
|
16316
16426
|
|
|
16427
|
+
dragger.stopAnimate = function() {
|
|
16428
|
+
this.animate(null, "off");
|
|
16429
|
+
this.interaction.target.nextRender(() => {
|
|
16430
|
+
if (this.dragData) this.dragEndReal(this.dragData);
|
|
16431
|
+
});
|
|
16432
|
+
};
|
|
16433
|
+
|
|
16317
16434
|
dragger.checkDragOut = function(data) {
|
|
16318
16435
|
const {interaction: interaction} = this;
|
|
16319
16436
|
this.autoMoveCancel();
|
|
@@ -16385,7 +16502,6 @@ function getFixBounds(bounds, scaleBounds) {
|
|
|
16385
16502
|
Plugin.add("view");
|
|
16386
16503
|
|
|
16387
16504
|
Leafer.prototype.zoom = function(zoomType, optionsOrPadding, scroll, transition) {
|
|
16388
|
-
this.killAnimate();
|
|
16389
16505
|
let padding;
|
|
16390
16506
|
if (isData(optionsOrPadding)) {
|
|
16391
16507
|
padding = optionsOrPadding.padding;
|
|
@@ -16398,8 +16514,9 @@ Leafer.prototype.zoom = function(zoomType, optionsOrPadding, scroll, transition)
|
|
|
16398
16514
|
x: limitBounds.x + limitBounds.width / 2,
|
|
16399
16515
|
y: limitBounds.y + limitBounds.height / 2
|
|
16400
16516
|
};
|
|
16517
|
+
zoomLayer.killAnimate();
|
|
16401
16518
|
let changeScale;
|
|
16402
|
-
const {x: x, y: y, scaleX: scaleX, scaleY: scaleY} = zoomLayer.__;
|
|
16519
|
+
const {x: x, y: y, scaleX: scaleX, scaleY: scaleY} = zoomLayer.__, {boxBounds: boxBounds} = zoomLayer;
|
|
16403
16520
|
if (isString(zoomType)) {
|
|
16404
16521
|
switch (zoomType) {
|
|
16405
16522
|
case "in":
|
|
@@ -16411,16 +16528,16 @@ Leafer.prototype.zoom = function(zoomType, optionsOrPadding, scroll, transition)
|
|
|
16411
16528
|
break;
|
|
16412
16529
|
|
|
16413
16530
|
case "fit":
|
|
16414
|
-
zoomType =
|
|
16531
|
+
zoomType = boxBounds;
|
|
16415
16532
|
break;
|
|
16416
16533
|
|
|
16417
16534
|
case "fit-width":
|
|
16418
|
-
zoomType = new Bounds(
|
|
16535
|
+
zoomType = new Bounds(boxBounds);
|
|
16419
16536
|
zoomType.height = 0;
|
|
16420
16537
|
break;
|
|
16421
16538
|
|
|
16422
16539
|
case "fit-height":
|
|
16423
|
-
zoomType = new Bounds(
|
|
16540
|
+
zoomType = new Bounds(boxBounds);
|
|
16424
16541
|
zoomType.width = 0;
|
|
16425
16542
|
break;
|
|
16426
16543
|
}
|
|
@@ -17683,6 +17800,8 @@ let Animate = class Animate extends Eventer {
|
|
|
17683
17800
|
}
|
|
17684
17801
|
constructor(target, keyframe, options, isTemp) {
|
|
17685
17802
|
super();
|
|
17803
|
+
this.nowIndex = 0;
|
|
17804
|
+
this.playedTotalTime = 0;
|
|
17686
17805
|
if (keyframe) {
|
|
17687
17806
|
if (keyframe.keyframes) options = keyframe, keyframe = keyframe.keyframes; else if (keyframe.style) options = keyframe,
|
|
17688
17807
|
keyframe = keyframe.style;
|
|
@@ -17729,7 +17848,7 @@ let Animate = class Animate extends Eventer {
|
|
|
17729
17848
|
play() {
|
|
17730
17849
|
if (this.destroyed) return;
|
|
17731
17850
|
this.running = true;
|
|
17732
|
-
if (!this.started) this.clearTimer(), this.start(); else if (!this.timer) this.
|
|
17851
|
+
if (!this.started) this.clearTimer(), this.start(); else if (!this.timer) this.startRequestAnimate();
|
|
17733
17852
|
this.emitType(AnimateEvent.PLAY);
|
|
17734
17853
|
}
|
|
17735
17854
|
pause() {
|
|
@@ -17743,14 +17862,28 @@ let Animate = class Animate extends Eventer {
|
|
|
17743
17862
|
this.complete();
|
|
17744
17863
|
this.emitType(AnimateEvent.STOP);
|
|
17745
17864
|
}
|
|
17746
|
-
seek(time) {
|
|
17865
|
+
seek(time, includeDelay) {
|
|
17747
17866
|
if (this.destroyed) return;
|
|
17748
|
-
|
|
17867
|
+
const {delay: delay} = this;
|
|
17868
|
+
if (isObject(time)) time = UnitConvert.number(time, this.duration + (includeDelay ? delay : 0));
|
|
17869
|
+
if (includeDelay) time -= delay;
|
|
17749
17870
|
if (time) time /= this.speed;
|
|
17750
|
-
|
|
17871
|
+
let waitBeginTime;
|
|
17872
|
+
if (time < 0) {
|
|
17873
|
+
waitBeginTime = -time;
|
|
17874
|
+
time = 0;
|
|
17875
|
+
}
|
|
17876
|
+
if (!this.started || time < this.time || !time) this.start(true);
|
|
17751
17877
|
this.time = time;
|
|
17752
|
-
this.animate(0, true);
|
|
17753
|
-
this.clearTimer(() =>
|
|
17878
|
+
if (!waitBeginTime) this.animate(0, true);
|
|
17879
|
+
this.clearTimer(() => {
|
|
17880
|
+
if (waitBeginTime) {
|
|
17881
|
+
this.timer = setTimeout(() => {
|
|
17882
|
+
this.timer = 0;
|
|
17883
|
+
this.begin();
|
|
17884
|
+
}, waitBeginTime * 1e3);
|
|
17885
|
+
} else this.startRequestAnimate();
|
|
17886
|
+
});
|
|
17754
17887
|
this.emitType(AnimateEvent.SEEK);
|
|
17755
17888
|
}
|
|
17756
17889
|
kill(complete = true, killStyle) {
|
|
@@ -17833,14 +17966,24 @@ let Animate = class Animate extends Eventer {
|
|
|
17833
17966
|
}
|
|
17834
17967
|
}
|
|
17835
17968
|
}
|
|
17836
|
-
|
|
17969
|
+
startRequestAnimate() {
|
|
17837
17970
|
this.requestAnimateTime = Date.now();
|
|
17971
|
+
this.requestAnimatePageTime = 0;
|
|
17972
|
+
if (!this.waitRequestRender) this.requestAnimate();
|
|
17973
|
+
}
|
|
17974
|
+
requestAnimate() {
|
|
17975
|
+
this.waitRequestRender = true;
|
|
17838
17976
|
Platform.requestRender(this.animate.bind(this));
|
|
17839
17977
|
}
|
|
17840
|
-
animate(
|
|
17978
|
+
animate(pageTime, seek) {
|
|
17841
17979
|
if (!seek) {
|
|
17980
|
+
this.waitRequestRender = false;
|
|
17842
17981
|
if (!this.running) return;
|
|
17843
|
-
|
|
17982
|
+
let frameTime;
|
|
17983
|
+
if (pageTime && this.requestAnimatePageTime) frameTime = pageTime - this.requestAnimatePageTime; else frameTime = Date.now() - this.requestAnimateTime;
|
|
17984
|
+
this.time += frameTime / 1e3;
|
|
17985
|
+
this.requestAnimatePageTime = pageTime;
|
|
17986
|
+
this.requestAnimateTime = Date.now();
|
|
17844
17987
|
}
|
|
17845
17988
|
const {duration: duration} = this, realTime = this.time * this.speed;
|
|
17846
17989
|
if (realTime < duration) {
|
|
@@ -17881,21 +18024,24 @@ let Animate = class Animate extends Eventer {
|
|
|
17881
18024
|
}
|
|
17882
18025
|
start(seek) {
|
|
17883
18026
|
this.requestAnimateTime = 1;
|
|
17884
|
-
const {reverse: reverse} = this;
|
|
18027
|
+
const {reverse: reverse, jump: jump} = this;
|
|
17885
18028
|
if (reverse || this.mainReverse) this.mainReverse = reverse;
|
|
17886
18029
|
if (this.looped) this.looped = 0;
|
|
17887
18030
|
if (seek) this.begin(true); else {
|
|
17888
18031
|
const {delay: delay} = this;
|
|
17889
|
-
if (delay)
|
|
17890
|
-
this.
|
|
17891
|
-
this.
|
|
17892
|
-
|
|
18032
|
+
if (delay) {
|
|
18033
|
+
if (jump) this.begin(true);
|
|
18034
|
+
this.timer = setTimeout(() => {
|
|
18035
|
+
this.timer = 0;
|
|
18036
|
+
this.begin();
|
|
18037
|
+
}, delay / this.speed * 1e3);
|
|
18038
|
+
} else this.begin();
|
|
17893
18039
|
}
|
|
17894
18040
|
}
|
|
17895
18041
|
begin(seek) {
|
|
17896
18042
|
this.playedTotalTime = this.time = 0;
|
|
17897
18043
|
this.mainReverse ? this.setTo() : this.setFrom();
|
|
17898
|
-
if (!seek) this.
|
|
18044
|
+
if (!seek) this.startRequestAnimate();
|
|
17899
18045
|
}
|
|
17900
18046
|
end() {
|
|
17901
18047
|
this.mainReverse ? this.setFrom() : this.setTo();
|
|
@@ -18011,6 +18157,8 @@ __decorate([ animateAttr(true) ], Animate.prototype, "autoplay", void 0);
|
|
|
18011
18157
|
|
|
18012
18158
|
__decorate([ animateAttr() ], Animate.prototype, "join", void 0);
|
|
18013
18159
|
|
|
18160
|
+
__decorate([ animateAttr() ], Animate.prototype, "jump", void 0);
|
|
18161
|
+
|
|
18014
18162
|
__decorate([ animateAttr() ], Animate.prototype, "attrs", void 0);
|
|
18015
18163
|
|
|
18016
18164
|
Animate = __decorate([ useModule(LeafEventer) ], Animate);
|
|
@@ -18057,8 +18205,8 @@ let AnimateList = class AnimateList extends Animate {
|
|
|
18057
18205
|
this.each(item => item.stop());
|
|
18058
18206
|
this.emitType(AnimateEvent.STOP);
|
|
18059
18207
|
}
|
|
18060
|
-
seek(time) {
|
|
18061
|
-
this.each(item => item.seek(time));
|
|
18208
|
+
seek(time, includeDelay) {
|
|
18209
|
+
this.each(item => item.seek(time, includeDelay));
|
|
18062
18210
|
this.emitType(AnimateEvent.SEEK);
|
|
18063
18211
|
}
|
|
18064
18212
|
kill(complete, killStyle) {
|
|
@@ -18249,7 +18397,7 @@ const hslMatch = /^hsl\((\d+),\s*(\d+)%\s*,\s*(\d+)%/i;
|
|
|
18249
18397
|
|
|
18250
18398
|
const hslaMatch = /^hsla\((\d+),\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d*\.?\d+)/i;
|
|
18251
18399
|
|
|
18252
|
-
const int = parseInt, float = parseFloat, {round: round$1} = Math;
|
|
18400
|
+
const int = parseInt, float$1 = parseFloat, {round: round$1} = Math;
|
|
18253
18401
|
|
|
18254
18402
|
let cache = {}, totalCache = 0;
|
|
18255
18403
|
|
|
@@ -18362,18 +18510,18 @@ function rgbaToRGBA(color) {
|
|
|
18362
18510
|
r: int(match[1]),
|
|
18363
18511
|
g: int(match[2]),
|
|
18364
18512
|
b: int(match[3]),
|
|
18365
|
-
a: float(match[4])
|
|
18513
|
+
a: float$1(match[4])
|
|
18366
18514
|
};
|
|
18367
18515
|
}
|
|
18368
18516
|
|
|
18369
18517
|
function hslToRGBA(color) {
|
|
18370
18518
|
const match = hslMatch.exec(color);
|
|
18371
|
-
return hsla(float(match[1]), float(match[2]), float(match[3]), 1);
|
|
18519
|
+
return hsla(float$1(match[1]), float$1(match[2]), float$1(match[3]), 1);
|
|
18372
18520
|
}
|
|
18373
18521
|
|
|
18374
18522
|
function hslaToRGBA(color) {
|
|
18375
18523
|
const match = hslaMatch.exec(color);
|
|
18376
|
-
return hsla(float(match[1]), float(match[2]), float(match[3]), float(match[4]));
|
|
18524
|
+
return hsla(float$1(match[1]), float$1(match[2]), float$1(match[3]), float$1(match[4]));
|
|
18377
18525
|
}
|
|
18378
18526
|
|
|
18379
18527
|
const n1 = 1 / 6, n2 = .5, n3 = 2 / 3, n4 = 1 / 3;
|
|
@@ -18612,7 +18760,7 @@ const HighBezierHelper = {
|
|
|
18612
18760
|
|
|
18613
18761
|
const {getDistance: getDistance} = HighBezierHelper;
|
|
18614
18762
|
|
|
18615
|
-
const {M: M, L: L, C: C, Z: Z} = PathCommandMap;
|
|
18763
|
+
const {M: M, L: L, C: C, Z: Z} = PathCommandMap, {float: float} = MathHelper;
|
|
18616
18764
|
|
|
18617
18765
|
const tempPoint = {}, tempFrom = {};
|
|
18618
18766
|
|
|
@@ -18749,7 +18897,7 @@ const HighCurveHelper = {
|
|
|
18749
18897
|
getDistancePath(distanceData, motionDistance, motionPrecision) {
|
|
18750
18898
|
const {segments: segments, data: data} = distanceData, path = [];
|
|
18751
18899
|
motionDistance = UnitConvert.number(motionDistance, distanceData.total);
|
|
18752
|
-
let total = 0, distance, to = {};
|
|
18900
|
+
let total = 0, distance, cutDistance, to = {};
|
|
18753
18901
|
let i = 0, index = 0, x = 0, y = 0, toX, toY, command;
|
|
18754
18902
|
let x1, y1, x2, y2, t;
|
|
18755
18903
|
const len = data.length;
|
|
@@ -18761,14 +18909,17 @@ const HighCurveHelper = {
|
|
|
18761
18909
|
toX = data[i + 1];
|
|
18762
18910
|
toY = data[i + 2];
|
|
18763
18911
|
distance = segments[index];
|
|
18764
|
-
if (total + distance
|
|
18912
|
+
if (total + distance > motionDistance || !distanceData.total) {
|
|
18765
18913
|
if (!i) x = toX, y = toY;
|
|
18766
18914
|
tempFrom.x = x;
|
|
18767
18915
|
tempFrom.y = y;
|
|
18768
18916
|
to.x = toX;
|
|
18769
18917
|
to.y = toY;
|
|
18770
|
-
|
|
18771
|
-
|
|
18918
|
+
cutDistance = float(motionDistance - total);
|
|
18919
|
+
if (cutDistance) {
|
|
18920
|
+
PointHelper.getDistancePoint(tempFrom, to, cutDistance, true);
|
|
18921
|
+
path.push(command, to.x, to.y);
|
|
18922
|
+
}
|
|
18772
18923
|
return path;
|
|
18773
18924
|
}
|
|
18774
18925
|
x = toX;
|
|
@@ -18782,9 +18933,12 @@ const HighCurveHelper = {
|
|
|
18782
18933
|
toX = data[i + 5];
|
|
18783
18934
|
toY = data[i + 6];
|
|
18784
18935
|
distance = segments[index];
|
|
18785
|
-
if (total + distance
|
|
18786
|
-
|
|
18787
|
-
|
|
18936
|
+
if (total + distance > motionDistance) {
|
|
18937
|
+
cutDistance = float(motionDistance - total);
|
|
18938
|
+
if (cutDistance) {
|
|
18939
|
+
t = HighBezierHelper.getT(cutDistance, distance, x, y, x1, y1, x2, y2, toX, toY, motionPrecision);
|
|
18940
|
+
HighBezierHelper.cut(path, t, x, y, x1, y1, x2, y2, toX, toY);
|
|
18941
|
+
}
|
|
18788
18942
|
return path;
|
|
18789
18943
|
}
|
|
18790
18944
|
x = toX;
|
|
@@ -19515,6 +19669,7 @@ class Finder {
|
|
|
19515
19669
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
19516
19670
|
child = children[i];
|
|
19517
19671
|
result = method(child, options);
|
|
19672
|
+
if (typeof result === "boolean") result = result ? 1 : 0;
|
|
19518
19673
|
if (result === Yes || result === YesAndSkip) {
|
|
19519
19674
|
if (list) {
|
|
19520
19675
|
list.push(child);
|
|
@@ -19858,4 +20013,4 @@ Plugin.add("bright");
|
|
|
19858
20013
|
|
|
19859
20014
|
UI.addAttr("bright", false, dimType);
|
|
19860
20015
|
|
|
19861
|
-
export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, 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, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, 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, LeaferTypeCreator, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, 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$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$2 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$
|
|
20016
|
+
export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, 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, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, 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, LeaferTypeCreator, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, 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$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, 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 };
|