leafer-draw 2.1.5 → 2.1.7
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/web.cjs +8 -5
- package/dist/web.esm.js +8 -5
- package/dist/web.esm.min.js +1 -1
- package/dist/web.esm.min.js.map +1 -1
- package/dist/web.js +94 -62
- package/dist/web.min.cjs +1 -1
- package/dist/web.min.cjs.map +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/dist/web.module.js +94 -62
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +3 -3
package/dist/web.module.js
CHANGED
|
@@ -292,7 +292,7 @@ const FourNumberHelper = {
|
|
|
292
292
|
return to;
|
|
293
293
|
},
|
|
294
294
|
setTemp(top, right, bottom, left) {
|
|
295
|
-
return set$
|
|
295
|
+
return set$3(tempFour, top, right, bottom, left);
|
|
296
296
|
},
|
|
297
297
|
toTempAB(a, b, change) {
|
|
298
298
|
tempTo = change ? isNumber(a) ? b : a : [];
|
|
@@ -332,22 +332,22 @@ const FourNumberHelper = {
|
|
|
332
332
|
max(t, other, change) {
|
|
333
333
|
if (isNumber(t) && isNumber(other)) return max$4(t, other);
|
|
334
334
|
toTempAB(t, other, change);
|
|
335
|
-
return set$
|
|
335
|
+
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]));
|
|
336
336
|
},
|
|
337
337
|
add(t, other, change) {
|
|
338
338
|
if (isNumber(t) && isNumber(other)) return t + other;
|
|
339
339
|
toTempAB(t, other, change);
|
|
340
|
-
return set$
|
|
340
|
+
return set$3(tempTo, tempA[0] + tempB[0], tempA[1] + tempB[1], tempA[2] + tempB[2], tempA[3] + tempB[3]);
|
|
341
341
|
},
|
|
342
342
|
swapAndScale(t, scaleX, scaleY, change) {
|
|
343
343
|
if (isNumber(t)) return scaleX === scaleY ? t * scaleX : [ t * scaleY, t * scaleX ];
|
|
344
344
|
const to = change ? t : [];
|
|
345
345
|
const [top, right, bottom, left] = t.length === 4 ? t : get$5(t);
|
|
346
|
-
return set$
|
|
346
|
+
return set$3(to, bottom * scaleY, left * scaleX, top * scaleY, right * scaleX);
|
|
347
347
|
}
|
|
348
348
|
};
|
|
349
349
|
|
|
350
|
-
const {set: set$
|
|
350
|
+
const {set: set$3, get: get$5, setTemp: setTemp, toTempAB: toTempAB} = FourNumberHelper;
|
|
351
351
|
|
|
352
352
|
const {round: round$3, pow: pow$1, max: max$3, floor: floor$2, PI: PI$3} = Math;
|
|
353
353
|
|
|
@@ -472,7 +472,7 @@ const {sin: sin$5, cos: cos$5, acos: acos, sqrt: sqrt$3} = Math;
|
|
|
472
472
|
|
|
473
473
|
const {float: float$2} = MathHelper;
|
|
474
474
|
|
|
475
|
-
const tempPoint$
|
|
475
|
+
const tempPoint$4 = {};
|
|
476
476
|
|
|
477
477
|
function getWorld() {
|
|
478
478
|
return Object.assign(Object.assign(Object.assign({}, getMatrixData()), getBoundsData()), {
|
|
@@ -531,8 +531,8 @@ const MatrixHelper = {
|
|
|
531
531
|
to.f = t.f * pixelRatio;
|
|
532
532
|
},
|
|
533
533
|
scaleOfOuter(t, origin, scaleX, scaleY) {
|
|
534
|
-
M$6.toInnerPoint(t, origin, tempPoint$
|
|
535
|
-
M$6.scaleOfInner(t, tempPoint$
|
|
534
|
+
M$6.toInnerPoint(t, origin, tempPoint$4);
|
|
535
|
+
M$6.scaleOfInner(t, tempPoint$4, scaleX, scaleY);
|
|
536
536
|
},
|
|
537
537
|
scaleOfInner(t, origin, scaleX, scaleY = scaleX) {
|
|
538
538
|
M$6.translateInner(t, origin.x, origin.y);
|
|
@@ -550,8 +550,8 @@ const MatrixHelper = {
|
|
|
550
550
|
t.d = c * sinR + d * cosR;
|
|
551
551
|
},
|
|
552
552
|
rotateOfOuter(t, origin, rotation) {
|
|
553
|
-
M$6.toInnerPoint(t, origin, tempPoint$
|
|
554
|
-
M$6.rotateOfInner(t, tempPoint$
|
|
553
|
+
M$6.toInnerPoint(t, origin, tempPoint$4);
|
|
554
|
+
M$6.rotateOfInner(t, tempPoint$4, rotation);
|
|
555
555
|
},
|
|
556
556
|
rotateOfInner(t, origin, rotation) {
|
|
557
557
|
M$6.translateInner(t, origin.x, origin.y);
|
|
@@ -572,8 +572,8 @@ const MatrixHelper = {
|
|
|
572
572
|
}
|
|
573
573
|
},
|
|
574
574
|
skewOfOuter(t, origin, skewX, skewY) {
|
|
575
|
-
M$6.toInnerPoint(t, origin, tempPoint$
|
|
576
|
-
M$6.skewOfInner(t, tempPoint$
|
|
575
|
+
M$6.toInnerPoint(t, origin, tempPoint$4);
|
|
576
|
+
M$6.skewOfInner(t, tempPoint$4, skewX, skewY);
|
|
577
577
|
},
|
|
578
578
|
skewOfInner(t, origin, skewX, skewY = 0) {
|
|
579
579
|
M$6.translateInner(t, origin.x, origin.y);
|
|
@@ -774,7 +774,7 @@ const {float: float$1} = MathHelper;
|
|
|
774
774
|
|
|
775
775
|
const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
|
|
776
776
|
|
|
777
|
-
const {sin: sin$4, cos: cos$4, abs: abs$
|
|
777
|
+
const {sin: sin$4, cos: cos$4, abs: abs$5, sqrt: sqrt$2, atan2: atan2$2, min: min$1, round: round$2} = Math;
|
|
778
778
|
|
|
779
779
|
const PointHelper = {
|
|
780
780
|
defaultPoint: getPointData(),
|
|
@@ -811,15 +811,15 @@ const PointHelper = {
|
|
|
811
811
|
t.x += (t.x - origin.x) * (scaleX - 1);
|
|
812
812
|
t.y += (t.y - origin.y) * (scaleY - 1);
|
|
813
813
|
},
|
|
814
|
-
rotate(t, rotation, origin) {
|
|
814
|
+
rotate(t, rotation, origin, radiusX = 1, radiusY = 1) {
|
|
815
815
|
if (!origin) origin = P$5.defaultPoint;
|
|
816
816
|
rotation *= OneRadian;
|
|
817
817
|
const cosR = cos$4(rotation);
|
|
818
818
|
const sinR = sin$4(rotation);
|
|
819
|
-
const rx = t.x - origin.x;
|
|
820
|
-
const ry = t.y - origin.y;
|
|
821
|
-
t.x = origin.x + rx * cosR - ry * sinR;
|
|
822
|
-
t.y = origin.y + rx * sinR + ry * cosR;
|
|
819
|
+
const rx = (t.x - origin.x) / radiusX;
|
|
820
|
+
const ry = (t.y - origin.y) / radiusY;
|
|
821
|
+
t.x = origin.x + (rx * cosR - ry * sinR) * radiusX;
|
|
822
|
+
t.y = origin.y + (rx * sinR + ry * cosR) * radiusY;
|
|
823
823
|
},
|
|
824
824
|
tempToInnerOf(t, matrix) {
|
|
825
825
|
const {tempPoint: temp} = P$5;
|
|
@@ -872,15 +872,15 @@ const PointHelper = {
|
|
|
872
872
|
return getDistanceFrom(t.x, t.y, point.x, point.y);
|
|
873
873
|
},
|
|
874
874
|
getDistanceFrom(x1, y1, x2, y2) {
|
|
875
|
-
const x = abs$
|
|
876
|
-
const y = abs$
|
|
875
|
+
const x = abs$5(x2 - x1);
|
|
876
|
+
const y = abs$5(y2 - y1);
|
|
877
877
|
return sqrt$2(x * x + y * y);
|
|
878
878
|
},
|
|
879
879
|
getMinDistanceFrom(x1, y1, x2, y2, x3, y3) {
|
|
880
880
|
return min$1(getDistanceFrom(x1, y1, x2, y2), getDistanceFrom(x2, y2, x3, y3));
|
|
881
881
|
},
|
|
882
|
-
getAngle(t, to) {
|
|
883
|
-
return getAtan2(t, to) / OneRadian;
|
|
882
|
+
getAngle(t, to, radiusX, radiusY) {
|
|
883
|
+
return getAtan2(t, to, radiusX, radiusY) / OneRadian;
|
|
884
884
|
},
|
|
885
885
|
getRotation(t, origin, to, toOrigin) {
|
|
886
886
|
if (!toOrigin) toOrigin = origin;
|
|
@@ -894,8 +894,8 @@ const PointHelper = {
|
|
|
894
894
|
const d = toY - toOriginY;
|
|
895
895
|
return Math.atan2(a * d - b * c, a * c + b * d);
|
|
896
896
|
},
|
|
897
|
-
getAtan2(t, to) {
|
|
898
|
-
return atan2$2(to.y - t.y, to.x - t.x);
|
|
897
|
+
getAtan2(t, to, radiusX = 1, radiusY = 1) {
|
|
898
|
+
return atan2$2((to.y - t.y) / radiusY, (to.x - t.x) / radiusX);
|
|
899
899
|
},
|
|
900
900
|
getDistancePoint(t, to, distance, changeTo, fromTo) {
|
|
901
901
|
const r = getAtan2(t, to);
|
|
@@ -995,7 +995,7 @@ class Point {
|
|
|
995
995
|
}
|
|
996
996
|
}
|
|
997
997
|
|
|
998
|
-
const tempPoint$
|
|
998
|
+
const tempPoint$3 = new Point;
|
|
999
999
|
|
|
1000
1000
|
class Matrix {
|
|
1001
1001
|
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
|
},
|
|
@@ -3722,7 +3722,7 @@ const {arcTo: arcTo} = PathCommandDataHelper;
|
|
|
3722
3722
|
|
|
3723
3723
|
const PathCorner = {
|
|
3724
3724
|
smooth(data, cornerRadius, _cornerSmoothing) {
|
|
3725
|
-
let command, lastCommand, commandLen;
|
|
3725
|
+
let command, lastCommand, commandLen, startXIndex, startYIndex, smoothLen;
|
|
3726
3726
|
let i = 0, x = 0, y = 0, startX = 0, startY = 0, secondX = 0, secondY = 0, lastX = 0, lastY = 0;
|
|
3727
3727
|
if (isArray(cornerRadius)) cornerRadius = cornerRadius[0] || 0;
|
|
3728
3728
|
const len = data.length, three = len === 9;
|
|
@@ -3731,6 +3731,11 @@ const PathCorner = {
|
|
|
3731
3731
|
command = data[i];
|
|
3732
3732
|
switch (command) {
|
|
3733
3733
|
case M:
|
|
3734
|
+
smoothLen = smooth.length;
|
|
3735
|
+
if (smoothLen && lastCommand !== Z) {
|
|
3736
|
+
smooth[startXIndex] = startX;
|
|
3737
|
+
smooth[startYIndex] = startY;
|
|
3738
|
+
}
|
|
3734
3739
|
startX = lastX = data[i + 1];
|
|
3735
3740
|
startY = lastY = data[i + 2];
|
|
3736
3741
|
i += 3;
|
|
@@ -3741,6 +3746,8 @@ const PathCorner = {
|
|
|
3741
3746
|
} else {
|
|
3742
3747
|
smooth.push(M, startX, startY);
|
|
3743
3748
|
}
|
|
3749
|
+
startXIndex = smoothLen + 1;
|
|
3750
|
+
startYIndex = smoothLen + 2;
|
|
3744
3751
|
break;
|
|
3745
3752
|
|
|
3746
3753
|
case L$1:
|
|
@@ -3779,8 +3786,8 @@ const PathCorner = {
|
|
|
3779
3786
|
lastCommand = command;
|
|
3780
3787
|
}
|
|
3781
3788
|
if (command !== Z) {
|
|
3782
|
-
smooth[
|
|
3783
|
-
smooth[
|
|
3789
|
+
smooth[startXIndex] = startX;
|
|
3790
|
+
smooth[startYIndex] = startY;
|
|
3784
3791
|
}
|
|
3785
3792
|
return smooth;
|
|
3786
3793
|
}
|
|
@@ -6031,7 +6038,7 @@ const LeafDataProxy = {
|
|
|
6031
6038
|
|
|
6032
6039
|
const {setLayout: setLayout, multiplyParent: multiplyParent$2, translateInner: translateInner, defaultWorld: defaultWorld} = MatrixHelper;
|
|
6033
6040
|
|
|
6034
|
-
const {toPoint: toPoint$3, tempPoint: tempPoint} = AroundHelper;
|
|
6041
|
+
const {toPoint: toPoint$3, tempPoint: tempPoint$1} = AroundHelper;
|
|
6035
6042
|
|
|
6036
6043
|
const LeafMatrix = {
|
|
6037
6044
|
__updateWorldMatrix() {
|
|
@@ -6052,8 +6059,8 @@ const LeafMatrix = {
|
|
|
6052
6059
|
local.e = data.x + data.offsetX;
|
|
6053
6060
|
local.f = data.y + data.offsetY;
|
|
6054
6061
|
if (data.around || data.origin) {
|
|
6055
|
-
toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint);
|
|
6056
|
-
translateInner(local, -tempPoint.x, -tempPoint.y, !data.around);
|
|
6062
|
+
toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint$1);
|
|
6063
|
+
translateInner(local, -tempPoint$1.x, -tempPoint$1.y, !data.around);
|
|
6057
6064
|
}
|
|
6058
6065
|
}
|
|
6059
6066
|
this.__layout.matrixChanged = undefined;
|
|
@@ -6976,7 +6983,7 @@ class LeafLevelList {
|
|
|
6976
6983
|
}
|
|
6977
6984
|
}
|
|
6978
6985
|
|
|
6979
|
-
const version = "2.1.
|
|
6986
|
+
const version = "2.1.7";
|
|
6980
6987
|
|
|
6981
6988
|
const debug$4 = Debug.get("LeaferCanvas");
|
|
6982
6989
|
|
|
@@ -8536,6 +8543,7 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
8536
8543
|
this.set(keyframe);
|
|
8537
8544
|
return Plugin.need("animate");
|
|
8538
8545
|
}
|
|
8546
|
+
killAnimate(_type, _nextStyle) {}
|
|
8539
8547
|
export(_filename, _options) {
|
|
8540
8548
|
return Plugin.need("export");
|
|
8541
8549
|
}
|
|
@@ -9295,32 +9303,53 @@ __decorate([ affectRenderBoundsType("hide") ], Frame.prototype, "overflow", void
|
|
|
9295
9303
|
|
|
9296
9304
|
Frame = __decorate([ registerUI() ], Frame);
|
|
9297
9305
|
|
|
9298
|
-
const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse} = PathCommandDataHelper;
|
|
9306
|
+
const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse} = PathCommandDataHelper, {tempPoint: tempPoint, set: set$1, rotate: rotate$2} = PointHelper, {abs: abs$2} = Math, tempCenter = {};
|
|
9299
9307
|
|
|
9300
9308
|
let Ellipse = class Ellipse extends UI {
|
|
9301
9309
|
get __tag() {
|
|
9302
9310
|
return "Ellipse";
|
|
9303
9311
|
}
|
|
9304
9312
|
__updatePath() {
|
|
9305
|
-
const data = this.__, {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle} = data;
|
|
9313
|
+
const data = this.__, {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle, closed: closed} = data;
|
|
9306
9314
|
const rx = width / 2, ry = height / 2;
|
|
9307
9315
|
const path = data.path = [];
|
|
9308
|
-
let open;
|
|
9316
|
+
let open, hasAngle, closedAngle;
|
|
9317
|
+
if (startAngle || endAngle) hasAngle = true;
|
|
9318
|
+
if (hasAngle) closedAngle = abs$2(endAngle - startAngle) === 360;
|
|
9309
9319
|
if (innerRadius) {
|
|
9310
|
-
|
|
9311
|
-
|
|
9312
|
-
|
|
9320
|
+
const drawInnerEllipse = innerRadius < 1 || closed;
|
|
9321
|
+
let outerStartAngle = startAngle, outerEndAngle = endAngle, outerAnticlockwise;
|
|
9322
|
+
if (hasAngle) {
|
|
9323
|
+
if (drawInnerEllipse) {
|
|
9324
|
+
ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle);
|
|
9325
|
+
if (closedAngle) {
|
|
9326
|
+
set$1(tempPoint, width, ry);
|
|
9327
|
+
set$1(tempCenter, rx, ry);
|
|
9328
|
+
rotate$2(tempPoint, endAngle, tempCenter, rx, ry);
|
|
9329
|
+
moveTo$3(path, tempPoint.x, tempPoint.y);
|
|
9330
|
+
}
|
|
9331
|
+
outerStartAngle = endAngle;
|
|
9332
|
+
outerEndAngle = startAngle;
|
|
9333
|
+
outerAnticlockwise = true;
|
|
9334
|
+
} else {
|
|
9335
|
+
if (!closedAngle) open = true;
|
|
9336
|
+
}
|
|
9313
9337
|
} else {
|
|
9314
|
-
if (
|
|
9338
|
+
if (drawInnerEllipse) {
|
|
9315
9339
|
ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
|
|
9340
|
+
closePath$2(path);
|
|
9316
9341
|
moveTo$3(path, width, ry);
|
|
9342
|
+
outerStartAngle = 360;
|
|
9343
|
+
outerAnticlockwise = true;
|
|
9344
|
+
} else {
|
|
9345
|
+
outerEndAngle = 360;
|
|
9317
9346
|
}
|
|
9318
|
-
ellipse(path, rx, ry, rx, ry, 0, 360, 0, true);
|
|
9319
9347
|
}
|
|
9348
|
+
ellipse(path, rx, ry, rx, ry, 0, outerStartAngle, outerEndAngle, outerAnticlockwise);
|
|
9320
9349
|
} else {
|
|
9321
|
-
if (
|
|
9322
|
-
moveTo$3(path, rx, ry);
|
|
9323
|
-
ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle
|
|
9350
|
+
if (hasAngle) {
|
|
9351
|
+
if (!closedAngle) moveTo$3(path, rx, ry);
|
|
9352
|
+
ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle);
|
|
9324
9353
|
} else {
|
|
9325
9354
|
ellipse(path, rx, ry, rx, ry);
|
|
9326
9355
|
}
|
|
@@ -10187,6 +10216,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
|
|
|
10187
10216
|
if (data.__autoSide) {
|
|
10188
10217
|
ui.forceUpdate("width");
|
|
10189
10218
|
LeafHelper.updateBounds(ui);
|
|
10219
|
+
ui.__layout.boundsChanged = true;
|
|
10190
10220
|
if (ui.__proxyData) {
|
|
10191
10221
|
ui.setProxyAttr("width", data.width);
|
|
10192
10222
|
ui.setProxyAttr("height", data.height);
|
|
@@ -10194,7 +10224,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
|
|
|
10194
10224
|
needUpdate = false;
|
|
10195
10225
|
}
|
|
10196
10226
|
}
|
|
10197
|
-
if (paint.mode === "brush") PaintImage.brush(
|
|
10227
|
+
if (paint.mode === "brush") PaintImage.brush(ui, attrName, leafPaint);
|
|
10198
10228
|
if (!leafPaint.data) {
|
|
10199
10229
|
PaintImage.createData(leafPaint, image, paint, boxBounds);
|
|
10200
10230
|
const {transform: transform} = leafPaint.data, {opacity: opacity} = paint;
|
|
@@ -10289,8 +10319,9 @@ function getPatternData(paint, box, image) {
|
|
|
10289
10319
|
break;
|
|
10290
10320
|
|
|
10291
10321
|
case "repeat":
|
|
10292
|
-
case "brush":
|
|
10293
10322
|
if (!sameBox || scaleX || rotation || skew) PaintImage.repeatMode(data, box, width, height, tempImage.x, tempImage.y, scaleX, scaleY, rotation, skew, align, paint.freeTransform);
|
|
10323
|
+
|
|
10324
|
+
case "brush":
|
|
10294
10325
|
if (!repeat) data.repeat = "repeat";
|
|
10295
10326
|
const count = isObject(repeat);
|
|
10296
10327
|
if (gap || count) data.gap = getGapData(gap, count && repeat, tempImage.width, tempImage.height, box);
|
|
@@ -10301,7 +10332,7 @@ function getPatternData(paint, box, image) {
|
|
|
10301
10332
|
default:
|
|
10302
10333
|
if (scaleX) PaintImage.fillOrFitMode(data, box, tempImage.x, tempImage.y, scaleX, scaleY, rotation);
|
|
10303
10334
|
}
|
|
10304
|
-
if (!data.transform) {
|
|
10335
|
+
if (!data.transform && mode !== "brush") {
|
|
10305
10336
|
if (box.x || box.y) translate$1(data.transform = get$3(), box.x, box.y);
|
|
10306
10337
|
}
|
|
10307
10338
|
if (scaleX) {
|
|
@@ -10430,8 +10461,9 @@ function createPattern(paint, ui, canvas, renderOptions) {
|
|
|
10430
10461
|
let {scaleX: scaleX, scaleY: scaleY} = PaintImage.getImageRenderScaleData(paint, ui, canvas, renderOptions), id = paint.film ? paint.nowIndex : scaleX + "-" + scaleY;
|
|
10431
10462
|
if (paint.patternId !== id && !ui.destroyed) {
|
|
10432
10463
|
if (!(Platform.image.isLarge(paint.image, scaleX, scaleY) && !paint.data.repeat)) {
|
|
10433
|
-
const {image: image, brush: brush, data: data} = paint, {
|
|
10434
|
-
let imageMatrix, xGap, yGap, {width: width, height: height} = image;
|
|
10464
|
+
const {image: image, brush: brush, data: data} = paint, {transform: transform, gap: gap} = data, fixScale = PaintImage.getPatternFixScale(paint, scaleX, scaleY);
|
|
10465
|
+
let imageMatrix, xGap, yGap, {width: width, height: height} = image, {opacity: opacity} = paint.originPaint;
|
|
10466
|
+
if (brush || opacity === 1) opacity = undefined;
|
|
10435
10467
|
if (fixScale) scaleX *= fixScale, scaleY *= fixScale;
|
|
10436
10468
|
width *= scaleX;
|
|
10437
10469
|
height *= scaleY;
|
|
@@ -11458,4 +11490,4 @@ Object.assign(Effect, EffectModule);
|
|
|
11458
11490
|
|
|
11459
11491
|
useCanvas();
|
|
11460
11492
|
|
|
11461
|
-
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$1 as 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$
|
|
11493
|
+
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$1 as 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 };
|