@leafer/miniapp 2.0.6 → 2.0.8
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.cjs +11 -0
- package/dist/miniapp.esm.js +2 -0
- package/dist/miniapp.esm.min.js +1 -1
- package/dist/miniapp.esm.min.js.map +1 -1
- package/dist/miniapp.min.cjs +1 -1
- package/dist/miniapp.min.cjs.map +1 -1
- package/dist/miniapp.module.js +506 -194
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +25 -24
- package/src/index.ts +1 -0
- package/types/index.d.ts +1 -0
package/dist/miniapp.module.js
CHANGED
|
@@ -492,13 +492,13 @@ const MatrixHelper = {
|
|
|
492
492
|
to.f = t.f * pixelRatio;
|
|
493
493
|
},
|
|
494
494
|
scaleOfOuter(t, origin, scaleX, scaleY) {
|
|
495
|
-
M$
|
|
496
|
-
M$
|
|
495
|
+
M$c.toInnerPoint(t, origin, tempPoint$5);
|
|
496
|
+
M$c.scaleOfInner(t, tempPoint$5, scaleX, scaleY);
|
|
497
497
|
},
|
|
498
498
|
scaleOfInner(t, origin, scaleX, scaleY = scaleX) {
|
|
499
|
-
M$
|
|
500
|
-
M$
|
|
501
|
-
M$
|
|
499
|
+
M$c.translateInner(t, origin.x, origin.y);
|
|
500
|
+
M$c.scale(t, scaleX, scaleY);
|
|
501
|
+
M$c.translateInner(t, -origin.x, -origin.y);
|
|
502
502
|
},
|
|
503
503
|
rotate(t, rotation) {
|
|
504
504
|
const {a: a, b: b, c: c, d: d} = t;
|
|
@@ -511,13 +511,13 @@ const MatrixHelper = {
|
|
|
511
511
|
t.d = c * sinR + d * cosR;
|
|
512
512
|
},
|
|
513
513
|
rotateOfOuter(t, origin, rotation) {
|
|
514
|
-
M$
|
|
515
|
-
M$
|
|
514
|
+
M$c.toInnerPoint(t, origin, tempPoint$5);
|
|
515
|
+
M$c.rotateOfInner(t, tempPoint$5, rotation);
|
|
516
516
|
},
|
|
517
517
|
rotateOfInner(t, origin, rotation) {
|
|
518
|
-
M$
|
|
519
|
-
M$
|
|
520
|
-
M$
|
|
518
|
+
M$c.translateInner(t, origin.x, origin.y);
|
|
519
|
+
M$c.rotate(t, rotation);
|
|
520
|
+
M$c.translateInner(t, -origin.x, -origin.y);
|
|
521
521
|
},
|
|
522
522
|
skew(t, skewX, skewY) {
|
|
523
523
|
const {a: a, b: b, c: c, d: d} = t;
|
|
@@ -533,13 +533,13 @@ const MatrixHelper = {
|
|
|
533
533
|
}
|
|
534
534
|
},
|
|
535
535
|
skewOfOuter(t, origin, skewX, skewY) {
|
|
536
|
-
M$
|
|
537
|
-
M$
|
|
536
|
+
M$c.toInnerPoint(t, origin, tempPoint$5);
|
|
537
|
+
M$c.skewOfInner(t, tempPoint$5, skewX, skewY);
|
|
538
538
|
},
|
|
539
539
|
skewOfInner(t, origin, skewX, skewY = 0) {
|
|
540
|
-
M$
|
|
541
|
-
M$
|
|
542
|
-
M$
|
|
540
|
+
M$c.translateInner(t, origin.x, origin.y);
|
|
541
|
+
M$c.skew(t, skewX, skewY);
|
|
542
|
+
M$c.translateInner(t, -origin.x, -origin.y);
|
|
543
543
|
},
|
|
544
544
|
multiply(t, child) {
|
|
545
545
|
const {a: a, b: b, c: c, d: d, e: e, f: f} = t;
|
|
@@ -578,15 +578,15 @@ const MatrixHelper = {
|
|
|
578
578
|
to.f = e * parent.b + f * parent.d + parent.f;
|
|
579
579
|
},
|
|
580
580
|
divide(t, child) {
|
|
581
|
-
M$
|
|
581
|
+
M$c.multiply(t, M$c.tempInvert(child));
|
|
582
582
|
},
|
|
583
583
|
divideParent(t, parent) {
|
|
584
|
-
M$
|
|
584
|
+
M$c.multiplyParent(t, M$c.tempInvert(parent));
|
|
585
585
|
},
|
|
586
586
|
tempInvert(t) {
|
|
587
|
-
const {tempMatrix: tempMatrix} = M$
|
|
588
|
-
M$
|
|
589
|
-
M$
|
|
587
|
+
const {tempMatrix: tempMatrix} = M$c;
|
|
588
|
+
M$c.copy(tempMatrix, t);
|
|
589
|
+
M$c.invert(tempMatrix);
|
|
590
590
|
return tempMatrix;
|
|
591
591
|
},
|
|
592
592
|
invert(t) {
|
|
@@ -664,7 +664,7 @@ const MatrixHelper = {
|
|
|
664
664
|
}
|
|
665
665
|
t.e = x;
|
|
666
666
|
t.f = y;
|
|
667
|
-
if (origin = origin || around) M$
|
|
667
|
+
if (origin = origin || around) M$c.translateInner(t, -origin.x, -origin.y, !around);
|
|
668
668
|
},
|
|
669
669
|
getLayout(t, origin, around, firstSkewY) {
|
|
670
670
|
const {a: a, b: b, c: c, d: d, e: e, f: f} = t;
|
|
@@ -725,17 +725,17 @@ const MatrixHelper = {
|
|
|
725
725
|
return world;
|
|
726
726
|
},
|
|
727
727
|
reset(t) {
|
|
728
|
-
M$
|
|
728
|
+
M$c.set(t);
|
|
729
729
|
}
|
|
730
730
|
};
|
|
731
731
|
|
|
732
|
-
const M$
|
|
732
|
+
const M$c = MatrixHelper;
|
|
733
733
|
|
|
734
734
|
const {float: float$5} = MathHelper;
|
|
735
735
|
|
|
736
736
|
const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
|
|
737
737
|
|
|
738
|
-
const {sin: sin$5, cos: cos$5, abs: abs$
|
|
738
|
+
const {sin: sin$5, cos: cos$5, abs: abs$b, sqrt: sqrt$4, atan2: atan2$2, min: min$3, round: round$5} = Math;
|
|
739
739
|
|
|
740
740
|
const PointHelper = {
|
|
741
741
|
defaultPoint: getPointData(),
|
|
@@ -833,8 +833,8 @@ const PointHelper = {
|
|
|
833
833
|
return getDistanceFrom(t.x, t.y, point.x, point.y);
|
|
834
834
|
},
|
|
835
835
|
getDistanceFrom(x1, y1, x2, y2) {
|
|
836
|
-
const x = abs$
|
|
837
|
-
const y = abs$
|
|
836
|
+
const x = abs$b(x2 - x1);
|
|
837
|
+
const y = abs$b(y2 - y1);
|
|
838
838
|
return sqrt$4(x * x + y * y);
|
|
839
839
|
},
|
|
840
840
|
getMinDistanceFrom(x1, y1, x2, y2, x3, y3) {
|
|
@@ -2700,20 +2700,20 @@ const RectHelper = {
|
|
|
2700
2700
|
}
|
|
2701
2701
|
};
|
|
2702
2702
|
|
|
2703
|
-
const {sin: sin$4, cos: cos$4, hypot: hypot$1, atan2: atan2$1, ceil: ceil$1, abs: abs$
|
|
2703
|
+
const {sin: sin$4, cos: cos$4, hypot: hypot$1, atan2: atan2$1, ceil: ceil$1, abs: abs$a, PI: PI$3, sqrt: sqrt$3, pow: pow$1} = Math;
|
|
2704
2704
|
|
|
2705
2705
|
const {setPoint: setPoint$4, addPoint: addPoint$2} = TwoPointBoundsHelper;
|
|
2706
2706
|
|
|
2707
2707
|
const {set: set$1, toNumberPoints: toNumberPoints$1} = PointHelper;
|
|
2708
2708
|
|
|
2709
|
-
const {M: M$
|
|
2709
|
+
const {M: M$b, L: L$b, C: C$9, Q: Q$7, Z: Z$9} = PathCommandMap;
|
|
2710
2710
|
|
|
2711
2711
|
const tempPoint$3 = {};
|
|
2712
2712
|
|
|
2713
2713
|
const BezierHelper = {
|
|
2714
2714
|
points(data, originPoints, curve, close) {
|
|
2715
2715
|
let points = toNumberPoints$1(originPoints);
|
|
2716
|
-
data.push(M$
|
|
2716
|
+
data.push(M$b, points[0], points[1]);
|
|
2717
2717
|
if (curve && points.length > 5) {
|
|
2718
2718
|
let aX, aY, bX, bY, cX, cY, c1X, c1Y, c2X, c2Y;
|
|
2719
2719
|
let baX, baY, ba, cb, d, len = points.length;
|
|
@@ -2744,7 +2744,7 @@ const BezierHelper = {
|
|
|
2744
2744
|
if (i === 2) {
|
|
2745
2745
|
if (!close) data.push(Q$7, c1X, c1Y, bX, bY);
|
|
2746
2746
|
} else {
|
|
2747
|
-
if (baX || baY) data.push(C$
|
|
2747
|
+
if (baX || baY) data.push(C$9, c2X, c2Y, c1X, c1Y, bX, bY);
|
|
2748
2748
|
}
|
|
2749
2749
|
c2X = bX + cb * cX;
|
|
2750
2750
|
c2Y = bY + cb * cY;
|
|
@@ -2752,10 +2752,10 @@ const BezierHelper = {
|
|
|
2752
2752
|
if (!close) data.push(Q$7, c2X, c2Y, points[len - 2], points[len - 1]);
|
|
2753
2753
|
} else {
|
|
2754
2754
|
for (let i = 2, len = points.length; i < len; i += 2) {
|
|
2755
|
-
data.push(L$
|
|
2755
|
+
data.push(L$b, points[i], points[i + 1]);
|
|
2756
2756
|
}
|
|
2757
2757
|
}
|
|
2758
|
-
if (close) data.push(Z$
|
|
2758
|
+
if (close) data.push(Z$9);
|
|
2759
2759
|
},
|
|
2760
2760
|
rect(data, x, y, width, height) {
|
|
2761
2761
|
PathHelper.creator.path = data;
|
|
@@ -2777,8 +2777,8 @@ const BezierHelper = {
|
|
|
2777
2777
|
const lenCB = hypot$1(CBx, CBy);
|
|
2778
2778
|
let totalRadian = endRadian - startRadian;
|
|
2779
2779
|
if (totalRadian < 0) totalRadian += PI2;
|
|
2780
|
-
if (lenBA < 1e-12 || lenCB < 1e-12 || totalRadian < 1e-12 || abs$
|
|
2781
|
-
if (data) data.push(L$
|
|
2780
|
+
if (lenBA < 1e-12 || lenCB < 1e-12 || totalRadian < 1e-12 || abs$a(totalRadian - PI$3) < 1e-12) {
|
|
2781
|
+
if (data) data.push(L$b, x1, y1);
|
|
2782
2782
|
if (setPointBounds) {
|
|
2783
2783
|
setPoint$4(setPointBounds, fromX, fromY);
|
|
2784
2784
|
addPoint$2(setPointBounds, x1, y1);
|
|
@@ -2810,7 +2810,7 @@ const BezierHelper = {
|
|
|
2810
2810
|
let totalRadian = endRadian - startRadian;
|
|
2811
2811
|
if (totalRadian < 0) totalRadian += PI2; else if (totalRadian > PI2) totalRadian -= PI2;
|
|
2812
2812
|
if (anticlockwise) totalRadian -= PI2;
|
|
2813
|
-
const parts = ceil$1(abs$
|
|
2813
|
+
const parts = ceil$1(abs$a(totalRadian / PI_2));
|
|
2814
2814
|
const partRadian = totalRadian / parts;
|
|
2815
2815
|
const partRadian4Sin = sin$4(partRadian / 4);
|
|
2816
2816
|
const control = 8 / 3 * partRadian4Sin * partRadian4Sin / sin$4(partRadian / 2);
|
|
@@ -2822,7 +2822,7 @@ const BezierHelper = {
|
|
|
2822
2822
|
let startX = x = rotationCos * radiusX * startCos - rotationSin * radiusY * startSin;
|
|
2823
2823
|
let startY = y = rotationSin * radiusX * startCos + rotationCos * radiusY * startSin;
|
|
2824
2824
|
let fromX = cx + x, fromY = cy + y;
|
|
2825
|
-
if (data) data.push(data.length ? L$
|
|
2825
|
+
if (data) data.push(data.length ? L$b : M$b, fromX, fromY);
|
|
2826
2826
|
if (setPointBounds) setPoint$4(setPointBounds, fromX, fromY);
|
|
2827
2827
|
if (setStartPoint) set$1(setStartPoint, fromX, fromY);
|
|
2828
2828
|
for (let i = 0; i < parts; i++) {
|
|
@@ -2834,7 +2834,7 @@ const BezierHelper = {
|
|
|
2834
2834
|
y1 = cy + startY - control * (rotationSin * radiusX * startSin - rotationCos * radiusY * startCos);
|
|
2835
2835
|
x2 = cx + x + control * (rotationCos * radiusX * endSin + rotationSin * radiusY * endCos);
|
|
2836
2836
|
y2 = cy + y + control * (rotationSin * radiusX * endSin - rotationCos * radiusY * endCos);
|
|
2837
|
-
if (data) data.push(C$
|
|
2837
|
+
if (data) data.push(C$9, x1, y1, x2, y2, cx + x, cy + y);
|
|
2838
2838
|
if (setPointBounds) toTwoPointBounds$1(cx + startX, cy + startY, x1, y1, x2, y2, cx + x, cy + y, setPointBounds, true);
|
|
2839
2839
|
startX = x;
|
|
2840
2840
|
startY = y;
|
|
@@ -2846,7 +2846,7 @@ const BezierHelper = {
|
|
|
2846
2846
|
if (setEndPoint) set$1(setEndPoint, cx + x, cy + y);
|
|
2847
2847
|
},
|
|
2848
2848
|
quadraticCurveTo(data, fromX, fromY, x1, y1, toX, toY) {
|
|
2849
|
-
data.push(C$
|
|
2849
|
+
data.push(C$9, (fromX + 2 * x1) / 3, (fromY + 2 * y1) / 3, (toX + 2 * x1) / 3, (toY + 2 * y1) / 3, toX, toY);
|
|
2850
2850
|
},
|
|
2851
2851
|
toTwoPointBoundsByQuadraticCurve(fromX, fromY, x1, y1, toX, toY, pointBounds, addMode) {
|
|
2852
2852
|
toTwoPointBounds$1(fromX, fromY, (fromX + 2 * x1) / 3, (fromY + 2 * y1) / 3, (toX + 2 * x1) / 3, (toY + 2 * y1) / 3, toX, toY, pointBounds, addMode);
|
|
@@ -2896,6 +2896,32 @@ const BezierHelper = {
|
|
|
2896
2896
|
getDerivative(t, fromV, v1, v2, toV) {
|
|
2897
2897
|
const o = 1 - t;
|
|
2898
2898
|
return 3 * o * o * (v1 - fromV) + 6 * o * t * (v2 - v1) + 3 * t * t * (toV - v2);
|
|
2899
|
+
},
|
|
2900
|
+
cut(t, fromX, fromY, x1, y1, x2, y2, toX, toY) {
|
|
2901
|
+
if (t <= 0) return {
|
|
2902
|
+
left: null,
|
|
2903
|
+
right: [ x1, y1, x2, y2, toX, toY ]
|
|
2904
|
+
}; else if (t >= 1) return {
|
|
2905
|
+
left: [ x1, y1, x2, y2, toX, toY ],
|
|
2906
|
+
right: null
|
|
2907
|
+
};
|
|
2908
|
+
const u = 1 - t;
|
|
2909
|
+
const leftX1 = fromX * u + x1 * t;
|
|
2910
|
+
const leftY1 = fromY * u + y1 * t;
|
|
2911
|
+
const P12x = x1 * u + x2 * t;
|
|
2912
|
+
const P12y = y1 * u + y2 * t;
|
|
2913
|
+
const rightX2 = x2 * u + toX * t;
|
|
2914
|
+
const rightY2 = y2 * u + toY * t;
|
|
2915
|
+
const leftX2 = leftX1 * u + P12x * t;
|
|
2916
|
+
const leftY2 = leftY1 * u + P12y * t;
|
|
2917
|
+
const rightX1 = P12x * u + rightX2 * t;
|
|
2918
|
+
const rightY1 = P12y * u + rightY2 * t;
|
|
2919
|
+
const leftX = leftX2 * u + rightX1 * t;
|
|
2920
|
+
const leftY = leftY2 * u + rightY1 * t;
|
|
2921
|
+
return {
|
|
2922
|
+
left: [ leftX1, leftY1, leftX2, leftY2, leftX, leftY ],
|
|
2923
|
+
right: [ rightX1, rightY1, rightX2, rightY2, toX, toY ]
|
|
2924
|
+
};
|
|
2899
2925
|
}
|
|
2900
2926
|
};
|
|
2901
2927
|
|
|
@@ -2961,9 +2987,9 @@ const PathCommandNodeHelper = {
|
|
|
2961
2987
|
}
|
|
2962
2988
|
};
|
|
2963
2989
|
|
|
2964
|
-
const {M: M$
|
|
2990
|
+
const {M: M$a, m: m, L: L$a, l: l, H: H, h: h, V: V, v: v, C: C$8, c: c, S: S$1, s: s, Q: Q$6, q: q, T: T, t: t, A: A, a: a, Z: Z$8, z: z, N: N$5, D: D$6, X: X$5, G: G$5, F: F$6, O: O$6, P: P$5, U: U$5} = PathCommandMap;
|
|
2965
2991
|
|
|
2966
|
-
const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$
|
|
2992
|
+
const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$4, arc: arc$3, ellipse: ellipse$6, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
|
|
2967
2993
|
|
|
2968
2994
|
const {ellipticalArc: ellipticalArc} = EllipseHelper;
|
|
2969
2995
|
|
|
@@ -3053,10 +3079,10 @@ const PathConvert = {
|
|
|
3053
3079
|
old[i + 1] += x;
|
|
3054
3080
|
old[i + 2] += y;
|
|
3055
3081
|
|
|
3056
|
-
case M$
|
|
3082
|
+
case M$a:
|
|
3057
3083
|
x = old[i + 1];
|
|
3058
3084
|
y = old[i + 2];
|
|
3059
|
-
data.push(M$
|
|
3085
|
+
data.push(M$a, x, y);
|
|
3060
3086
|
i += 3;
|
|
3061
3087
|
break;
|
|
3062
3088
|
|
|
@@ -3065,7 +3091,7 @@ const PathConvert = {
|
|
|
3065
3091
|
|
|
3066
3092
|
case H:
|
|
3067
3093
|
x = old[i + 1];
|
|
3068
|
-
data.push(L$
|
|
3094
|
+
data.push(L$a, x, y);
|
|
3069
3095
|
i += 2;
|
|
3070
3096
|
break;
|
|
3071
3097
|
|
|
@@ -3074,7 +3100,7 @@ const PathConvert = {
|
|
|
3074
3100
|
|
|
3075
3101
|
case V:
|
|
3076
3102
|
y = old[i + 1];
|
|
3077
|
-
data.push(L$
|
|
3103
|
+
data.push(L$a, x, y);
|
|
3078
3104
|
i += 2;
|
|
3079
3105
|
break;
|
|
3080
3106
|
|
|
@@ -3082,10 +3108,10 @@ const PathConvert = {
|
|
|
3082
3108
|
old[i + 1] += x;
|
|
3083
3109
|
old[i + 2] += y;
|
|
3084
3110
|
|
|
3085
|
-
case L$
|
|
3111
|
+
case L$a:
|
|
3086
3112
|
x = old[i + 1];
|
|
3087
3113
|
y = old[i + 2];
|
|
3088
|
-
data.push(L$
|
|
3114
|
+
data.push(L$a, x, y);
|
|
3089
3115
|
i += 3;
|
|
3090
3116
|
break;
|
|
3091
3117
|
|
|
@@ -3097,14 +3123,14 @@ const PathConvert = {
|
|
|
3097
3123
|
command = S$1;
|
|
3098
3124
|
|
|
3099
3125
|
case S$1:
|
|
3100
|
-
smooth = lastCommand === C$
|
|
3126
|
+
smooth = lastCommand === C$8 || lastCommand === S$1;
|
|
3101
3127
|
x1 = smooth ? x * 2 - controlX : old[i + 1];
|
|
3102
3128
|
y1 = smooth ? y * 2 - controlY : old[i + 2];
|
|
3103
3129
|
controlX = old[i + 1];
|
|
3104
3130
|
controlY = old[i + 2];
|
|
3105
3131
|
x = old[i + 3];
|
|
3106
3132
|
y = old[i + 4];
|
|
3107
|
-
data.push(C$
|
|
3133
|
+
data.push(C$8, x1, y1, controlX, controlY, x, y);
|
|
3108
3134
|
i += 5;
|
|
3109
3135
|
break;
|
|
3110
3136
|
|
|
@@ -3115,14 +3141,14 @@ const PathConvert = {
|
|
|
3115
3141
|
old[i + 4] += y;
|
|
3116
3142
|
old[i + 5] += x;
|
|
3117
3143
|
old[i + 6] += y;
|
|
3118
|
-
command = C$
|
|
3144
|
+
command = C$8;
|
|
3119
3145
|
|
|
3120
|
-
case C$
|
|
3146
|
+
case C$8:
|
|
3121
3147
|
controlX = old[i + 3];
|
|
3122
3148
|
controlY = old[i + 4];
|
|
3123
3149
|
x = old[i + 5];
|
|
3124
3150
|
y = old[i + 6];
|
|
3125
|
-
data.push(C$
|
|
3151
|
+
data.push(C$8, old[i + 1], old[i + 2], controlX, controlY, x, y);
|
|
3126
3152
|
i += 7;
|
|
3127
3153
|
break;
|
|
3128
3154
|
|
|
@@ -3169,8 +3195,8 @@ const PathConvert = {
|
|
|
3169
3195
|
break;
|
|
3170
3196
|
|
|
3171
3197
|
case z:
|
|
3172
|
-
case Z$
|
|
3173
|
-
data.push(Z$
|
|
3198
|
+
case Z$8:
|
|
3199
|
+
data.push(Z$8);
|
|
3174
3200
|
i++;
|
|
3175
3201
|
break;
|
|
3176
3202
|
|
|
@@ -3224,7 +3250,7 @@ const PathConvert = {
|
|
|
3224
3250
|
break;
|
|
3225
3251
|
|
|
3226
3252
|
case U$5:
|
|
3227
|
-
arcTo$
|
|
3253
|
+
arcTo$4(curveMode ? data : copyData(data, old, i, 6), x, y, old[i + 1], old[i + 2], old[i + 3], old[i + 4], old[i + 5], null, setEndPoint$1);
|
|
3228
3254
|
x = setEndPoint$1.x;
|
|
3229
3255
|
y = setEndPoint$1.y;
|
|
3230
3256
|
i += 6;
|
|
@@ -3246,15 +3272,15 @@ const PathConvert = {
|
|
|
3246
3272
|
list.forEach(item => {
|
|
3247
3273
|
switch (item.name) {
|
|
3248
3274
|
case "M":
|
|
3249
|
-
data.push(M$
|
|
3275
|
+
data.push(M$a, item.x, item.y);
|
|
3250
3276
|
break;
|
|
3251
3277
|
|
|
3252
3278
|
case "L":
|
|
3253
|
-
data.push(L$
|
|
3279
|
+
data.push(L$a, item.x, item.y);
|
|
3254
3280
|
break;
|
|
3255
3281
|
|
|
3256
3282
|
case "C":
|
|
3257
|
-
data.push(C$
|
|
3283
|
+
data.push(C$8, item.x1, item.y1, item.x2, item.y2, item.x, item.y);
|
|
3258
3284
|
break;
|
|
3259
3285
|
|
|
3260
3286
|
case "Q":
|
|
@@ -3262,7 +3288,7 @@ const PathConvert = {
|
|
|
3262
3288
|
break;
|
|
3263
3289
|
|
|
3264
3290
|
case "Z":
|
|
3265
|
-
data.push(Z$
|
|
3291
|
+
data.push(Z$8);
|
|
3266
3292
|
}
|
|
3267
3293
|
});
|
|
3268
3294
|
return data;
|
|
@@ -3286,11 +3312,11 @@ const PathConvert = {
|
|
|
3286
3312
|
|
|
3287
3313
|
const {current: current, pushData: pushData, copyData: copyData} = PathConvert;
|
|
3288
3314
|
|
|
3289
|
-
const {M: M$
|
|
3315
|
+
const {M: M$9, L: L$9, C: C$7, Q: Q$5, Z: Z$7, N: N$4, D: D$5, X: X$4, G: G$4, F: F$5, O: O$5, P: P$4, U: U$4} = PathCommandMap;
|
|
3290
3316
|
|
|
3291
3317
|
const {getMinDistanceFrom: getMinDistanceFrom, getRadianFrom: getRadianFrom} = PointHelper;
|
|
3292
3318
|
|
|
3293
|
-
const {tan: tan, min: min$2, abs: abs$
|
|
3319
|
+
const {tan: tan, min: min$2, abs: abs$9} = Math;
|
|
3294
3320
|
|
|
3295
3321
|
const startPoint = {};
|
|
3296
3322
|
|
|
@@ -3299,19 +3325,19 @@ const PathCommandDataHelper = {
|
|
|
3299
3325
|
data.length = 0;
|
|
3300
3326
|
},
|
|
3301
3327
|
moveTo(data, x, y) {
|
|
3302
|
-
data.push(M$
|
|
3328
|
+
data.push(M$9, x, y);
|
|
3303
3329
|
},
|
|
3304
3330
|
lineTo(data, x, y) {
|
|
3305
|
-
data.push(L$
|
|
3331
|
+
data.push(L$9, x, y);
|
|
3306
3332
|
},
|
|
3307
3333
|
bezierCurveTo(data, x1, y1, x2, y2, x, y) {
|
|
3308
|
-
data.push(C$
|
|
3334
|
+
data.push(C$7, x1, y1, x2, y2, x, y);
|
|
3309
3335
|
},
|
|
3310
3336
|
quadraticCurveTo(data, x1, y1, x, y) {
|
|
3311
3337
|
data.push(Q$5, x1, y1, x, y);
|
|
3312
3338
|
},
|
|
3313
3339
|
closePath(data) {
|
|
3314
|
-
data.push(Z$
|
|
3340
|
+
data.push(Z$7);
|
|
3315
3341
|
},
|
|
3316
3342
|
rect(data, x, y, width, height) {
|
|
3317
3343
|
data.push(N$4, x, y, width, height);
|
|
@@ -3350,18 +3376,18 @@ const PathCommandDataHelper = {
|
|
|
3350
3376
|
arcTo(data, x1, y1, x2, y2, radius, lastX, lastY, fullRadius) {
|
|
3351
3377
|
if (!isUndefined(lastX)) {
|
|
3352
3378
|
const r = getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2) / (fullRadius ? 1 : 2);
|
|
3353
|
-
radius = min$2(radius, min$2(r, r * abs$
|
|
3379
|
+
radius = min$2(radius, min$2(r, r * abs$9(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
|
|
3354
3380
|
}
|
|
3355
3381
|
data.push(U$4, x1, y1, x2, y2, radius);
|
|
3356
3382
|
},
|
|
3357
3383
|
drawEllipse(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
|
|
3358
3384
|
BezierHelper.ellipse(null, x, y, radiusX, radiusY, isNull(rotation) ? 0 : rotation, isNull(startAngle) ? 0 : startAngle, isNull(endAngle) ? 360 : endAngle, anticlockwise, null, null, startPoint);
|
|
3359
|
-
data.push(M$
|
|
3385
|
+
data.push(M$9, startPoint.x, startPoint.y);
|
|
3360
3386
|
ellipse$5(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
|
|
3361
3387
|
},
|
|
3362
3388
|
drawArc(data, x, y, radius, startAngle, endAngle, anticlockwise) {
|
|
3363
3389
|
BezierHelper.arc(null, x, y, radius, isNull(startAngle) ? 0 : startAngle, isNull(endAngle) ? 360 : endAngle, anticlockwise, null, null, startPoint);
|
|
3364
|
-
data.push(M$
|
|
3390
|
+
data.push(M$9, startPoint.x, startPoint.y);
|
|
3365
3391
|
arc$2(data, x, y, radius, startAngle, endAngle, anticlockwise);
|
|
3366
3392
|
},
|
|
3367
3393
|
drawPoints(data, points, curve, close) {
|
|
@@ -3371,7 +3397,7 @@ const PathCommandDataHelper = {
|
|
|
3371
3397
|
|
|
3372
3398
|
const {ellipse: ellipse$5, arc: arc$2} = PathCommandDataHelper;
|
|
3373
3399
|
|
|
3374
|
-
const {moveTo: moveTo$4, lineTo: lineTo$3, quadraticCurveTo: quadraticCurveTo, bezierCurveTo: bezierCurveTo, closePath: closePath$3, beginPath: beginPath, rect: rect$2, roundRect: roundRect$1, ellipse: ellipse$4, arc: arc$1, arcTo: arcTo$
|
|
3400
|
+
const {moveTo: moveTo$4, lineTo: lineTo$3, quadraticCurveTo: quadraticCurveTo, bezierCurveTo: bezierCurveTo, closePath: closePath$3, beginPath: beginPath, rect: rect$2, roundRect: roundRect$1, ellipse: ellipse$4, arc: arc$1, arcTo: arcTo$3, drawEllipse: drawEllipse, drawArc: drawArc, drawPoints: drawPoints$2} = PathCommandDataHelper;
|
|
3375
3401
|
|
|
3376
3402
|
class PathCreator {
|
|
3377
3403
|
set path(value) {
|
|
@@ -3438,7 +3464,7 @@ class PathCreator {
|
|
|
3438
3464
|
return this;
|
|
3439
3465
|
}
|
|
3440
3466
|
arcTo(x1, y1, x2, y2, radius) {
|
|
3441
|
-
arcTo$
|
|
3467
|
+
arcTo$3(this.__path, x1, y1, x2, y2, radius);
|
|
3442
3468
|
this.paint();
|
|
3443
3469
|
return this;
|
|
3444
3470
|
}
|
|
@@ -3463,7 +3489,7 @@ class PathCreator {
|
|
|
3463
3489
|
paint() {}
|
|
3464
3490
|
}
|
|
3465
3491
|
|
|
3466
|
-
const {M: M$
|
|
3492
|
+
const {M: M$8, L: L$8, C: C$6, Q: Q$4, Z: Z$6, N: N$3, D: D$4, X: X$3, G: G$3, F: F$4, O: O$4, P: P$3, U: U$3} = PathCommandMap;
|
|
3467
3493
|
|
|
3468
3494
|
const debug$e = Debug.get("PathDrawer");
|
|
3469
3495
|
|
|
@@ -3475,17 +3501,17 @@ const PathDrawer = {
|
|
|
3475
3501
|
while (i < len) {
|
|
3476
3502
|
command = data[i];
|
|
3477
3503
|
switch (command) {
|
|
3478
|
-
case M$
|
|
3504
|
+
case M$8:
|
|
3479
3505
|
drawer.moveTo(data[i + 1], data[i + 2]);
|
|
3480
3506
|
i += 3;
|
|
3481
3507
|
break;
|
|
3482
3508
|
|
|
3483
|
-
case L$
|
|
3509
|
+
case L$8:
|
|
3484
3510
|
drawer.lineTo(data[i + 1], data[i + 2]);
|
|
3485
3511
|
i += 3;
|
|
3486
3512
|
break;
|
|
3487
3513
|
|
|
3488
|
-
case C$
|
|
3514
|
+
case C$6:
|
|
3489
3515
|
drawer.bezierCurveTo(data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6]);
|
|
3490
3516
|
i += 7;
|
|
3491
3517
|
break;
|
|
@@ -3495,7 +3521,7 @@ const PathDrawer = {
|
|
|
3495
3521
|
i += 5;
|
|
3496
3522
|
break;
|
|
3497
3523
|
|
|
3498
|
-
case Z$
|
|
3524
|
+
case Z$6:
|
|
3499
3525
|
drawer.closePath();
|
|
3500
3526
|
i += 1;
|
|
3501
3527
|
break;
|
|
@@ -3548,9 +3574,9 @@ const PathDrawer = {
|
|
|
3548
3574
|
}
|
|
3549
3575
|
};
|
|
3550
3576
|
|
|
3551
|
-
const {M: M$
|
|
3577
|
+
const {M: M$7, L: L$7, C: C$5, Q: Q$3, Z: Z$5, N: N$2, D: D$3, X: X$2, G: G$2, F: F$3, O: O$3, P: P$2, U: U$2} = PathCommandMap;
|
|
3552
3578
|
|
|
3553
|
-
const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$
|
|
3579
|
+
const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$2, arc: arc, ellipse: ellipse$3} = BezierHelper;
|
|
3554
3580
|
|
|
3555
3581
|
const {addPointBounds: addPointBounds, copy: copy$9, addPoint: addPoint$1, setPoint: setPoint$3, addBounds: addBounds, toBounds: toBounds$2} = TwoPointBoundsHelper;
|
|
3556
3582
|
|
|
@@ -3576,22 +3602,22 @@ const PathBounds = {
|
|
|
3576
3602
|
while (i < len) {
|
|
3577
3603
|
command = data[i];
|
|
3578
3604
|
if (i === 0) {
|
|
3579
|
-
if (command === Z$
|
|
3605
|
+
if (command === Z$5 || command === C$5 || command === Q$3) {
|
|
3580
3606
|
setPoint$3(setPointBounds, x, y);
|
|
3581
3607
|
} else {
|
|
3582
3608
|
setPoint$3(setPointBounds, data[i + 1], data[i + 2]);
|
|
3583
3609
|
}
|
|
3584
3610
|
}
|
|
3585
3611
|
switch (command) {
|
|
3586
|
-
case M$
|
|
3587
|
-
case L$
|
|
3612
|
+
case M$7:
|
|
3613
|
+
case L$7:
|
|
3588
3614
|
x = data[i + 1];
|
|
3589
3615
|
y = data[i + 2];
|
|
3590
3616
|
addPoint$1(setPointBounds, x, y);
|
|
3591
3617
|
i += 3;
|
|
3592
3618
|
break;
|
|
3593
3619
|
|
|
3594
|
-
case C$
|
|
3620
|
+
case C$5:
|
|
3595
3621
|
toX = data[i + 5];
|
|
3596
3622
|
toY = data[i + 6];
|
|
3597
3623
|
toTwoPointBounds(x, y, data[i + 1], data[i + 2], data[i + 3], data[i + 4], toX, toY, tempPointBounds);
|
|
@@ -3613,7 +3639,7 @@ const PathBounds = {
|
|
|
3613
3639
|
i += 5;
|
|
3614
3640
|
break;
|
|
3615
3641
|
|
|
3616
|
-
case Z$
|
|
3642
|
+
case Z$5:
|
|
3617
3643
|
i += 1;
|
|
3618
3644
|
break;
|
|
3619
3645
|
|
|
@@ -3668,7 +3694,7 @@ const PathBounds = {
|
|
|
3668
3694
|
break;
|
|
3669
3695
|
|
|
3670
3696
|
case U$2:
|
|
3671
|
-
arcTo$
|
|
3697
|
+
arcTo$2(null, x, y, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], tempPointBounds, setEndPoint);
|
|
3672
3698
|
i === 0 ? copy$9(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
|
|
3673
3699
|
x = setEndPoint.x;
|
|
3674
3700
|
y = setEndPoint.y;
|
|
@@ -3683,11 +3709,11 @@ const PathBounds = {
|
|
|
3683
3709
|
}
|
|
3684
3710
|
};
|
|
3685
3711
|
|
|
3686
|
-
const {M: M$
|
|
3712
|
+
const {M: M$6, L: L$6, Z: Z$4} = PathCommandMap;
|
|
3687
3713
|
|
|
3688
|
-
const {getCenterX: getCenterX, getCenterY: getCenterY} = PointHelper;
|
|
3714
|
+
const {getCenterX: getCenterX$1, getCenterY: getCenterY$1} = PointHelper;
|
|
3689
3715
|
|
|
3690
|
-
const {arcTo: arcTo} = PathCommandDataHelper;
|
|
3716
|
+
const {arcTo: arcTo$1} = PathCommandDataHelper;
|
|
3691
3717
|
|
|
3692
3718
|
const PathCorner = {
|
|
3693
3719
|
smooth(data, cornerRadius, _cornerSmoothing) {
|
|
@@ -3699,43 +3725,43 @@ const PathCorner = {
|
|
|
3699
3725
|
while (i < len) {
|
|
3700
3726
|
command = data[i];
|
|
3701
3727
|
switch (command) {
|
|
3702
|
-
case M$
|
|
3728
|
+
case M$6:
|
|
3703
3729
|
startX = lastX = data[i + 1];
|
|
3704
3730
|
startY = lastY = data[i + 2];
|
|
3705
3731
|
i += 3;
|
|
3706
|
-
if (data[i] === L$
|
|
3732
|
+
if (data[i] === L$6) {
|
|
3707
3733
|
secondX = data[i + 1];
|
|
3708
3734
|
secondY = data[i + 2];
|
|
3709
|
-
three ? smooth.push(M$
|
|
3735
|
+
three ? smooth.push(M$6, startX, startY) : smooth.push(M$6, getCenterX$1(startX, secondX), getCenterY$1(startY, secondY));
|
|
3710
3736
|
} else {
|
|
3711
|
-
smooth.push(M$
|
|
3737
|
+
smooth.push(M$6, startX, startY);
|
|
3712
3738
|
}
|
|
3713
3739
|
break;
|
|
3714
3740
|
|
|
3715
|
-
case L$
|
|
3741
|
+
case L$6:
|
|
3716
3742
|
x = data[i + 1];
|
|
3717
3743
|
y = data[i + 2];
|
|
3718
3744
|
i += 3;
|
|
3719
3745
|
switch (data[i]) {
|
|
3720
|
-
case L$
|
|
3721
|
-
arcTo(smooth, x, y, data[i + 1], data[i + 2], cornerRadius, lastX, lastY, three);
|
|
3746
|
+
case L$6:
|
|
3747
|
+
arcTo$1(smooth, x, y, data[i + 1], data[i + 2], cornerRadius, lastX, lastY, three);
|
|
3722
3748
|
break;
|
|
3723
3749
|
|
|
3724
|
-
case Z$
|
|
3725
|
-
arcTo(smooth, x, y, startX, startY, cornerRadius, lastX, lastY, three);
|
|
3750
|
+
case Z$4:
|
|
3751
|
+
arcTo$1(smooth, x, y, startX, startY, cornerRadius, lastX, lastY, three);
|
|
3726
3752
|
break;
|
|
3727
3753
|
|
|
3728
3754
|
default:
|
|
3729
|
-
smooth.push(L$
|
|
3755
|
+
smooth.push(L$6, x, y);
|
|
3730
3756
|
}
|
|
3731
3757
|
lastX = x;
|
|
3732
3758
|
lastY = y;
|
|
3733
3759
|
break;
|
|
3734
3760
|
|
|
3735
|
-
case Z$
|
|
3736
|
-
if (lastCommand !== Z$
|
|
3737
|
-
arcTo(smooth, startX, startY, secondX, secondY, cornerRadius, lastX, lastY, three);
|
|
3738
|
-
smooth.push(Z$
|
|
3761
|
+
case Z$4:
|
|
3762
|
+
if (lastCommand !== Z$4) {
|
|
3763
|
+
arcTo$1(smooth, startX, startY, secondX, secondY, cornerRadius, lastX, lastY, three);
|
|
3764
|
+
smooth.push(Z$4);
|
|
3739
3765
|
}
|
|
3740
3766
|
i += 1;
|
|
3741
3767
|
break;
|
|
@@ -3747,7 +3773,7 @@ const PathCorner = {
|
|
|
3747
3773
|
}
|
|
3748
3774
|
lastCommand = command;
|
|
3749
3775
|
}
|
|
3750
|
-
if (command !== Z$
|
|
3776
|
+
if (command !== Z$4) {
|
|
3751
3777
|
smooth[1] = startX;
|
|
3752
3778
|
smooth[2] = startY;
|
|
3753
3779
|
}
|
|
@@ -4789,7 +4815,7 @@ const LeafHelper = {
|
|
|
4789
4815
|
if (layout.opacityChanged) updateAllWorldOpacity(leaf);
|
|
4790
4816
|
leaf.__updateChange();
|
|
4791
4817
|
if (layout.surfaceChanged) {
|
|
4792
|
-
if (leaf.__hasComplex) L$
|
|
4818
|
+
if (leaf.__hasComplex) L$5.updateComplex(leaf);
|
|
4793
4819
|
layout.surfaceChanged = false;
|
|
4794
4820
|
}
|
|
4795
4821
|
},
|
|
@@ -4825,7 +4851,7 @@ const LeafHelper = {
|
|
|
4825
4851
|
y: y
|
|
4826
4852
|
};
|
|
4827
4853
|
isInnerPoint ? toOuterPoint$1(t.localTransform, local, local, true) : t.parent && toInnerPoint$1(t.parent.scrollWorldTransform, local, local, true);
|
|
4828
|
-
L$
|
|
4854
|
+
L$5.moveLocal(t, local.x, local.y, transition);
|
|
4829
4855
|
},
|
|
4830
4856
|
moveLocal(t, x, y = 0, transition) {
|
|
4831
4857
|
if (isObject(x)) y = x.y, x = x.x;
|
|
@@ -4838,7 +4864,7 @@ const LeafHelper = {
|
|
|
4838
4864
|
}, transition) : (t.x = x, t.y = y);
|
|
4839
4865
|
},
|
|
4840
4866
|
zoomOfWorld(t, origin, scaleX, scaleY, resize, transition) {
|
|
4841
|
-
L$
|
|
4867
|
+
L$5.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize, transition);
|
|
4842
4868
|
},
|
|
4843
4869
|
zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize, transition) {
|
|
4844
4870
|
const o = t.__localMatrix;
|
|
@@ -4848,8 +4874,8 @@ const LeafHelper = {
|
|
|
4848
4874
|
}
|
|
4849
4875
|
copy$8(matrix$3, o);
|
|
4850
4876
|
scaleOfOuter$2(matrix$3, origin, scaleX, scaleY);
|
|
4851
|
-
if (L$
|
|
4852
|
-
L$
|
|
4877
|
+
if (L$5.hasHighPosition(t)) {
|
|
4878
|
+
L$5.setTransform(t, matrix$3, resize, transition);
|
|
4853
4879
|
} else {
|
|
4854
4880
|
const x = t.x + matrix$3.e - o.e, y = t.y + matrix$3.f - o.f;
|
|
4855
4881
|
if (transition && !resize) t.animate({
|
|
@@ -4861,41 +4887,41 @@ const LeafHelper = {
|
|
|
4861
4887
|
}
|
|
4862
4888
|
},
|
|
4863
4889
|
rotateOfWorld(t, origin, angle, transition) {
|
|
4864
|
-
L$
|
|
4890
|
+
L$5.rotateOfLocal(t, getTempLocal(t, origin), angle, transition);
|
|
4865
4891
|
},
|
|
4866
4892
|
rotateOfLocal(t, origin, angle, transition) {
|
|
4867
4893
|
const o = t.__localMatrix;
|
|
4868
4894
|
copy$8(matrix$3, o);
|
|
4869
4895
|
rotateOfOuter$2(matrix$3, origin, angle);
|
|
4870
|
-
if (L$
|
|
4896
|
+
if (L$5.hasHighPosition(t)) L$5.setTransform(t, matrix$3, false, transition); else t.set({
|
|
4871
4897
|
x: t.x + matrix$3.e - o.e,
|
|
4872
4898
|
y: t.y + matrix$3.f - o.f,
|
|
4873
4899
|
rotation: MathHelper.formatRotation(t.rotation + angle)
|
|
4874
4900
|
}, transition);
|
|
4875
4901
|
},
|
|
4876
4902
|
skewOfWorld(t, origin, skewX, skewY, resize, transition) {
|
|
4877
|
-
L$
|
|
4903
|
+
L$5.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize, transition);
|
|
4878
4904
|
},
|
|
4879
4905
|
skewOfLocal(t, origin, skewX, skewY = 0, resize, transition) {
|
|
4880
4906
|
copy$8(matrix$3, t.__localMatrix);
|
|
4881
4907
|
skewOfOuter(matrix$3, origin, skewX, skewY);
|
|
4882
|
-
L$
|
|
4908
|
+
L$5.setTransform(t, matrix$3, resize, transition);
|
|
4883
4909
|
},
|
|
4884
4910
|
transformWorld(t, transform, resize, transition) {
|
|
4885
4911
|
copy$8(matrix$3, t.worldTransform);
|
|
4886
4912
|
multiplyParent$3(matrix$3, transform);
|
|
4887
4913
|
if (t.parent) divideParent(matrix$3, t.parent.scrollWorldTransform);
|
|
4888
|
-
L$
|
|
4914
|
+
L$5.setTransform(t, matrix$3, resize, transition);
|
|
4889
4915
|
},
|
|
4890
4916
|
transform(t, transform, resize, transition) {
|
|
4891
4917
|
copy$8(matrix$3, t.localTransform);
|
|
4892
4918
|
multiplyParent$3(matrix$3, transform);
|
|
4893
|
-
L$
|
|
4919
|
+
L$5.setTransform(t, matrix$3, resize, transition);
|
|
4894
4920
|
},
|
|
4895
4921
|
setTransform(t, transform, resize, transition) {
|
|
4896
|
-
const data = t.__, originPoint = data.origin && L$
|
|
4897
|
-
const layout = getLayout(transform, originPoint, data.around && L$
|
|
4898
|
-
if (L$
|
|
4922
|
+
const data = t.__, originPoint = data.origin && L$5.getInnerOrigin(t, data.origin);
|
|
4923
|
+
const layout = getLayout(transform, originPoint, data.around && L$5.getInnerOrigin(t, data.around));
|
|
4924
|
+
if (L$5.hasOffset(t)) {
|
|
4899
4925
|
layout.x -= data.offsetX;
|
|
4900
4926
|
layout.y -= data.offsetY;
|
|
4901
4927
|
}
|
|
@@ -4904,7 +4930,7 @@ const LeafHelper = {
|
|
|
4904
4930
|
delete layout.scaleX, delete layout.scaleY;
|
|
4905
4931
|
if (originPoint) {
|
|
4906
4932
|
BoundsHelper.scale(t.boxBounds, Math.abs(scaleX), Math.abs(scaleY));
|
|
4907
|
-
const changedPoint = L$
|
|
4933
|
+
const changedPoint = L$5.getInnerOrigin(t, data.origin);
|
|
4908
4934
|
PointHelper.move(layout, originPoint.x - changedPoint.x, originPoint.y - changedPoint.y);
|
|
4909
4935
|
}
|
|
4910
4936
|
t.set(layout);
|
|
@@ -4914,11 +4940,11 @@ const LeafHelper = {
|
|
|
4914
4940
|
getFlipTransform(t, axis) {
|
|
4915
4941
|
const m = getMatrixData();
|
|
4916
4942
|
const sign = axis === "x" ? 1 : -1;
|
|
4917
|
-
scaleOfOuter$2(m, L$
|
|
4943
|
+
scaleOfOuter$2(m, L$5.getLocalOrigin(t, "center"), -1 * sign, 1 * sign);
|
|
4918
4944
|
return m;
|
|
4919
4945
|
},
|
|
4920
4946
|
getLocalOrigin(t, origin) {
|
|
4921
|
-
return PointHelper.tempToOuterOf(L$
|
|
4947
|
+
return PointHelper.tempToOuterOf(L$5.getInnerOrigin(t, origin), t.localTransform);
|
|
4922
4948
|
},
|
|
4923
4949
|
getInnerOrigin(t, origin) {
|
|
4924
4950
|
const innerOrigin = {};
|
|
@@ -4934,11 +4960,11 @@ const LeafHelper = {
|
|
|
4934
4960
|
updateOuterBounds(_t) {},
|
|
4935
4961
|
cacheId(_t) {},
|
|
4936
4962
|
drop(t, parent, index, resize) {
|
|
4937
|
-
t.setTransform(L$
|
|
4963
|
+
t.setTransform(L$5.getRelativeWorld(t, parent, true), resize);
|
|
4938
4964
|
parent.add(t, index);
|
|
4939
4965
|
},
|
|
4940
4966
|
hasHighPosition(t) {
|
|
4941
|
-
return t.origin || t.around || L$
|
|
4967
|
+
return t.origin || t.around || L$5.hasOffset(t);
|
|
4942
4968
|
},
|
|
4943
4969
|
hasOffset(t) {
|
|
4944
4970
|
return t.offsetX || t.offsetY;
|
|
@@ -4958,14 +4984,14 @@ const LeafHelper = {
|
|
|
4958
4984
|
const x = move.x * speed, y = move.y * speed;
|
|
4959
4985
|
move.x -= x, move.y -= y;
|
|
4960
4986
|
t.move(x, y);
|
|
4961
|
-
Platform.requestRender(() => L$
|
|
4987
|
+
Platform.requestRender(() => L$5.animateMove(t, move, speed));
|
|
4962
4988
|
}
|
|
4963
4989
|
}
|
|
4964
4990
|
};
|
|
4965
4991
|
|
|
4966
|
-
const L$
|
|
4992
|
+
const L$5 = LeafHelper;
|
|
4967
4993
|
|
|
4968
|
-
const {updateAllMatrix: updateAllMatrix$4, updateMatrix: updateMatrix$4, updateAllWorldOpacity: updateAllWorldOpacity, updateAllChange: updateAllChange$1, updateChange: updateChange$1} = L$
|
|
4994
|
+
const {updateAllMatrix: updateAllMatrix$4, updateMatrix: updateMatrix$4, updateAllWorldOpacity: updateAllWorldOpacity, updateAllChange: updateAllChange$1, updateChange: updateChange$1} = L$5;
|
|
4969
4995
|
|
|
4970
4996
|
function getTempLocal(t, worldPoint) {
|
|
4971
4997
|
t.updateLayout();
|
|
@@ -7053,7 +7079,7 @@ class LeafLevelList {
|
|
|
7053
7079
|
}
|
|
7054
7080
|
}
|
|
7055
7081
|
|
|
7056
|
-
const version = "2.0.
|
|
7082
|
+
const version = "2.0.8";
|
|
7057
7083
|
|
|
7058
7084
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
7059
7085
|
get allowBackgroundColor() {
|
|
@@ -8737,7 +8763,7 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8737
8763
|
__updateRenderPath(updateCache) {
|
|
8738
8764
|
const data = this.__;
|
|
8739
8765
|
if (data.path) {
|
|
8740
|
-
data.__pathForRender = data.cornerRadius ? PathCorner.smooth(data.path, data.cornerRadius, data.cornerSmoothing) : data.path;
|
|
8766
|
+
data.__pathForRender = data.cornerRadius || data.path.radius ? PathCorner.smooth(data.path, data.cornerRadius, data.cornerSmoothing) : data.path;
|
|
8741
8767
|
if (data.__useArrow) PathArrow.addArrows(this, updateCache);
|
|
8742
8768
|
} else data.__pathForRender && (data.__pathForRender = undefined);
|
|
8743
8769
|
}
|
|
@@ -9570,7 +9596,7 @@ let Ellipse = class Ellipse extends UI {
|
|
|
9570
9596
|
}
|
|
9571
9597
|
}
|
|
9572
9598
|
if (!open) closePath$2(path);
|
|
9573
|
-
if (Platform.ellipseToCurve || data.__useArrow) data.path = this.getPath(true);
|
|
9599
|
+
if (Platform.ellipseToCurve || data.__useArrow || data.cornerRadius) data.path = this.getPath(true);
|
|
9574
9600
|
}
|
|
9575
9601
|
};
|
|
9576
9602
|
|
|
@@ -9596,7 +9622,7 @@ let Polygon = class Polygon extends UI {
|
|
|
9596
9622
|
const data = this.__;
|
|
9597
9623
|
const path = data.path = [];
|
|
9598
9624
|
if (data.points) {
|
|
9599
|
-
drawPoints$1(path, data.points, data.curve,
|
|
9625
|
+
drawPoints$1(path, data.points, data.curve, data.closed);
|
|
9600
9626
|
} else {
|
|
9601
9627
|
const {width: width, height: height, sides: sides} = data;
|
|
9602
9628
|
const rx = width / 2, ry = height / 2;
|
|
@@ -10221,7 +10247,7 @@ class UIEvent extends Event {
|
|
|
10221
10247
|
}
|
|
10222
10248
|
}
|
|
10223
10249
|
|
|
10224
|
-
const {min: min$1, max: max$3, abs: abs$
|
|
10250
|
+
const {min: min$1, max: max$3, abs: abs$8} = Math, {float: float$3, sign: sign$2} = MathHelper, {minX: minX, maxX: maxX, minY: minY, maxY: maxY} = BoundsHelper;
|
|
10225
10251
|
|
|
10226
10252
|
const tempContent = new Bounds, tempDragBounds = new Bounds;
|
|
10227
10253
|
|
|
@@ -10298,7 +10324,7 @@ const DragBoundsHelper = {
|
|
|
10298
10324
|
bScale = originBottomScale && bSize > 0 ? 1 + bSize / (originBottomScale * tempContent.height) : 1;
|
|
10299
10325
|
correctScaleY *= max$3(aScale, bScale);
|
|
10300
10326
|
if (lockRatio) {
|
|
10301
|
-
aScale = max$3(abs$
|
|
10327
|
+
aScale = max$3(abs$8(correctScaleX), abs$8(correctScaleY));
|
|
10302
10328
|
correctScaleX = sign$2(correctScaleX) * aScale;
|
|
10303
10329
|
correctScaleY = sign$2(correctScaleY) * aScale;
|
|
10304
10330
|
}
|
|
@@ -12011,12 +12037,12 @@ const PaintModule = {
|
|
|
12011
12037
|
|
|
12012
12038
|
let cache$1, box$2 = new Bounds;
|
|
12013
12039
|
|
|
12014
|
-
const {isSame: isSame$
|
|
12040
|
+
const {isSame: isSame$2} = BoundsHelper;
|
|
12015
12041
|
|
|
12016
12042
|
function image(ui, attrName, paint, boxBounds, firstUse) {
|
|
12017
12043
|
let leafPaint, event;
|
|
12018
12044
|
const image = ImageManager.get(paint, paint.type);
|
|
12019
|
-
if (cache$1 && paint === cache$1.paint && isSame$
|
|
12045
|
+
if (cache$1 && paint === cache$1.paint && isSame$2(boxBounds, cache$1.boxBounds)) {
|
|
12020
12046
|
leafPaint = cache$1.leafPaint;
|
|
12021
12047
|
} else {
|
|
12022
12048
|
leafPaint = {
|
|
@@ -12307,7 +12333,7 @@ function layout$3(transform, box, x, y, scaleX, scaleY, rotation, skew) {
|
|
|
12307
12333
|
|
|
12308
12334
|
const {get: get$1, scale: scale$2, copy: copy$4} = MatrixHelper;
|
|
12309
12335
|
|
|
12310
|
-
const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$
|
|
12336
|
+
const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$7} = Math;
|
|
12311
12337
|
|
|
12312
12338
|
function createPatternTask(paint, ui, canvas, renderOptions) {
|
|
12313
12339
|
if (!paint.patternTask) {
|
|
@@ -12331,8 +12357,8 @@ function createPattern(paint, ui, canvas, renderOptions) {
|
|
|
12331
12357
|
width *= scaleX;
|
|
12332
12358
|
height *= scaleY;
|
|
12333
12359
|
if (gap) {
|
|
12334
|
-
xGap = gap.x * scaleX / abs$
|
|
12335
|
-
yGap = gap.y * scaleY / abs$
|
|
12360
|
+
xGap = gap.x * scaleX / abs$7(data.scaleX || 1);
|
|
12361
|
+
yGap = gap.y * scaleY / abs$7(data.scaleY || 1);
|
|
12336
12362
|
}
|
|
12337
12363
|
if (transform || scaleX !== 1 || scaleY !== 1) {
|
|
12338
12364
|
scaleX *= getFloorScale(width + (xGap || 0));
|
|
@@ -12569,7 +12595,7 @@ const PaintGradientModule = {
|
|
|
12569
12595
|
getTransform: getTransform
|
|
12570
12596
|
};
|
|
12571
12597
|
|
|
12572
|
-
const {copy: copy$3, move: move$6, toOffsetOutBounds: toOffsetOutBounds$1} = BoundsHelper, {max: max$2, abs: abs$
|
|
12598
|
+
const {copy: copy$3, move: move$6, toOffsetOutBounds: toOffsetOutBounds$1} = BoundsHelper, {max: max$2, abs: abs$6} = Math;
|
|
12573
12599
|
|
|
12574
12600
|
const tempBounds$1 = {}, tempMatrix = new Matrix;
|
|
12575
12601
|
|
|
@@ -12613,7 +12639,7 @@ function shadow$1(ui, current, shape) {
|
|
|
12613
12639
|
function getShadowRenderSpread(_ui, shadow) {
|
|
12614
12640
|
let top = 0, right = 0, bottom = 0, left = 0, x, y, spread, blur;
|
|
12615
12641
|
shadow.forEach(item => {
|
|
12616
|
-
x = item.x || 0, y = item.y || 0, blur = (item.blur || 0) * 1.5, spread = abs$
|
|
12642
|
+
x = item.x || 0, y = item.y || 0, blur = (item.blur || 0) * 1.5, spread = abs$6(item.spread || 0);
|
|
12617
12643
|
top = max$2(top, spread + blur - y);
|
|
12618
12644
|
right = max$2(right, spread + blur + x);
|
|
12619
12645
|
bottom = max$2(bottom, spread + blur + y);
|
|
@@ -13454,7 +13480,7 @@ function mergeConfigAttr() {
|
|
|
13454
13480
|
};
|
|
13455
13481
|
}
|
|
13456
13482
|
|
|
13457
|
-
const {abs: abs$
|
|
13483
|
+
const {abs: abs$5} = Math;
|
|
13458
13484
|
|
|
13459
13485
|
const {copy: copy$2} = MatrixHelper;
|
|
13460
13486
|
|
|
@@ -13497,7 +13523,7 @@ class Stroker extends UI {
|
|
|
13497
13523
|
leaf = list[i];
|
|
13498
13524
|
const {worldTransform: worldTransform, worldRenderBounds: worldRenderBounds} = leaf;
|
|
13499
13525
|
if (worldRenderBounds.width && worldRenderBounds.height && (!bounds || bounds.hit(worldRenderBounds, options.matrix))) {
|
|
13500
|
-
const aScaleX = abs$
|
|
13526
|
+
const aScaleX = abs$5(worldTransform.scaleX), aScaleY = abs$5(worldTransform.scaleY);
|
|
13501
13527
|
copy$2(matrix$1, worldTransform);
|
|
13502
13528
|
matrix$1.half = strokeWidth % 2;
|
|
13503
13529
|
canvas.setWorld(matrix$1, options.matrix);
|
|
@@ -13810,7 +13836,7 @@ class EditSelect extends Group {
|
|
|
13810
13836
|
|
|
13811
13837
|
const {topLeft: topLeft$1, top: top$1, topRight: topRight$1, right: right$2, bottomRight: bottomRight, bottom: bottom$1, bottomLeft: bottomLeft, left: left$2} = Direction9;
|
|
13812
13838
|
|
|
13813
|
-
const {toPoint: toPoint} = AroundHelper, {within: within$3, sign: sign$1} = MathHelper, {abs: abs$
|
|
13839
|
+
const {toPoint: toPoint} = AroundHelper, {within: within$3, sign: sign$1} = MathHelper, {abs: abs$4} = Math;
|
|
13814
13840
|
|
|
13815
13841
|
const EditDataHelper = {
|
|
13816
13842
|
getScaleData(target, startBounds, direction, totalMoveOrScale, lockRatio, around, flipable, scaleMode) {
|
|
@@ -13896,7 +13922,7 @@ const EditDataHelper = {
|
|
|
13896
13922
|
break;
|
|
13897
13923
|
|
|
13898
13924
|
default:
|
|
13899
|
-
lockScale = Math.sqrt(abs$
|
|
13925
|
+
lockScale = Math.sqrt(abs$4(scaleX * scaleY));
|
|
13900
13926
|
scaleX = sign$1(scaleX) * lockScale;
|
|
13901
13927
|
scaleY = sign$1(scaleY) * lockScale;
|
|
13902
13928
|
}
|
|
@@ -13929,10 +13955,10 @@ const EditDataHelper = {
|
|
|
13929
13955
|
const nowHeight = boxBounds.height * target.scaleY;
|
|
13930
13956
|
scaleY = within$3(nowHeight * scaleY, heightRange) / nowHeight;
|
|
13931
13957
|
}
|
|
13932
|
-
if (useScaleX && abs$
|
|
13933
|
-
if (useScaleY && abs$
|
|
13958
|
+
if (useScaleX && abs$4(scaleX * worldBoxBounds.width) < 1) scaleX = sign$1(scaleX) / worldBoxBounds.width;
|
|
13959
|
+
if (useScaleY && abs$4(scaleY * worldBoxBounds.height) < 1) scaleY = sign$1(scaleY) / worldBoxBounds.height;
|
|
13934
13960
|
if (lockRatio && scaleX !== scaleY) {
|
|
13935
|
-
lockScale = Math.min(abs$
|
|
13961
|
+
lockScale = Math.min(abs$4(scaleX), abs$4(scaleY));
|
|
13936
13962
|
scaleX = sign$1(scaleX) * lockScale;
|
|
13937
13963
|
scaleY = sign$1(scaleY) * lockScale;
|
|
13938
13964
|
}
|
|
@@ -15844,7 +15870,7 @@ let LineEditTool = class LineEditTool extends EditTool {
|
|
|
15844
15870
|
|
|
15845
15871
|
LineEditTool = __decorate([ registerEditTool() ], LineEditTool);
|
|
15846
15872
|
|
|
15847
|
-
const {M: M$
|
|
15873
|
+
const {M: M$5, L: L$4, C: C$4, Q: Q$2, Z: Z$3, N: N$1, D: D$1, X: X$1, G: G$1, F: F$1, O: O$2, P: P$1, U: U$1} = PathCommandMap;
|
|
15848
15874
|
|
|
15849
15875
|
const PathScaler = {
|
|
15850
15876
|
scale(data, scaleX, scaleY) {
|
|
@@ -15854,13 +15880,13 @@ const PathScaler = {
|
|
|
15854
15880
|
while (i < len) {
|
|
15855
15881
|
command = data[i];
|
|
15856
15882
|
switch (command) {
|
|
15857
|
-
case M$
|
|
15858
|
-
case L$
|
|
15883
|
+
case M$5:
|
|
15884
|
+
case L$4:
|
|
15859
15885
|
scalePoints(data, scaleX, scaleY, i, 1);
|
|
15860
15886
|
i += 3;
|
|
15861
15887
|
break;
|
|
15862
15888
|
|
|
15863
|
-
case C$
|
|
15889
|
+
case C$4:
|
|
15864
15890
|
scalePoints(data, scaleX, scaleY, i, 3);
|
|
15865
15891
|
i += 7;
|
|
15866
15892
|
break;
|
|
@@ -15870,7 +15896,7 @@ const PathScaler = {
|
|
|
15870
15896
|
i += 5;
|
|
15871
15897
|
break;
|
|
15872
15898
|
|
|
15873
|
-
case Z$
|
|
15899
|
+
case Z$3:
|
|
15874
15900
|
i += 1;
|
|
15875
15901
|
break;
|
|
15876
15902
|
|
|
@@ -16251,13 +16277,13 @@ const MultiTouchHelper = {
|
|
|
16251
16277
|
return "rotate";
|
|
16252
16278
|
},
|
|
16253
16279
|
detect(data, config) {
|
|
16254
|
-
const {state: state} = M$
|
|
16255
|
-
const type = M$
|
|
16280
|
+
const {state: state} = M$4;
|
|
16281
|
+
const type = M$4.getType(data, config);
|
|
16256
16282
|
if (!state.totalData) {
|
|
16257
16283
|
state.startTime = Date.now();
|
|
16258
16284
|
state.center = data.center;
|
|
16259
16285
|
}
|
|
16260
|
-
M$
|
|
16286
|
+
M$4.add(data, state.totalData);
|
|
16261
16287
|
state.totalData = data;
|
|
16262
16288
|
if (type === state.type) {
|
|
16263
16289
|
state.typeCount++;
|
|
@@ -16266,7 +16292,7 @@ const MultiTouchHelper = {
|
|
|
16266
16292
|
state.type = type;
|
|
16267
16293
|
state.typeCount = 1;
|
|
16268
16294
|
}
|
|
16269
|
-
if (Date.now() - state.startTime >= (config.time || 160)) return M$
|
|
16295
|
+
if (Date.now() - state.startTime >= (config.time || 160)) return M$4.getType(state.totalData, config);
|
|
16270
16296
|
return "none";
|
|
16271
16297
|
},
|
|
16272
16298
|
add(data, add) {
|
|
@@ -16277,7 +16303,7 @@ const MultiTouchHelper = {
|
|
|
16277
16303
|
data.center = add.center;
|
|
16278
16304
|
},
|
|
16279
16305
|
reset() {
|
|
16280
|
-
const {state: state} = M$
|
|
16306
|
+
const {state: state} = M$4;
|
|
16281
16307
|
state.type = "none";
|
|
16282
16308
|
state.typeCount = 0;
|
|
16283
16309
|
state.startTime = 0;
|
|
@@ -16285,9 +16311,9 @@ const MultiTouchHelper = {
|
|
|
16285
16311
|
}
|
|
16286
16312
|
};
|
|
16287
16313
|
|
|
16288
|
-
const M$
|
|
16314
|
+
const M$4 = MultiTouchHelper;
|
|
16289
16315
|
|
|
16290
|
-
const {abs: abs$
|
|
16316
|
+
const {abs: abs$3, max: max$1} = Math, {sign: sign, within: within$2} = MathHelper;
|
|
16291
16317
|
|
|
16292
16318
|
const WheelEventHelper = {
|
|
16293
16319
|
getMove(event, config) {
|
|
@@ -16297,7 +16323,7 @@ const WheelEventHelper = {
|
|
|
16297
16323
|
deltaX = deltaY;
|
|
16298
16324
|
deltaY = 0;
|
|
16299
16325
|
}
|
|
16300
|
-
const absX = abs$
|
|
16326
|
+
const absX = abs$3(deltaX), absY = abs$3(deltaY);
|
|
16301
16327
|
if (absX > 50) deltaX = max$1(50, absX / 3) * sign(deltaX);
|
|
16302
16328
|
if (absY > 50) deltaY = max$1(50, absY / 3) * sign(deltaY);
|
|
16303
16329
|
return {
|
|
@@ -16319,7 +16345,7 @@ const WheelEventHelper = {
|
|
|
16319
16345
|
if (zoom) {
|
|
16320
16346
|
zoomSpeed = within$2(zoomSpeed, 0, 1);
|
|
16321
16347
|
const min = event.deltaY ? config.delta.y : config.delta.x;
|
|
16322
|
-
const absScale = within$2(1 - abs$
|
|
16348
|
+
const absScale = within$2(1 - abs$3(delta) / (min * 4) * zoomSpeed, .5, 2);
|
|
16323
16349
|
scale = delta > 0 ? absScale : 1 / absScale;
|
|
16324
16350
|
}
|
|
16325
16351
|
return scale;
|
|
@@ -16558,7 +16584,7 @@ interaction.multiTouch = function(data, list) {
|
|
|
16558
16584
|
|
|
16559
16585
|
const dragger = Dragger.prototype;
|
|
16560
16586
|
|
|
16561
|
-
const {abs: abs$
|
|
16587
|
+
const {abs: abs$2, min: min, max: max, hypot: hypot} = Math;
|
|
16562
16588
|
|
|
16563
16589
|
dragger.checkDragEndAnimate = function(data) {
|
|
16564
16590
|
const {interaction: interaction} = this;
|
|
@@ -16587,7 +16613,7 @@ dragger.checkDragEndAnimate = function(data) {
|
|
|
16587
16613
|
moveX *= boost;
|
|
16588
16614
|
moveY *= boost;
|
|
16589
16615
|
}
|
|
16590
|
-
const maxAbs = max(abs$
|
|
16616
|
+
const maxAbs = max(abs$2(moveX), abs$2(moveY));
|
|
16591
16617
|
if (maxAbs > maxMove) {
|
|
16592
16618
|
s = maxMove / maxAbs;
|
|
16593
16619
|
moveX *= s;
|
|
@@ -16597,7 +16623,7 @@ dragger.checkDragEndAnimate = function(data) {
|
|
|
16597
16623
|
moveX *= inertia;
|
|
16598
16624
|
moveY *= inertia;
|
|
16599
16625
|
data = Object.assign({}, data);
|
|
16600
|
-
if (abs$
|
|
16626
|
+
if (abs$2(moveX) < stopMove && abs$2(moveY) < stopMove) return this.dragEndReal(data);
|
|
16601
16627
|
PointHelper.move(data, moveX, moveY);
|
|
16602
16628
|
this.drag(data);
|
|
16603
16629
|
this.animate(step);
|
|
@@ -16927,7 +16953,7 @@ __decorate([ arrowType("angle") ], Arrow.prototype, "endArrow", void 0);
|
|
|
16927
16953
|
|
|
16928
16954
|
Arrow = __decorate([ registerUI() ], Arrow);
|
|
16929
16955
|
|
|
16930
|
-
const {M: M$
|
|
16956
|
+
const {M: M$3, L: L$3, C: C$3, Q: Q$1, O: O$1} = PathCommandMap;
|
|
16931
16957
|
|
|
16932
16958
|
const {rotate: rotate$1, copyFrom: copyFrom$1, scale: scale$1} = PointHelper;
|
|
16933
16959
|
|
|
@@ -16939,13 +16965,13 @@ const PathMatrixHelper = {
|
|
|
16939
16965
|
while (i < len) {
|
|
16940
16966
|
command = data[i];
|
|
16941
16967
|
switch (command) {
|
|
16942
|
-
case M$
|
|
16943
|
-
case L$
|
|
16968
|
+
case M$3:
|
|
16969
|
+
case L$3:
|
|
16944
16970
|
setPoint$2(data, i + 1, x, y, scaleX, scaleY, rotation, origin);
|
|
16945
16971
|
i += 3;
|
|
16946
16972
|
break;
|
|
16947
16973
|
|
|
16948
|
-
case C$
|
|
16974
|
+
case C$3:
|
|
16949
16975
|
for (j = 1; j < 6; j += 2) setPoint$2(data, i + j, x, y, scaleX, scaleY, rotation, origin);
|
|
16950
16976
|
i += 7;
|
|
16951
16977
|
break;
|
|
@@ -17185,9 +17211,9 @@ function getArrowPath(ui, arrow, from, to, size, connectOffset, hasDashPattern)
|
|
|
17185
17211
|
return arrowData;
|
|
17186
17212
|
}
|
|
17187
17213
|
|
|
17188
|
-
const {M: M$
|
|
17214
|
+
const {M: M$2, L: L$2, C: C$2, Q: Q, Z: Z$2, N: N, D: D, X: X, G: G, F: F, O: O, P: P, U: U} = PathCommandMap;
|
|
17189
17215
|
|
|
17190
|
-
const {copy: copy, copyFrom: copyFrom, getDistancePoint: getDistancePoint, isSame: isSame} = PointHelper;
|
|
17216
|
+
const {copy: copy, copyFrom: copyFrom, getDistancePoint: getDistancePoint, isSame: isSame$1} = PointHelper;
|
|
17191
17217
|
|
|
17192
17218
|
const {stintSet: stintSet$1} = DataHelper;
|
|
17193
17219
|
|
|
@@ -17210,8 +17236,8 @@ const PathArrowModule = {
|
|
|
17210
17236
|
while (i < len) {
|
|
17211
17237
|
command = data[i];
|
|
17212
17238
|
switch (command) {
|
|
17213
|
-
case M$
|
|
17214
|
-
case L$
|
|
17239
|
+
case M$2:
|
|
17240
|
+
case L$2:
|
|
17215
17241
|
if (count < 2 || i + 6 >= len) {
|
|
17216
17242
|
copy(old, now);
|
|
17217
17243
|
copyFrom(now, data[i + 1], data[i + 2]);
|
|
@@ -17220,7 +17246,7 @@ const PathArrowModule = {
|
|
|
17220
17246
|
i += 3;
|
|
17221
17247
|
break;
|
|
17222
17248
|
|
|
17223
|
-
case C$
|
|
17249
|
+
case C$2:
|
|
17224
17250
|
if (count === 1 || i + 7 >= len - 3) {
|
|
17225
17251
|
copyPoints(data, last, now, i + 3);
|
|
17226
17252
|
old.x = data[i + 1], old.y = data[i + 2];
|
|
@@ -17236,7 +17262,7 @@ const PathArrowModule = {
|
|
|
17236
17262
|
i += 5;
|
|
17237
17263
|
break;
|
|
17238
17264
|
|
|
17239
|
-
case Z$
|
|
17265
|
+
case Z$2:
|
|
17240
17266
|
return;
|
|
17241
17267
|
|
|
17242
17268
|
case N:
|
|
@@ -17280,8 +17306,8 @@ const PathArrowModule = {
|
|
|
17280
17306
|
break;
|
|
17281
17307
|
}
|
|
17282
17308
|
count++;
|
|
17283
|
-
if (count === 1 && command !== M$
|
|
17284
|
-
if (count === 2 && useStartArrow) copy(second, command === L$
|
|
17309
|
+
if (count === 1 && command !== M$2) return;
|
|
17310
|
+
if (count === 2 && useStartArrow) copy(second, command === L$2 ? now : isSame$1(old, first) ? last : old);
|
|
17285
17311
|
if (i === len) {
|
|
17286
17312
|
const path = uData.__pathForRender = clonePathForArrow ? [ ...data ] : data;
|
|
17287
17313
|
if (useStartArrow) {
|
|
@@ -17295,7 +17321,7 @@ const PathArrowModule = {
|
|
|
17295
17321
|
}
|
|
17296
17322
|
}
|
|
17297
17323
|
if (endArrow && endArrow !== "none") {
|
|
17298
|
-
if (isSame(last, now)) copy(last, old);
|
|
17324
|
+
if (isSame$1(last, now)) copy(last, old);
|
|
17299
17325
|
endArrowPath = getArrowPath(ui, endArrow, last, now, strokeWidth, connectPoint, !!dashPattern);
|
|
17300
17326
|
singleEndArrow = endArrowPath.fill || dashPattern;
|
|
17301
17327
|
if (!singleEndArrow) path.push(...endArrowPath.data);
|
|
@@ -17303,11 +17329,11 @@ const PathArrowModule = {
|
|
|
17303
17329
|
getDistancePoint(now, last, -connectPoint.x, true);
|
|
17304
17330
|
let index;
|
|
17305
17331
|
switch (command) {
|
|
17306
|
-
case L$
|
|
17332
|
+
case L$2:
|
|
17307
17333
|
index = i - 3 + 1;
|
|
17308
17334
|
break;
|
|
17309
17335
|
|
|
17310
|
-
case C$
|
|
17336
|
+
case C$2:
|
|
17311
17337
|
index = i - 7 + 5;
|
|
17312
17338
|
break;
|
|
17313
17339
|
|
|
@@ -17911,7 +17937,7 @@ box$1.__updateBoxBounds = function(secondLayout) {
|
|
|
17911
17937
|
}
|
|
17912
17938
|
};
|
|
17913
17939
|
|
|
17914
|
-
const {cos: cos, sin: sin, pow: pow, sqrt: sqrt$1, abs: abs, ceil: ceil, floor: floor, round: round$2, PI: PI} = Math;
|
|
17940
|
+
const {cos: cos, sin: sin, pow: pow, sqrt: sqrt$1, abs: abs$1, ceil: ceil, floor: floor, round: round$2, PI: PI} = Math;
|
|
17915
17941
|
|
|
17916
17942
|
const PIx5 = PI * 5;
|
|
17917
17943
|
|
|
@@ -17949,7 +17975,7 @@ function cubicBezier(x1, y1, x2, y2) {
|
|
|
17949
17975
|
o = 1 - v;
|
|
17950
17976
|
x = bezier(v, x1, x2) - t;
|
|
17951
17977
|
dx = 3 * o * o * x1 + 6 * o * v * (x2 - x1) + 3 * v * v * (1 - x2);
|
|
17952
|
-
if (abs(dx) < 1e-6) break;
|
|
17978
|
+
if (abs$1(dx) < 1e-6) break;
|
|
17953
17979
|
v -= x / dx;
|
|
17954
17980
|
}
|
|
17955
17981
|
return cache[key] = bezier(v, y1, y2);
|
|
@@ -19049,7 +19075,7 @@ const HighBezierHelper = {
|
|
|
19049
19075
|
|
|
19050
19076
|
const {getDistance: getDistance} = HighBezierHelper;
|
|
19051
19077
|
|
|
19052
|
-
const {M: M, L: L, C: C, Z: Z} = PathCommandMap, {float: float$1} = MathHelper;
|
|
19078
|
+
const {M: M$1, L: L$1, C: C$1, Z: Z$1} = PathCommandMap, {float: float$1} = MathHelper;
|
|
19053
19079
|
|
|
19054
19080
|
const tempPoint = {}, tempFrom = {};
|
|
19055
19081
|
|
|
@@ -19060,18 +19086,18 @@ const HighCurveHelper = {
|
|
|
19060
19086
|
while (i < len) {
|
|
19061
19087
|
command = data[i];
|
|
19062
19088
|
switch (command) {
|
|
19063
|
-
case M:
|
|
19064
|
-
case L:
|
|
19089
|
+
case M$1:
|
|
19090
|
+
case L$1:
|
|
19065
19091
|
HighCurveHelper.transformPoints(data, matrix, i, 1);
|
|
19066
19092
|
i += 3;
|
|
19067
19093
|
break;
|
|
19068
19094
|
|
|
19069
|
-
case C:
|
|
19095
|
+
case C$1:
|
|
19070
19096
|
HighCurveHelper.transformPoints(data, matrix, i, 3);
|
|
19071
19097
|
i += 7;
|
|
19072
19098
|
break;
|
|
19073
19099
|
|
|
19074
|
-
case Z:
|
|
19100
|
+
case Z$1:
|
|
19075
19101
|
i += 1;
|
|
19076
19102
|
}
|
|
19077
19103
|
}
|
|
@@ -19092,17 +19118,17 @@ const HighCurveHelper = {
|
|
|
19092
19118
|
while (i < len) {
|
|
19093
19119
|
command = data[i];
|
|
19094
19120
|
switch (command) {
|
|
19095
|
-
case M:
|
|
19096
|
-
case L:
|
|
19121
|
+
case M$1:
|
|
19122
|
+
case L$1:
|
|
19097
19123
|
toX = data[i + 1];
|
|
19098
19124
|
toY = data[i + 2];
|
|
19099
|
-
distance = command === L && i > 0 ? PointHelper.getDistanceFrom(x, y, toX, toY) : 0;
|
|
19125
|
+
distance = command === L$1 && i > 0 ? PointHelper.getDistanceFrom(x, y, toX, toY) : 0;
|
|
19100
19126
|
x = toX;
|
|
19101
19127
|
y = toY;
|
|
19102
19128
|
i += 3;
|
|
19103
19129
|
break;
|
|
19104
19130
|
|
|
19105
|
-
case C:
|
|
19131
|
+
case C$1:
|
|
19106
19132
|
toX = data[i + 5];
|
|
19107
19133
|
toY = data[i + 6];
|
|
19108
19134
|
distance = HighBezierHelper.getDistance(x, y, data[i + 1], data[i + 2], data[i + 3], data[i + 4], toX, toY);
|
|
@@ -19111,7 +19137,7 @@ const HighCurveHelper = {
|
|
|
19111
19137
|
i += 7;
|
|
19112
19138
|
break;
|
|
19113
19139
|
|
|
19114
|
-
case Z:
|
|
19140
|
+
case Z$1:
|
|
19115
19141
|
i += 1;
|
|
19116
19142
|
|
|
19117
19143
|
default:
|
|
@@ -19136,8 +19162,8 @@ const HighCurveHelper = {
|
|
|
19136
19162
|
while (i < len) {
|
|
19137
19163
|
command = data[i];
|
|
19138
19164
|
switch (command) {
|
|
19139
|
-
case M:
|
|
19140
|
-
case L:
|
|
19165
|
+
case M$1:
|
|
19166
|
+
case L$1:
|
|
19141
19167
|
toX = data[i + 1];
|
|
19142
19168
|
toY = data[i + 2];
|
|
19143
19169
|
distance = segments[index];
|
|
@@ -19156,7 +19182,7 @@ const HighCurveHelper = {
|
|
|
19156
19182
|
i += 3;
|
|
19157
19183
|
break;
|
|
19158
19184
|
|
|
19159
|
-
case C:
|
|
19185
|
+
case C$1:
|
|
19160
19186
|
toX = data[i + 5];
|
|
19161
19187
|
toY = data[i + 6];
|
|
19162
19188
|
distance = segments[index];
|
|
@@ -19172,7 +19198,7 @@ const HighCurveHelper = {
|
|
|
19172
19198
|
i += 7;
|
|
19173
19199
|
break;
|
|
19174
19200
|
|
|
19175
|
-
case Z:
|
|
19201
|
+
case Z$1:
|
|
19176
19202
|
i += 1;
|
|
19177
19203
|
|
|
19178
19204
|
default:
|
|
@@ -19193,8 +19219,8 @@ const HighCurveHelper = {
|
|
|
19193
19219
|
while (i < len) {
|
|
19194
19220
|
command = data[i];
|
|
19195
19221
|
switch (command) {
|
|
19196
|
-
case M:
|
|
19197
|
-
case L:
|
|
19222
|
+
case M$1:
|
|
19223
|
+
case L$1:
|
|
19198
19224
|
toX = data[i + 1];
|
|
19199
19225
|
toY = data[i + 2];
|
|
19200
19226
|
distance = segments[index];
|
|
@@ -19217,7 +19243,7 @@ const HighCurveHelper = {
|
|
|
19217
19243
|
path.push(command, x, y);
|
|
19218
19244
|
break;
|
|
19219
19245
|
|
|
19220
|
-
case C:
|
|
19246
|
+
case C$1:
|
|
19221
19247
|
x1 = data[i + 1], y1 = data[i + 2], x2 = data[i + 3], y2 = data[i + 4];
|
|
19222
19248
|
toX = data[i + 5];
|
|
19223
19249
|
toY = data[i + 6];
|
|
@@ -19236,7 +19262,7 @@ const HighCurveHelper = {
|
|
|
19236
19262
|
path.push(command, x1, y1, x2, y2, toX, toY);
|
|
19237
19263
|
break;
|
|
19238
19264
|
|
|
19239
|
-
case Z:
|
|
19265
|
+
case Z$1:
|
|
19240
19266
|
i += 1;
|
|
19241
19267
|
path.push(command);
|
|
19242
19268
|
|
|
@@ -20757,4 +20783,290 @@ ImageBox = __decorate([ registerUI() ], ImageBox);
|
|
|
20757
20783
|
|
|
20758
20784
|
Plugin.add("box");
|
|
20759
20785
|
|
|
20786
|
+
function getTangentDistance(r, x, y, lastX, lastY, nextX, nextY) {
|
|
20787
|
+
const ux = lastX - x, uy = lastY - y;
|
|
20788
|
+
const vx = nextX - x, vy = nextY - y;
|
|
20789
|
+
const lenU = Math.sqrt(ux * ux + uy * uy);
|
|
20790
|
+
const lenV = Math.sqrt(vx * vx + vy * vy);
|
|
20791
|
+
if (lenU < .001 || lenV < .001) return 0;
|
|
20792
|
+
const cosTheta = (ux * vx + uy * vy) / (lenU * lenV);
|
|
20793
|
+
const safeCos = Math.max(-.99999, Math.min(.99999, cosTheta));
|
|
20794
|
+
let d = r * Math.sqrt((1 - safeCos) / (1 + safeCos));
|
|
20795
|
+
const maxD = Math.min(lenU / 2, lenV / 2);
|
|
20796
|
+
return Math.min(d, maxD);
|
|
20797
|
+
}
|
|
20798
|
+
|
|
20799
|
+
function getCorrectT(d, x, y, x1, y1, x2, y2, toX, toY) {
|
|
20800
|
+
if (d <= 0) return 0;
|
|
20801
|
+
const chordLen = Math.sqrt(Math.pow(toX - x, 2) + Math.pow(toY - y, 2));
|
|
20802
|
+
if (d >= chordLen) return .5;
|
|
20803
|
+
const vx0 = 3 * (x1 - x);
|
|
20804
|
+
const vy0 = 3 * (y1 - y);
|
|
20805
|
+
let v0mag = Math.sqrt(vx0 * vx0 + vy0 * vy0);
|
|
20806
|
+
if (v0mag < 1e-6) v0mag = chordLen || 1;
|
|
20807
|
+
let t = Math.min(.5, d / v0mag);
|
|
20808
|
+
const tempP = {
|
|
20809
|
+
x: 0,
|
|
20810
|
+
y: 0
|
|
20811
|
+
};
|
|
20812
|
+
for (let i = 0; i < 5; i++) {
|
|
20813
|
+
BezierHelper.getPointAndSet(t, x, y, x1, y1, x2, y2, toX, toY, tempP);
|
|
20814
|
+
const dx = tempP.x - x;
|
|
20815
|
+
const dy = tempP.y - y;
|
|
20816
|
+
const currentDist = Math.sqrt(dx * dx + dy * dy);
|
|
20817
|
+
if (currentDist < 1e-6) {
|
|
20818
|
+
t = t * 1.5;
|
|
20819
|
+
continue;
|
|
20820
|
+
}
|
|
20821
|
+
const vxt = BezierHelper.getDerivative(t, x, x1, x2, toX);
|
|
20822
|
+
const vyt = BezierHelper.getDerivative(t, y, y1, y2, toY);
|
|
20823
|
+
const f_prime = (dx * vxt + dy * vyt) / currentDist;
|
|
20824
|
+
if (Math.abs(f_prime) < 1e-6) break;
|
|
20825
|
+
const deltaT = (currentDist - d) / f_prime;
|
|
20826
|
+
const nextT = t - deltaT;
|
|
20827
|
+
const safeNextT = Math.max(0, Math.min(.6, nextT));
|
|
20828
|
+
if (Math.abs(safeNextT - t) < 1e-5) {
|
|
20829
|
+
t = safeNextT;
|
|
20830
|
+
break;
|
|
20831
|
+
}
|
|
20832
|
+
t = safeNextT;
|
|
20833
|
+
}
|
|
20834
|
+
return Math.max(0, Math.min(.5, t));
|
|
20835
|
+
}
|
|
20836
|
+
|
|
20837
|
+
const {M: M, L: L, C: C, Z: Z} = PathCommandMap, {abs: abs} = Math;
|
|
20838
|
+
|
|
20839
|
+
const {getCenterX: getCenterX, getCenterY: getCenterY} = PointHelper;
|
|
20840
|
+
|
|
20841
|
+
const {arcTo: arcTo} = PathCommandDataHelper;
|
|
20842
|
+
|
|
20843
|
+
PathCorner.smooth = function smooth(data, cornerRadius, _cornerSmoothing) {
|
|
20844
|
+
const radius = data.radius;
|
|
20845
|
+
if (isNeedConvert(data)) data = PathConvert.toCanvasData(data, true); else data = [ ...data ];
|
|
20846
|
+
let command, lastCommand, commandLen;
|
|
20847
|
+
let i = 0, countCommand = 0, x = 0, y = 0, startX = 0, startY = 0, startR = 0, secondX = 0, secondY = 0, lastX = 0, lastY = 0, r, x1, y1, x2, y2, toX, toY;
|
|
20848
|
+
if (isArray(cornerRadius)) cornerRadius = cornerRadius[0] || 0;
|
|
20849
|
+
const len = data.length, three = len === 9;
|
|
20850
|
+
const smooth = [];
|
|
20851
|
+
while (i < len) {
|
|
20852
|
+
command = data[i];
|
|
20853
|
+
r = radius ? isUndefined(radius[countCommand]) ? cornerRadius : radius[countCommand] : cornerRadius;
|
|
20854
|
+
switch (command) {
|
|
20855
|
+
case M:
|
|
20856
|
+
startX = lastX = data[i + 1];
|
|
20857
|
+
startY = lastY = data[i + 2];
|
|
20858
|
+
startR = r;
|
|
20859
|
+
i += 3;
|
|
20860
|
+
const end = findEndPoint(data, i);
|
|
20861
|
+
switch (data[i]) {
|
|
20862
|
+
case L:
|
|
20863
|
+
secondX = data[i + 1];
|
|
20864
|
+
secondY = data[i + 2];
|
|
20865
|
+
if (three) smooth.push(M, startX, startY); else {
|
|
20866
|
+
if (end) smooth.push(M, getCenterX(startX, secondX), getCenterY(startY, secondY)); else smooth.push(M, startX, startY);
|
|
20867
|
+
}
|
|
20868
|
+
break;
|
|
20869
|
+
|
|
20870
|
+
case C:
|
|
20871
|
+
if (end) {
|
|
20872
|
+
const {left: left, right: right} = setAfterC(data, i, r, end.x, end.y, startX, startY, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6]);
|
|
20873
|
+
if (left && right) {
|
|
20874
|
+
smooth.push(M, secondX = left[4], secondY = left[5]);
|
|
20875
|
+
break;
|
|
20876
|
+
}
|
|
20877
|
+
}
|
|
20878
|
+
|
|
20879
|
+
default:
|
|
20880
|
+
smooth.push(M, secondX = startX, secondY = startY);
|
|
20881
|
+
}
|
|
20882
|
+
break;
|
|
20883
|
+
|
|
20884
|
+
case L:
|
|
20885
|
+
x = data[i + 1];
|
|
20886
|
+
y = data[i + 2];
|
|
20887
|
+
i += 3;
|
|
20888
|
+
switch (data[i]) {
|
|
20889
|
+
case L:
|
|
20890
|
+
arcTo(smooth, x, y, data[i + 1], data[i + 2], r, lastX, lastY, three);
|
|
20891
|
+
break;
|
|
20892
|
+
|
|
20893
|
+
case C:
|
|
20894
|
+
const {left: left, right: right} = setAfterC(data, i, r, lastX, lastY, x, y, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6]);
|
|
20895
|
+
if (left && right) arcTo(smooth, x, y, left[4], left[5], r, lastX, lastY, three); else smooth.push(L, x, y);
|
|
20896
|
+
break;
|
|
20897
|
+
|
|
20898
|
+
case Z:
|
|
20899
|
+
arcTo(smooth, x, y, startX, startY, r, lastX, lastY, three);
|
|
20900
|
+
break;
|
|
20901
|
+
|
|
20902
|
+
default:
|
|
20903
|
+
smooth.push(L, x, y);
|
|
20904
|
+
}
|
|
20905
|
+
lastX = x;
|
|
20906
|
+
lastY = y;
|
|
20907
|
+
break;
|
|
20908
|
+
|
|
20909
|
+
case C:
|
|
20910
|
+
x1 = data[i + 1];
|
|
20911
|
+
y1 = data[i + 2];
|
|
20912
|
+
x2 = data[i + 3];
|
|
20913
|
+
y2 = data[i + 4];
|
|
20914
|
+
x = data[i + 5];
|
|
20915
|
+
y = data[i + 6];
|
|
20916
|
+
i += 7;
|
|
20917
|
+
switch (data[i]) {
|
|
20918
|
+
case L:
|
|
20919
|
+
toX = data[i + 1], toY = data[i + 2];
|
|
20920
|
+
setBeforeC(smooth, r, lastX, lastY, x1, y1, x2, y2, x, y, toX, toY, three);
|
|
20921
|
+
break;
|
|
20922
|
+
|
|
20923
|
+
case C:
|
|
20924
|
+
smooth.push(C, x1, y1, x2, y2, x, y);
|
|
20925
|
+
break;
|
|
20926
|
+
|
|
20927
|
+
case Z:
|
|
20928
|
+
toX = startX, toY = startY;
|
|
20929
|
+
setBeforeC(smooth, r, lastX, lastY, x1, y1, x2, y2, x, y, toX, toY, three);
|
|
20930
|
+
break;
|
|
20931
|
+
|
|
20932
|
+
default:
|
|
20933
|
+
smooth.push(C, x1, y1, x2, y2, x, y);
|
|
20934
|
+
}
|
|
20935
|
+
lastX = x;
|
|
20936
|
+
lastY = y;
|
|
20937
|
+
break;
|
|
20938
|
+
|
|
20939
|
+
case Z:
|
|
20940
|
+
if (lastCommand !== Z) {
|
|
20941
|
+
arcTo(smooth, startX, startY, secondX, secondY, startR, lastX, lastY, three);
|
|
20942
|
+
smooth.push(Z);
|
|
20943
|
+
}
|
|
20944
|
+
i += 1;
|
|
20945
|
+
break;
|
|
20946
|
+
|
|
20947
|
+
default:
|
|
20948
|
+
commandLen = PathNumberCommandLengthMap[command];
|
|
20949
|
+
for (let j = 0; j < commandLen; j++) smooth.push(data[i + j]);
|
|
20950
|
+
i += commandLen;
|
|
20951
|
+
}
|
|
20952
|
+
lastCommand = command;
|
|
20953
|
+
countCommand++;
|
|
20954
|
+
}
|
|
20955
|
+
return smooth;
|
|
20956
|
+
};
|
|
20957
|
+
|
|
20958
|
+
function isNeedConvert(data) {
|
|
20959
|
+
let command, i = 0;
|
|
20960
|
+
const len = data.length;
|
|
20961
|
+
while (i < len) {
|
|
20962
|
+
command = data[i];
|
|
20963
|
+
switch (command) {
|
|
20964
|
+
case M:
|
|
20965
|
+
i += 3;
|
|
20966
|
+
break;
|
|
20967
|
+
|
|
20968
|
+
case L:
|
|
20969
|
+
i += 3;
|
|
20970
|
+
break;
|
|
20971
|
+
|
|
20972
|
+
case C:
|
|
20973
|
+
i += 7;
|
|
20974
|
+
break;
|
|
20975
|
+
|
|
20976
|
+
case Z:
|
|
20977
|
+
i += 1;
|
|
20978
|
+
break;
|
|
20979
|
+
|
|
20980
|
+
default:
|
|
20981
|
+
return true;
|
|
20982
|
+
}
|
|
20983
|
+
}
|
|
20984
|
+
return false;
|
|
20985
|
+
}
|
|
20986
|
+
|
|
20987
|
+
function findEndPoint(data, i) {
|
|
20988
|
+
let command, commandLen, x, y;
|
|
20989
|
+
const len = data.length;
|
|
20990
|
+
while (i < len) {
|
|
20991
|
+
command = data[i];
|
|
20992
|
+
switch (command) {
|
|
20993
|
+
case M:
|
|
20994
|
+
return undefined;
|
|
20995
|
+
|
|
20996
|
+
case L:
|
|
20997
|
+
x = data[i + 1];
|
|
20998
|
+
y = data[i + 2];
|
|
20999
|
+
i += 3;
|
|
21000
|
+
break;
|
|
21001
|
+
|
|
21002
|
+
case C:
|
|
21003
|
+
x = data[i + 5];
|
|
21004
|
+
y = data[i + 6];
|
|
21005
|
+
i += 7;
|
|
21006
|
+
break;
|
|
21007
|
+
|
|
21008
|
+
case Z:
|
|
21009
|
+
return {
|
|
21010
|
+
x: x,
|
|
21011
|
+
y: y
|
|
21012
|
+
};
|
|
21013
|
+
|
|
21014
|
+
default:
|
|
21015
|
+
commandLen = PathNumberCommandLengthMap[command];
|
|
21016
|
+
i += commandLen;
|
|
21017
|
+
}
|
|
21018
|
+
}
|
|
21019
|
+
return undefined;
|
|
21020
|
+
}
|
|
21021
|
+
|
|
21022
|
+
function setAfterC(data, i, cornerRadius, lastX, lastY, fromX, fromY, x1, y1, x2, y2, toX, toY) {
|
|
21023
|
+
let targetX = x1, targetY = y1;
|
|
21024
|
+
if (isSame(x1, fromX) && isSame(y1, fromY)) {
|
|
21025
|
+
targetX = x2;
|
|
21026
|
+
targetY = y2;
|
|
21027
|
+
if (isSame(x2, fromX) && isSame(y2, fromY)) {
|
|
21028
|
+
targetX = toX;
|
|
21029
|
+
targetY = toY;
|
|
21030
|
+
}
|
|
21031
|
+
}
|
|
21032
|
+
const d = getTangentDistance(cornerRadius, fromX, fromY, lastX, lastY, targetX, targetY);
|
|
21033
|
+
const t = getCorrectT(d, fromX, fromY, x1, y1, x2, y2, toX, toY);
|
|
21034
|
+
const two = BezierHelper.cut(t, fromX, fromY, x1, y1, x2, y2, toX, toY);
|
|
21035
|
+
const {left: left, right: right} = two;
|
|
21036
|
+
if (left && right) {
|
|
21037
|
+
data[i + 1] = right[0];
|
|
21038
|
+
data[i + 2] = right[1];
|
|
21039
|
+
data[i + 3] = right[2];
|
|
21040
|
+
data[i + 4] = right[3];
|
|
21041
|
+
}
|
|
21042
|
+
return two;
|
|
21043
|
+
}
|
|
21044
|
+
|
|
21045
|
+
function setBeforeC(smooth, cornerRadius, fromX, fromY, x1, y1, x2, y2, toX, toY, nextX, nextY, three) {
|
|
21046
|
+
let targetX = x2, targetY = y2;
|
|
21047
|
+
if (isSame(targetX, toX) && isSame(targetY, toY)) {
|
|
21048
|
+
targetX = x1;
|
|
21049
|
+
targetY = y1;
|
|
21050
|
+
if (isSame(targetX, toX) && isSame(targetY, toY)) {
|
|
21051
|
+
targetX = fromX;
|
|
21052
|
+
targetY = fromY;
|
|
21053
|
+
}
|
|
21054
|
+
}
|
|
21055
|
+
const d = getTangentDistance(cornerRadius, toX, toY, targetX, targetY, nextX, nextY);
|
|
21056
|
+
const t = getCorrectT(d, toX, toY, x2, y2, x1, y1, fromX, fromY);
|
|
21057
|
+
const {left: left, right: right} = BezierHelper.cut(1 - t, fromX, fromY, x1, y1, x2, y2, toX, toY);
|
|
21058
|
+
if (left && right) {
|
|
21059
|
+
smooth.push(C, left[0], left[1], left[2], left[3], left[4], left[5]);
|
|
21060
|
+
arcTo(smooth, toX, toY, nextX, nextY, cornerRadius, left[4], left[5], three);
|
|
21061
|
+
} else {
|
|
21062
|
+
smooth.push(C, x1, y1, x2, y2, toX, toY);
|
|
21063
|
+
}
|
|
21064
|
+
}
|
|
21065
|
+
|
|
21066
|
+
function isSame(a, b) {
|
|
21067
|
+
return abs(a - b) < .01;
|
|
21068
|
+
}
|
|
21069
|
+
|
|
21070
|
+
Plugin.add("corner");
|
|
21071
|
+
|
|
20760
21072
|
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, EllipseBox, EllipseBoxData, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageBox, ImageBoxData, 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, LeaferFilm, LeaferImage, LeaferTypeCreator, LeaferVideo, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathBox, PathBoxData, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonBox, PolygonBoxData, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, Scroller, SelectArea, Selector, Star, StarBox, StarBoxData, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, UnitConvertHelper, 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$3 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$4 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
|