@leafer-draw/miniapp 2.1.6 → 2.1.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 +2 -1
- package/dist/miniapp.esm.js +2 -1
- 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 +98 -71
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +7 -7
package/dist/miniapp.module.js
CHANGED
|
@@ -253,7 +253,7 @@ const FourNumberHelper = {
|
|
|
253
253
|
return to;
|
|
254
254
|
},
|
|
255
255
|
setTemp(top, right, bottom, left) {
|
|
256
|
-
return set$
|
|
256
|
+
return set$3(tempFour, top, right, bottom, left);
|
|
257
257
|
},
|
|
258
258
|
toTempAB(a, b, change) {
|
|
259
259
|
tempTo = change ? isNumber(a) ? b : a : [];
|
|
@@ -293,22 +293,22 @@ const FourNumberHelper = {
|
|
|
293
293
|
max(t, other, change) {
|
|
294
294
|
if (isNumber(t) && isNumber(other)) return max$4(t, other);
|
|
295
295
|
toTempAB(t, other, change);
|
|
296
|
-
return set$
|
|
296
|
+
return set$3(tempTo, max$4(tempA[0], tempB[0]), max$4(tempA[1], tempB[1]), max$4(tempA[2], tempB[2]), max$4(tempA[3], tempB[3]));
|
|
297
297
|
},
|
|
298
298
|
add(t, other, change) {
|
|
299
299
|
if (isNumber(t) && isNumber(other)) return t + other;
|
|
300
300
|
toTempAB(t, other, change);
|
|
301
|
-
return set$
|
|
301
|
+
return set$3(tempTo, tempA[0] + tempB[0], tempA[1] + tempB[1], tempA[2] + tempB[2], tempA[3] + tempB[3]);
|
|
302
302
|
},
|
|
303
303
|
swapAndScale(t, scaleX, scaleY, change) {
|
|
304
304
|
if (isNumber(t)) return scaleX === scaleY ? t * scaleX : [ t * scaleY, t * scaleX ];
|
|
305
305
|
const to = change ? t : [];
|
|
306
306
|
const [top, right, bottom, left] = t.length === 4 ? t : get$5(t);
|
|
307
|
-
return set$
|
|
307
|
+
return set$3(to, bottom * scaleY, left * scaleX, top * scaleY, right * scaleX);
|
|
308
308
|
}
|
|
309
309
|
};
|
|
310
310
|
|
|
311
|
-
const {set: set$
|
|
311
|
+
const {set: set$3, get: get$5, setTemp: setTemp, toTempAB: toTempAB} = FourNumberHelper;
|
|
312
312
|
|
|
313
313
|
const {round: round$3, pow: pow$1, max: max$3, floor: floor$2, PI: PI$3} = Math;
|
|
314
314
|
|
|
@@ -433,7 +433,7 @@ const {sin: sin$5, cos: cos$5, acos: acos, sqrt: sqrt$3} = Math;
|
|
|
433
433
|
|
|
434
434
|
const {float: float$2} = MathHelper;
|
|
435
435
|
|
|
436
|
-
const tempPoint$
|
|
436
|
+
const tempPoint$4 = {};
|
|
437
437
|
|
|
438
438
|
function getWorld() {
|
|
439
439
|
return Object.assign(Object.assign(Object.assign({}, getMatrixData()), getBoundsData()), {
|
|
@@ -492,8 +492,8 @@ const MatrixHelper = {
|
|
|
492
492
|
to.f = t.f * pixelRatio;
|
|
493
493
|
},
|
|
494
494
|
scaleOfOuter(t, origin, scaleX, scaleY) {
|
|
495
|
-
M$6.toInnerPoint(t, origin, tempPoint$
|
|
496
|
-
M$6.scaleOfInner(t, tempPoint$
|
|
495
|
+
M$6.toInnerPoint(t, origin, tempPoint$4);
|
|
496
|
+
M$6.scaleOfInner(t, tempPoint$4, scaleX, scaleY);
|
|
497
497
|
},
|
|
498
498
|
scaleOfInner(t, origin, scaleX, scaleY = scaleX) {
|
|
499
499
|
M$6.translateInner(t, origin.x, origin.y);
|
|
@@ -511,8 +511,8 @@ const MatrixHelper = {
|
|
|
511
511
|
t.d = c * sinR + d * cosR;
|
|
512
512
|
},
|
|
513
513
|
rotateOfOuter(t, origin, rotation) {
|
|
514
|
-
M$6.toInnerPoint(t, origin, tempPoint$
|
|
515
|
-
M$6.rotateOfInner(t, tempPoint$
|
|
514
|
+
M$6.toInnerPoint(t, origin, tempPoint$4);
|
|
515
|
+
M$6.rotateOfInner(t, tempPoint$4, rotation);
|
|
516
516
|
},
|
|
517
517
|
rotateOfInner(t, origin, rotation) {
|
|
518
518
|
M$6.translateInner(t, origin.x, origin.y);
|
|
@@ -533,8 +533,8 @@ const MatrixHelper = {
|
|
|
533
533
|
}
|
|
534
534
|
},
|
|
535
535
|
skewOfOuter(t, origin, skewX, skewY) {
|
|
536
|
-
M$6.toInnerPoint(t, origin, tempPoint$
|
|
537
|
-
M$6.skewOfInner(t, tempPoint$
|
|
536
|
+
M$6.toInnerPoint(t, origin, tempPoint$4);
|
|
537
|
+
M$6.skewOfInner(t, tempPoint$4, skewX, skewY);
|
|
538
538
|
},
|
|
539
539
|
skewOfInner(t, origin, skewX, skewY = 0) {
|
|
540
540
|
M$6.translateInner(t, origin.x, origin.y);
|
|
@@ -735,7 +735,7 @@ const {float: float$1} = MathHelper;
|
|
|
735
735
|
|
|
736
736
|
const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
|
|
737
737
|
|
|
738
|
-
const {sin: sin$4, cos: cos$4, abs: abs$
|
|
738
|
+
const {sin: sin$4, cos: cos$4, abs: abs$5, sqrt: sqrt$2, atan2: atan2$2, min: min$1, round: round$2} = Math;
|
|
739
739
|
|
|
740
740
|
const PointHelper = {
|
|
741
741
|
defaultPoint: getPointData(),
|
|
@@ -772,15 +772,15 @@ const PointHelper = {
|
|
|
772
772
|
t.x += (t.x - origin.x) * (scaleX - 1);
|
|
773
773
|
t.y += (t.y - origin.y) * (scaleY - 1);
|
|
774
774
|
},
|
|
775
|
-
rotate(t, rotation, origin) {
|
|
775
|
+
rotate(t, rotation, origin, radiusX = 1, radiusY = 1) {
|
|
776
776
|
if (!origin) origin = P$5.defaultPoint;
|
|
777
777
|
rotation *= OneRadian;
|
|
778
778
|
const cosR = cos$4(rotation);
|
|
779
779
|
const sinR = sin$4(rotation);
|
|
780
|
-
const rx = t.x - origin.x;
|
|
781
|
-
const ry = t.y - origin.y;
|
|
782
|
-
t.x = origin.x + rx * cosR - ry * sinR;
|
|
783
|
-
t.y = origin.y + rx * sinR + ry * cosR;
|
|
780
|
+
const rx = (t.x - origin.x) / radiusX;
|
|
781
|
+
const ry = (t.y - origin.y) / radiusY;
|
|
782
|
+
t.x = origin.x + (rx * cosR - ry * sinR) * radiusX;
|
|
783
|
+
t.y = origin.y + (rx * sinR + ry * cosR) * radiusY;
|
|
784
784
|
},
|
|
785
785
|
tempToInnerOf(t, matrix) {
|
|
786
786
|
const {tempPoint: temp} = P$5;
|
|
@@ -833,15 +833,15 @@ 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$5(x2 - x1);
|
|
837
|
+
const y = abs$5(y2 - y1);
|
|
838
838
|
return sqrt$2(x * x + y * y);
|
|
839
839
|
},
|
|
840
840
|
getMinDistanceFrom(x1, y1, x2, y2, x3, y3) {
|
|
841
841
|
return min$1(getDistanceFrom(x1, y1, x2, y2), getDistanceFrom(x2, y2, x3, y3));
|
|
842
842
|
},
|
|
843
|
-
getAngle(t, to) {
|
|
844
|
-
return getAtan2(t, to) / OneRadian;
|
|
843
|
+
getAngle(t, to, radiusX, radiusY) {
|
|
844
|
+
return getAtan2(t, to, radiusX, radiusY) / OneRadian;
|
|
845
845
|
},
|
|
846
846
|
getRotation(t, origin, to, toOrigin) {
|
|
847
847
|
if (!toOrigin) toOrigin = origin;
|
|
@@ -855,8 +855,8 @@ const PointHelper = {
|
|
|
855
855
|
const d = toY - toOriginY;
|
|
856
856
|
return Math.atan2(a * d - b * c, a * c + b * d);
|
|
857
857
|
},
|
|
858
|
-
getAtan2(t, to) {
|
|
859
|
-
return atan2$2(to.y - t.y, to.x - t.x);
|
|
858
|
+
getAtan2(t, to, radiusX = 1, radiusY = 1) {
|
|
859
|
+
return atan2$2((to.y - t.y) / radiusY, (to.x - t.x) / radiusX);
|
|
860
860
|
},
|
|
861
861
|
getDistancePoint(t, to, distance, changeTo, fromTo) {
|
|
862
862
|
const r = getAtan2(t, to);
|
|
@@ -913,12 +913,12 @@ class Point {
|
|
|
913
913
|
PointHelper.scaleOf(this, origin, scaleX, scaleY);
|
|
914
914
|
return this;
|
|
915
915
|
}
|
|
916
|
-
rotate(rotation, origin) {
|
|
917
|
-
PointHelper.rotate(this, rotation, origin);
|
|
916
|
+
rotate(rotation, origin, radiusX, radiusY) {
|
|
917
|
+
PointHelper.rotate(this, rotation, origin, radiusX, radiusY);
|
|
918
918
|
return this;
|
|
919
919
|
}
|
|
920
|
-
rotateOf(origin, rotation) {
|
|
921
|
-
PointHelper.rotate(this, rotation, origin);
|
|
920
|
+
rotateOf(origin, rotation, radiusX, radiusY) {
|
|
921
|
+
PointHelper.rotate(this, rotation, origin, radiusX, radiusY);
|
|
922
922
|
return this;
|
|
923
923
|
}
|
|
924
924
|
getRotation(origin, to, toOrigin) {
|
|
@@ -941,11 +941,11 @@ class Point {
|
|
|
941
941
|
getDistancePoint(to, distance, changeTo, fromTo) {
|
|
942
942
|
return new Point(PointHelper.getDistancePoint(this, to, distance, changeTo, fromTo));
|
|
943
943
|
}
|
|
944
|
-
getAngle(to) {
|
|
945
|
-
return PointHelper.getAngle(this, to);
|
|
944
|
+
getAngle(to, radiusX, radiusY) {
|
|
945
|
+
return PointHelper.getAngle(this, to, radiusX, radiusY);
|
|
946
946
|
}
|
|
947
|
-
getAtan2(to) {
|
|
948
|
-
return PointHelper.getAtan2(this, to);
|
|
947
|
+
getAtan2(to, radiusX, radiusY) {
|
|
948
|
+
return PointHelper.getAtan2(this, to, radiusX, radiusY);
|
|
949
949
|
}
|
|
950
950
|
isSame(point, quick) {
|
|
951
951
|
return PointHelper.isSame(this, point, quick);
|
|
@@ -956,7 +956,7 @@ class Point {
|
|
|
956
956
|
}
|
|
957
957
|
}
|
|
958
958
|
|
|
959
|
-
const tempPoint$
|
|
959
|
+
const tempPoint$3 = new Point;
|
|
960
960
|
|
|
961
961
|
class Matrix {
|
|
962
962
|
constructor(a, b, c, d, e, f) {
|
|
@@ -2702,15 +2702,15 @@ const RectHelper = {
|
|
|
2702
2702
|
}
|
|
2703
2703
|
};
|
|
2704
2704
|
|
|
2705
|
-
const {sin: sin$3, cos: cos$3, hypot: hypot, atan2: atan2$1, ceil: ceil, abs: abs$
|
|
2705
|
+
const {sin: sin$3, cos: cos$3, hypot: hypot, atan2: atan2$1, ceil: ceil, abs: abs$4, PI: PI$2, sqrt: sqrt$1, pow: pow} = Math;
|
|
2706
2706
|
|
|
2707
2707
|
const {setPoint: setPoint$1, addPoint: addPoint$1} = TwoPointBoundsHelper;
|
|
2708
2708
|
|
|
2709
|
-
const {set: set$
|
|
2709
|
+
const {set: set$2, toNumberPoints: toNumberPoints} = PointHelper;
|
|
2710
2710
|
|
|
2711
2711
|
const {M: M$5, L: L$6, C: C$4, Q: Q$4, Z: Z$5} = PathCommandMap;
|
|
2712
2712
|
|
|
2713
|
-
const tempPoint$
|
|
2713
|
+
const tempPoint$2 = {};
|
|
2714
2714
|
|
|
2715
2715
|
const BezierHelper = {
|
|
2716
2716
|
points(data, originPoints, curve, close) {
|
|
@@ -2779,14 +2779,14 @@ const BezierHelper = {
|
|
|
2779
2779
|
const lenCB = hypot(CBx, CBy);
|
|
2780
2780
|
let totalRadian = endRadian - startRadian;
|
|
2781
2781
|
if (totalRadian < 0) totalRadian += PI2;
|
|
2782
|
-
if (lenBA < 1e-12 || lenCB < 1e-12 || totalRadian < 1e-12 || abs$
|
|
2782
|
+
if (lenBA < 1e-12 || lenCB < 1e-12 || totalRadian < 1e-12 || abs$4(totalRadian - PI$2) < 1e-12) {
|
|
2783
2783
|
if (data) data.push(L$6, x1, y1);
|
|
2784
2784
|
if (setPointBounds) {
|
|
2785
2785
|
setPoint$1(setPointBounds, fromX, fromY);
|
|
2786
2786
|
addPoint$1(setPointBounds, x1, y1);
|
|
2787
2787
|
}
|
|
2788
|
-
if (setStartPoint) set$
|
|
2789
|
-
if (setEndPoint) set$
|
|
2788
|
+
if (setStartPoint) set$2(setStartPoint, fromX, fromY);
|
|
2789
|
+
if (setEndPoint) set$2(setEndPoint, x1, y1);
|
|
2790
2790
|
return;
|
|
2791
2791
|
}
|
|
2792
2792
|
const anticlockwise = BAx * CBy - CBx * BAy < 0;
|
|
@@ -2812,7 +2812,7 @@ const BezierHelper = {
|
|
|
2812
2812
|
let totalRadian = endRadian - startRadian;
|
|
2813
2813
|
if (totalRadian < 0) totalRadian += PI2; else if (totalRadian > PI2) totalRadian -= PI2;
|
|
2814
2814
|
if (anticlockwise) totalRadian -= PI2;
|
|
2815
|
-
const parts = ceil(abs$
|
|
2815
|
+
const parts = ceil(abs$4(totalRadian / PI_2));
|
|
2816
2816
|
const partRadian = totalRadian / parts;
|
|
2817
2817
|
const partRadian4Sin = sin$3(partRadian / 4);
|
|
2818
2818
|
const control = 8 / 3 * partRadian4Sin * partRadian4Sin / sin$3(partRadian / 2);
|
|
@@ -2826,7 +2826,7 @@ const BezierHelper = {
|
|
|
2826
2826
|
let fromX = cx + x, fromY = cy + y;
|
|
2827
2827
|
if (data) data.push(data.length ? L$6 : M$5, fromX, fromY);
|
|
2828
2828
|
if (setPointBounds) setPoint$1(setPointBounds, fromX, fromY);
|
|
2829
|
-
if (setStartPoint) set$
|
|
2829
|
+
if (setStartPoint) set$2(setStartPoint, fromX, fromY);
|
|
2830
2830
|
for (let i = 0; i < parts; i++) {
|
|
2831
2831
|
endCos = cos$3(endRadian);
|
|
2832
2832
|
endSin = sin$3(endRadian);
|
|
@@ -2845,7 +2845,7 @@ const BezierHelper = {
|
|
|
2845
2845
|
startRadian = endRadian;
|
|
2846
2846
|
endRadian += partRadian;
|
|
2847
2847
|
}
|
|
2848
|
-
if (setEndPoint) set$
|
|
2848
|
+
if (setEndPoint) set$2(setEndPoint, cx + x, cy + y);
|
|
2849
2849
|
},
|
|
2850
2850
|
quadraticCurveTo(data, fromX, fromY, x1, y1, toX, toY) {
|
|
2851
2851
|
data.push(C$4, (fromX + 2 * x1) / 3, (fromY + 2 * y1) / 3, (toX + 2 * x1) / 3, (toY + 2 * y1) / 3, toX, toY);
|
|
@@ -2881,8 +2881,8 @@ const BezierHelper = {
|
|
|
2881
2881
|
addMode ? addPoint$1(pointBounds, fromX, fromY) : setPoint$1(pointBounds, fromX, fromY);
|
|
2882
2882
|
addPoint$1(pointBounds, toX, toY);
|
|
2883
2883
|
for (let i = 0, len = tList.length; i < len; i++) {
|
|
2884
|
-
getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$
|
|
2885
|
-
addPoint$1(pointBounds, tempPoint$
|
|
2884
|
+
getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$2);
|
|
2885
|
+
addPoint$1(pointBounds, tempPoint$2.x, tempPoint$2.y);
|
|
2886
2886
|
}
|
|
2887
2887
|
},
|
|
2888
2888
|
getPointAndSet(t, fromX, fromY, x1, y1, x2, y2, toX, toY, setPoint) {
|
|
@@ -3321,7 +3321,7 @@ const {M: M$3, L: L$4, C: C$2, Q: Q$2, Z: Z$3, N: N$2, D: D$2, X: X$2, G: G$2, F
|
|
|
3321
3321
|
|
|
3322
3322
|
const {getMinDistanceFrom: getMinDistanceFrom, getRadianFrom: getRadianFrom} = PointHelper;
|
|
3323
3323
|
|
|
3324
|
-
const {tan: tan, min: min, abs: abs$
|
|
3324
|
+
const {tan: tan, min: min, abs: abs$3} = Math;
|
|
3325
3325
|
|
|
3326
3326
|
const startPoint = {};
|
|
3327
3327
|
|
|
@@ -3381,7 +3381,7 @@ const PathCommandDataHelper = {
|
|
|
3381
3381
|
arcTo(data, x1, y1, x2, y2, radius, lastX, lastY, fullRadius) {
|
|
3382
3382
|
if (!isUndefined(lastX)) {
|
|
3383
3383
|
const r = getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2) / (fullRadius ? 1 : 2);
|
|
3384
|
-
radius = min(radius, min(r, r * abs$
|
|
3384
|
+
radius = min(radius, min(r, r * abs$3(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
|
|
3385
3385
|
}
|
|
3386
3386
|
data.push(U$2, x1, y1, x2, y2, radius);
|
|
3387
3387
|
},
|
|
@@ -4586,7 +4586,9 @@ function sortType(defaultValue) {
|
|
|
4586
4586
|
set(value) {
|
|
4587
4587
|
if (this.__setAttr(key, value)) {
|
|
4588
4588
|
this.waitParent(() => {
|
|
4589
|
-
this
|
|
4589
|
+
const {parent: parent} = this;
|
|
4590
|
+
parent.__layout.childrenSortChange();
|
|
4591
|
+
if (parent.__.flow) parent.__layout.boxChange();
|
|
4590
4592
|
});
|
|
4591
4593
|
}
|
|
4592
4594
|
}
|
|
@@ -4988,7 +4990,7 @@ const LeafHelper = {
|
|
|
4988
4990
|
p = p.parent;
|
|
4989
4991
|
}
|
|
4990
4992
|
},
|
|
4991
|
-
animateMove(t, move, speed = .3) {
|
|
4993
|
+
animateMove(t, move, speed = .3, onAnimate) {
|
|
4992
4994
|
if (!move.x && !move.y) return;
|
|
4993
4995
|
if (Math.abs(move.x) < 1 && Math.abs(move.y) < 1) {
|
|
4994
4996
|
t.move(move);
|
|
@@ -4996,8 +4998,9 @@ const LeafHelper = {
|
|
|
4996
4998
|
const x = move.x * speed, y = move.y * speed;
|
|
4997
4999
|
move.x -= x, move.y -= y;
|
|
4998
5000
|
t.move(x, y);
|
|
4999
|
-
Platform.requestRender(() => L.animateMove(t, move, speed));
|
|
5001
|
+
Platform.requestRender(() => L.animateMove(t, move, speed, onAnimate));
|
|
5000
5002
|
}
|
|
5003
|
+
onAnimate && onAnimate();
|
|
5001
5004
|
}
|
|
5002
5005
|
};
|
|
5003
5006
|
|
|
@@ -6038,7 +6041,7 @@ const LeafDataProxy = {
|
|
|
6038
6041
|
|
|
6039
6042
|
const {setLayout: setLayout, multiplyParent: multiplyParent$2, translateInner: translateInner, defaultWorld: defaultWorld} = MatrixHelper;
|
|
6040
6043
|
|
|
6041
|
-
const {toPoint: toPoint$3, tempPoint: tempPoint} = AroundHelper;
|
|
6044
|
+
const {toPoint: toPoint$3, tempPoint: tempPoint$1} = AroundHelper;
|
|
6042
6045
|
|
|
6043
6046
|
const LeafMatrix = {
|
|
6044
6047
|
__updateWorldMatrix() {
|
|
@@ -6059,8 +6062,8 @@ const LeafMatrix = {
|
|
|
6059
6062
|
local.e = data.x + data.offsetX;
|
|
6060
6063
|
local.f = data.y + data.offsetY;
|
|
6061
6064
|
if (data.around || data.origin) {
|
|
6062
|
-
toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint);
|
|
6063
|
-
translateInner(local, -tempPoint.x, -tempPoint.y, !data.around);
|
|
6065
|
+
toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint$1);
|
|
6066
|
+
translateInner(local, -tempPoint$1.x, -tempPoint$1.y, !data.around);
|
|
6064
6067
|
}
|
|
6065
6068
|
}
|
|
6066
6069
|
this.__layout.matrixChanged = undefined;
|
|
@@ -6169,6 +6172,7 @@ const LeafBounds = {
|
|
|
6169
6172
|
if (this.isBranch) {
|
|
6170
6173
|
this.__extraUpdate();
|
|
6171
6174
|
if (this.__.flow) {
|
|
6175
|
+
if (this.__layout.childrenSortChanged) this.__updateSortChildren();
|
|
6172
6176
|
if (this.__layout.boxChanged) this.__updateFlowLayout();
|
|
6173
6177
|
updateAllMatrix$2(this);
|
|
6174
6178
|
updateBounds$1(this, this);
|
|
@@ -6240,11 +6244,7 @@ const {excludeRenderBounds: excludeRenderBounds$1} = LeafBoundsHelper, {hasSize:
|
|
|
6240
6244
|
|
|
6241
6245
|
const BranchRender = {
|
|
6242
6246
|
__updateChange() {
|
|
6243
|
-
|
|
6244
|
-
if (layout.childrenSortChanged) {
|
|
6245
|
-
this.__updateSortChildren();
|
|
6246
|
-
layout.childrenSortChanged = false;
|
|
6247
|
-
}
|
|
6247
|
+
if (this.__layout.childrenSortChanged) this.__updateSortChildren();
|
|
6248
6248
|
this.__.__checkSingle();
|
|
6249
6249
|
},
|
|
6250
6250
|
__render(canvas, options) {
|
|
@@ -6748,6 +6748,7 @@ let Branch = class Branch extends Leaf {
|
|
|
6748
6748
|
children.sort(sort);
|
|
6749
6749
|
this.__layout.affectChildrenSort = affectSort;
|
|
6750
6750
|
}
|
|
6751
|
+
this.__layout.childrenSortChanged = false;
|
|
6751
6752
|
}
|
|
6752
6753
|
add(child, index) {
|
|
6753
6754
|
if (child === this || child.destroyed) return debug$4.warn("add self or destroyed");
|
|
@@ -6983,7 +6984,7 @@ class LeafLevelList {
|
|
|
6983
6984
|
}
|
|
6984
6985
|
}
|
|
6985
6986
|
|
|
6986
|
-
const version = "2.1.
|
|
6987
|
+
const version = "2.1.8";
|
|
6987
6988
|
|
|
6988
6989
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6989
6990
|
get allowBackgroundColor() {
|
|
@@ -8508,6 +8509,7 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8508
8509
|
this.set(keyframe);
|
|
8509
8510
|
return Plugin.need("animate");
|
|
8510
8511
|
}
|
|
8512
|
+
killAnimate(_type, _nextStyle) {}
|
|
8511
8513
|
export(_filename, _options) {
|
|
8512
8514
|
return Plugin.need("export");
|
|
8513
8515
|
}
|
|
@@ -9267,32 +9269,56 @@ __decorate([ affectRenderBoundsType("hide") ], Frame.prototype, "overflow", void
|
|
|
9267
9269
|
|
|
9268
9270
|
Frame = __decorate([ registerUI() ], Frame);
|
|
9269
9271
|
|
|
9270
|
-
const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse} = PathCommandDataHelper;
|
|
9272
|
+
const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse} = PathCommandDataHelper, {tempPoint: tempPoint, set: set$1, rotate: rotate$2} = PointHelper, {abs: abs$2} = Math, tempCenter = {};
|
|
9271
9273
|
|
|
9272
9274
|
let Ellipse = class Ellipse extends UI {
|
|
9273
9275
|
get __tag() {
|
|
9274
9276
|
return "Ellipse";
|
|
9275
9277
|
}
|
|
9276
9278
|
__updatePath() {
|
|
9277
|
-
const data = this.__, {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle} = data;
|
|
9279
|
+
const data = this.__, {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle, closed: closed} = data;
|
|
9278
9280
|
const rx = width / 2, ry = height / 2;
|
|
9279
9281
|
const path = data.path = [];
|
|
9280
|
-
let open;
|
|
9282
|
+
let open, hasAngle, closedAngle;
|
|
9283
|
+
if (startAngle || endAngle) hasAngle = true;
|
|
9284
|
+
if (hasAngle) closedAngle = abs$2(endAngle - startAngle) === 360;
|
|
9281
9285
|
if (innerRadius) {
|
|
9282
|
-
|
|
9283
|
-
|
|
9284
|
-
|
|
9286
|
+
const drawInnerEllipse = innerRadius < 1 || closed;
|
|
9287
|
+
let outerStartAngle = startAngle, outerEndAngle = endAngle, outerAnticlockwise;
|
|
9288
|
+
if (hasAngle) {
|
|
9289
|
+
if (drawInnerEllipse) {
|
|
9290
|
+
ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle);
|
|
9291
|
+
if (closedAngle) {
|
|
9292
|
+
set$1(tempPoint, width, ry);
|
|
9293
|
+
set$1(tempCenter, rx, ry);
|
|
9294
|
+
rotate$2(tempPoint, endAngle, tempCenter, rx, ry);
|
|
9295
|
+
moveTo$3(path, tempPoint.x, tempPoint.y);
|
|
9296
|
+
}
|
|
9297
|
+
outerStartAngle = endAngle;
|
|
9298
|
+
outerEndAngle = startAngle;
|
|
9299
|
+
outerAnticlockwise = true;
|
|
9300
|
+
} else {
|
|
9301
|
+
if (!closedAngle) open = true;
|
|
9302
|
+
}
|
|
9285
9303
|
} else {
|
|
9286
|
-
if (
|
|
9304
|
+
if (drawInnerEllipse) {
|
|
9287
9305
|
ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
|
|
9306
|
+
closePath$2(path);
|
|
9288
9307
|
moveTo$3(path, width, ry);
|
|
9308
|
+
outerStartAngle = 360;
|
|
9309
|
+
outerAnticlockwise = true;
|
|
9310
|
+
} else {
|
|
9311
|
+
outerEndAngle = 360;
|
|
9289
9312
|
}
|
|
9290
|
-
ellipse(path, rx, ry, rx, ry, 0, 360, 0, true);
|
|
9291
9313
|
}
|
|
9314
|
+
ellipse(path, rx, ry, rx, ry, 0, outerStartAngle, outerEndAngle, outerAnticlockwise);
|
|
9292
9315
|
} else {
|
|
9293
|
-
if (
|
|
9294
|
-
|
|
9295
|
-
|
|
9316
|
+
if (hasAngle) {
|
|
9317
|
+
if (!closedAngle) {
|
|
9318
|
+
if (!closed) open = true;
|
|
9319
|
+
if (!open) moveTo$3(path, rx, ry);
|
|
9320
|
+
}
|
|
9321
|
+
ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle);
|
|
9296
9322
|
} else {
|
|
9297
9323
|
ellipse(path, rx, ry, rx, ry);
|
|
9298
9324
|
}
|
|
@@ -10159,6 +10185,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
|
|
|
10159
10185
|
if (data.__autoSide) {
|
|
10160
10186
|
ui.forceUpdate("width");
|
|
10161
10187
|
LeafHelper.updateBounds(ui);
|
|
10188
|
+
ui.__layout.boundsChanged = true;
|
|
10162
10189
|
if (ui.__proxyData) {
|
|
10163
10190
|
ui.setProxyAttr("width", data.width);
|
|
10164
10191
|
ui.setProxyAttr("height", data.height);
|
|
@@ -10166,7 +10193,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
|
|
|
10166
10193
|
needUpdate = false;
|
|
10167
10194
|
}
|
|
10168
10195
|
}
|
|
10169
|
-
if (paint.mode === "brush") PaintImage.brush(
|
|
10196
|
+
if (paint.mode === "brush") PaintImage.brush(ui, attrName, leafPaint);
|
|
10170
10197
|
if (!leafPaint.data) {
|
|
10171
10198
|
PaintImage.createData(leafPaint, image, paint, boxBounds);
|
|
10172
10199
|
const {transform: transform} = leafPaint.data, {opacity: opacity} = paint;
|
|
@@ -11434,4 +11461,4 @@ try {
|
|
|
11434
11461
|
if (wx) useCanvas("miniapp", wx);
|
|
11435
11462
|
} catch (_a) {}
|
|
11436
11463
|
|
|
11437
|
-
export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, DataHelper, Debug, Direction4, Direction9, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, FourNumberHelper, Frame, FrameData, Group, GroupData, Image, ImageData, ImageEvent, ImageManager, IncrementId, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferFilm, LeaferImage, LeaferVideo, Line, LineData, MathHelper, Matrix, MatrixHelper, MyImage, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Platform, Plugin, Point, PointHelper, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Run, Star, StarData, State, StringNumberMap, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIRender, UnitConvert, UnitConvertHelper, WaitHelper, WatchEvent, Watcher, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, tempBounds$2 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$
|
|
11464
|
+
export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, DataHelper, Debug, Direction4, Direction9, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, FourNumberHelper, Frame, FrameData, Group, GroupData, Image, ImageData, ImageEvent, ImageManager, IncrementId, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferFilm, LeaferImage, LeaferVideo, Line, LineData, MathHelper, Matrix, MatrixHelper, MyImage, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Platform, Plugin, Point, PointHelper, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Run, Star, StarData, State, StringNumberMap, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIRender, UnitConvert, UnitConvertHelper, WaitHelper, WatchEvent, Watcher, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, tempBounds$2 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$3 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
|