leafer-ui 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 +96 -64
- 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 +96 -64
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +11 -11
package/dist/web.js
CHANGED
|
@@ -268,7 +268,7 @@ var LeaferUI = function(exports) {
|
|
|
268
268
|
return to;
|
|
269
269
|
},
|
|
270
270
|
setTemp(top, right, bottom, left) {
|
|
271
|
-
return set$
|
|
271
|
+
return set$3(tempFour, top, right, bottom, left);
|
|
272
272
|
},
|
|
273
273
|
toTempAB(a, b, change) {
|
|
274
274
|
tempTo = change ? isNumber(a) ? b : a : [];
|
|
@@ -308,21 +308,21 @@ var LeaferUI = function(exports) {
|
|
|
308
308
|
max(t, other, change) {
|
|
309
309
|
if (isNumber(t) && isNumber(other)) return max$5(t, other);
|
|
310
310
|
toTempAB(t, other, change);
|
|
311
|
-
return set$
|
|
311
|
+
return set$3(tempTo, max$5(tempA[0], tempB[0]), max$5(tempA[1], tempB[1]), max$5(tempA[2], tempB[2]), max$5(tempA[3], tempB[3]));
|
|
312
312
|
},
|
|
313
313
|
add(t, other, change) {
|
|
314
314
|
if (isNumber(t) && isNumber(other)) return t + other;
|
|
315
315
|
toTempAB(t, other, change);
|
|
316
|
-
return set$
|
|
316
|
+
return set$3(tempTo, tempA[0] + tempB[0], tempA[1] + tempB[1], tempA[2] + tempB[2], tempA[3] + tempB[3]);
|
|
317
317
|
},
|
|
318
318
|
swapAndScale(t, scaleX, scaleY, change) {
|
|
319
319
|
if (isNumber(t)) return scaleX === scaleY ? t * scaleX : [ t * scaleY, t * scaleX ];
|
|
320
320
|
const to = change ? t : [];
|
|
321
321
|
const [top, right, bottom, left] = t.length === 4 ? t : get$5(t);
|
|
322
|
-
return set$
|
|
322
|
+
return set$3(to, bottom * scaleY, left * scaleX, top * scaleY, right * scaleX);
|
|
323
323
|
}
|
|
324
324
|
};
|
|
325
|
-
const {set: set$
|
|
325
|
+
const {set: set$3, get: get$5, setTemp: setTemp, toTempAB: toTempAB} = FourNumberHelper;
|
|
326
326
|
const {round: round$3, pow: pow$1, max: max$4, floor: floor$2, PI: PI$3} = Math;
|
|
327
327
|
const tempScaleData$1 = {};
|
|
328
328
|
const MathHelper = {
|
|
@@ -434,7 +434,7 @@ var LeaferUI = function(exports) {
|
|
|
434
434
|
}
|
|
435
435
|
const {sin: sin$5, cos: cos$5, acos: acos, sqrt: sqrt$3} = Math;
|
|
436
436
|
const {float: float$3} = MathHelper;
|
|
437
|
-
const tempPoint$
|
|
437
|
+
const tempPoint$5 = {};
|
|
438
438
|
function getWorld() {
|
|
439
439
|
return Object.assign(Object.assign(Object.assign({}, getMatrixData()), getBoundsData()), {
|
|
440
440
|
scaleX: 1,
|
|
@@ -491,8 +491,8 @@ var LeaferUI = function(exports) {
|
|
|
491
491
|
to.f = t.f * pixelRatio;
|
|
492
492
|
},
|
|
493
493
|
scaleOfOuter(t, origin, scaleX, scaleY) {
|
|
494
|
-
M$6.toInnerPoint(t, origin, tempPoint$
|
|
495
|
-
M$6.scaleOfInner(t, tempPoint$
|
|
494
|
+
M$6.toInnerPoint(t, origin, tempPoint$5);
|
|
495
|
+
M$6.scaleOfInner(t, tempPoint$5, scaleX, scaleY);
|
|
496
496
|
},
|
|
497
497
|
scaleOfInner(t, origin, scaleX, scaleY = scaleX) {
|
|
498
498
|
M$6.translateInner(t, origin.x, origin.y);
|
|
@@ -510,8 +510,8 @@ var LeaferUI = function(exports) {
|
|
|
510
510
|
t.d = c * sinR + d * cosR;
|
|
511
511
|
},
|
|
512
512
|
rotateOfOuter(t, origin, rotation) {
|
|
513
|
-
M$6.toInnerPoint(t, origin, tempPoint$
|
|
514
|
-
M$6.rotateOfInner(t, tempPoint$
|
|
513
|
+
M$6.toInnerPoint(t, origin, tempPoint$5);
|
|
514
|
+
M$6.rotateOfInner(t, tempPoint$5, rotation);
|
|
515
515
|
},
|
|
516
516
|
rotateOfInner(t, origin, rotation) {
|
|
517
517
|
M$6.translateInner(t, origin.x, origin.y);
|
|
@@ -532,8 +532,8 @@ var LeaferUI = function(exports) {
|
|
|
532
532
|
}
|
|
533
533
|
},
|
|
534
534
|
skewOfOuter(t, origin, skewX, skewY) {
|
|
535
|
-
M$6.toInnerPoint(t, origin, tempPoint$
|
|
536
|
-
M$6.skewOfInner(t, tempPoint$
|
|
535
|
+
M$6.toInnerPoint(t, origin, tempPoint$5);
|
|
536
|
+
M$6.skewOfInner(t, tempPoint$5, skewX, skewY);
|
|
537
537
|
},
|
|
538
538
|
skewOfInner(t, origin, skewX, skewY = 0) {
|
|
539
539
|
M$6.translateInner(t, origin.x, origin.y);
|
|
@@ -730,7 +730,7 @@ var LeaferUI = function(exports) {
|
|
|
730
730
|
const M$6 = MatrixHelper;
|
|
731
731
|
const {float: float$2} = MathHelper;
|
|
732
732
|
const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
|
|
733
|
-
const {sin: sin$4, cos: cos$4, abs: abs$
|
|
733
|
+
const {sin: sin$4, cos: cos$4, abs: abs$6, sqrt: sqrt$2, atan2: atan2$2, min: min$2, round: round$2} = Math;
|
|
734
734
|
const PointHelper = {
|
|
735
735
|
defaultPoint: getPointData(),
|
|
736
736
|
tempPoint: {},
|
|
@@ -766,15 +766,15 @@ var LeaferUI = function(exports) {
|
|
|
766
766
|
t.x += (t.x - origin.x) * (scaleX - 1);
|
|
767
767
|
t.y += (t.y - origin.y) * (scaleY - 1);
|
|
768
768
|
},
|
|
769
|
-
rotate(t, rotation, origin) {
|
|
769
|
+
rotate(t, rotation, origin, radiusX = 1, radiusY = 1) {
|
|
770
770
|
if (!origin) origin = P$5.defaultPoint;
|
|
771
771
|
rotation *= OneRadian;
|
|
772
772
|
const cosR = cos$4(rotation);
|
|
773
773
|
const sinR = sin$4(rotation);
|
|
774
|
-
const rx = t.x - origin.x;
|
|
775
|
-
const ry = t.y - origin.y;
|
|
776
|
-
t.x = origin.x + rx * cosR - ry * sinR;
|
|
777
|
-
t.y = origin.y + rx * sinR + ry * cosR;
|
|
774
|
+
const rx = (t.x - origin.x) / radiusX;
|
|
775
|
+
const ry = (t.y - origin.y) / radiusY;
|
|
776
|
+
t.x = origin.x + (rx * cosR - ry * sinR) * radiusX;
|
|
777
|
+
t.y = origin.y + (rx * sinR + ry * cosR) * radiusY;
|
|
778
778
|
},
|
|
779
779
|
tempToInnerOf(t, matrix) {
|
|
780
780
|
const {tempPoint: temp} = P$5;
|
|
@@ -827,15 +827,15 @@ var LeaferUI = function(exports) {
|
|
|
827
827
|
return getDistanceFrom(t.x, t.y, point.x, point.y);
|
|
828
828
|
},
|
|
829
829
|
getDistanceFrom(x1, y1, x2, y2) {
|
|
830
|
-
const x = abs$
|
|
831
|
-
const y = abs$
|
|
830
|
+
const x = abs$6(x2 - x1);
|
|
831
|
+
const y = abs$6(y2 - y1);
|
|
832
832
|
return sqrt$2(x * x + y * y);
|
|
833
833
|
},
|
|
834
834
|
getMinDistanceFrom(x1, y1, x2, y2, x3, y3) {
|
|
835
835
|
return min$2(getDistanceFrom(x1, y1, x2, y2), getDistanceFrom(x2, y2, x3, y3));
|
|
836
836
|
},
|
|
837
|
-
getAngle(t, to) {
|
|
838
|
-
return getAtan2(t, to) / OneRadian;
|
|
837
|
+
getAngle(t, to, radiusX, radiusY) {
|
|
838
|
+
return getAtan2(t, to, radiusX, radiusY) / OneRadian;
|
|
839
839
|
},
|
|
840
840
|
getRotation(t, origin, to, toOrigin) {
|
|
841
841
|
if (!toOrigin) toOrigin = origin;
|
|
@@ -849,8 +849,8 @@ var LeaferUI = function(exports) {
|
|
|
849
849
|
const d = toY - toOriginY;
|
|
850
850
|
return Math.atan2(a * d - b * c, a * c + b * d);
|
|
851
851
|
},
|
|
852
|
-
getAtan2(t, to) {
|
|
853
|
-
return atan2$2(to.y - t.y, to.x - t.x);
|
|
852
|
+
getAtan2(t, to, radiusX = 1, radiusY = 1) {
|
|
853
|
+
return atan2$2((to.y - t.y) / radiusY, (to.x - t.x) / radiusX);
|
|
854
854
|
},
|
|
855
855
|
getDistancePoint(t, to, distance, changeTo, fromTo) {
|
|
856
856
|
const r = getAtan2(t, to);
|
|
@@ -946,7 +946,7 @@ var LeaferUI = function(exports) {
|
|
|
946
946
|
return this;
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
|
-
const tempPoint$
|
|
949
|
+
const tempPoint$4 = new Point;
|
|
950
950
|
class Matrix {
|
|
951
951
|
constructor(a, b, c, d, e, f) {
|
|
952
952
|
this.set(a, b, c, d, e, f);
|
|
@@ -2520,11 +2520,11 @@ var LeaferUI = function(exports) {
|
|
|
2520
2520
|
data[0] ? drawer.arcTo(x, y, right, y, data[0]) : drawer.lineTo(x, y);
|
|
2521
2521
|
}
|
|
2522
2522
|
};
|
|
2523
|
-
const {sin: sin$3, cos: cos$3, hypot: hypot, atan2: atan2$1, ceil: ceil, abs: abs$
|
|
2523
|
+
const {sin: sin$3, cos: cos$3, hypot: hypot, atan2: atan2$1, ceil: ceil, abs: abs$5, PI: PI$2, sqrt: sqrt$1, pow: pow} = Math;
|
|
2524
2524
|
const {setPoint: setPoint$1, addPoint: addPoint$1} = TwoPointBoundsHelper;
|
|
2525
|
-
const {set: set$
|
|
2525
|
+
const {set: set$2, toNumberPoints: toNumberPoints} = PointHelper;
|
|
2526
2526
|
const {M: M$5, L: L$6, C: C$4, Q: Q$4, Z: Z$5} = PathCommandMap;
|
|
2527
|
-
const tempPoint$
|
|
2527
|
+
const tempPoint$3 = {};
|
|
2528
2528
|
const BezierHelper = {
|
|
2529
2529
|
points(data, originPoints, curve, close) {
|
|
2530
2530
|
let points = toNumberPoints(originPoints);
|
|
@@ -2592,14 +2592,14 @@ var LeaferUI = function(exports) {
|
|
|
2592
2592
|
const lenCB = hypot(CBx, CBy);
|
|
2593
2593
|
let totalRadian = endRadian - startRadian;
|
|
2594
2594
|
if (totalRadian < 0) totalRadian += PI2;
|
|
2595
|
-
if (lenBA < 1e-12 || lenCB < 1e-12 || totalRadian < 1e-12 || abs$
|
|
2595
|
+
if (lenBA < 1e-12 || lenCB < 1e-12 || totalRadian < 1e-12 || abs$5(totalRadian - PI$2) < 1e-12) {
|
|
2596
2596
|
if (data) data.push(L$6, x1, y1);
|
|
2597
2597
|
if (setPointBounds) {
|
|
2598
2598
|
setPoint$1(setPointBounds, fromX, fromY);
|
|
2599
2599
|
addPoint$1(setPointBounds, x1, y1);
|
|
2600
2600
|
}
|
|
2601
|
-
if (setStartPoint) set$
|
|
2602
|
-
if (setEndPoint) set$
|
|
2601
|
+
if (setStartPoint) set$2(setStartPoint, fromX, fromY);
|
|
2602
|
+
if (setEndPoint) set$2(setEndPoint, x1, y1);
|
|
2603
2603
|
return;
|
|
2604
2604
|
}
|
|
2605
2605
|
const anticlockwise = BAx * CBy - CBx * BAy < 0;
|
|
@@ -2625,7 +2625,7 @@ var LeaferUI = function(exports) {
|
|
|
2625
2625
|
let totalRadian = endRadian - startRadian;
|
|
2626
2626
|
if (totalRadian < 0) totalRadian += PI2; else if (totalRadian > PI2) totalRadian -= PI2;
|
|
2627
2627
|
if (anticlockwise) totalRadian -= PI2;
|
|
2628
|
-
const parts = ceil(abs$
|
|
2628
|
+
const parts = ceil(abs$5(totalRadian / PI_2));
|
|
2629
2629
|
const partRadian = totalRadian / parts;
|
|
2630
2630
|
const partRadian4Sin = sin$3(partRadian / 4);
|
|
2631
2631
|
const control = 8 / 3 * partRadian4Sin * partRadian4Sin / sin$3(partRadian / 2);
|
|
@@ -2639,7 +2639,7 @@ var LeaferUI = function(exports) {
|
|
|
2639
2639
|
let fromX = cx + x, fromY = cy + y;
|
|
2640
2640
|
if (data) data.push(data.length ? L$6 : M$5, fromX, fromY);
|
|
2641
2641
|
if (setPointBounds) setPoint$1(setPointBounds, fromX, fromY);
|
|
2642
|
-
if (setStartPoint) set$
|
|
2642
|
+
if (setStartPoint) set$2(setStartPoint, fromX, fromY);
|
|
2643
2643
|
for (let i = 0; i < parts; i++) {
|
|
2644
2644
|
endCos = cos$3(endRadian);
|
|
2645
2645
|
endSin = sin$3(endRadian);
|
|
@@ -2658,7 +2658,7 @@ var LeaferUI = function(exports) {
|
|
|
2658
2658
|
startRadian = endRadian;
|
|
2659
2659
|
endRadian += partRadian;
|
|
2660
2660
|
}
|
|
2661
|
-
if (setEndPoint) set$
|
|
2661
|
+
if (setEndPoint) set$2(setEndPoint, cx + x, cy + y);
|
|
2662
2662
|
},
|
|
2663
2663
|
quadraticCurveTo(data, fromX, fromY, x1, y1, toX, toY) {
|
|
2664
2664
|
data.push(C$4, (fromX + 2 * x1) / 3, (fromY + 2 * y1) / 3, (toX + 2 * x1) / 3, (toY + 2 * y1) / 3, toX, toY);
|
|
@@ -2694,8 +2694,8 @@ var LeaferUI = function(exports) {
|
|
|
2694
2694
|
addMode ? addPoint$1(pointBounds, fromX, fromY) : setPoint$1(pointBounds, fromX, fromY);
|
|
2695
2695
|
addPoint$1(pointBounds, toX, toY);
|
|
2696
2696
|
for (let i = 0, len = tList.length; i < len; i++) {
|
|
2697
|
-
getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$
|
|
2698
|
-
addPoint$1(pointBounds, tempPoint$
|
|
2697
|
+
getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$3);
|
|
2698
|
+
addPoint$1(pointBounds, tempPoint$3.x, tempPoint$3.y);
|
|
2699
2699
|
}
|
|
2700
2700
|
},
|
|
2701
2701
|
getPointAndSet(t, fromX, fromY, x1, y1, x2, y2, toX, toY, setPoint) {
|
|
@@ -3119,7 +3119,7 @@ var LeaferUI = function(exports) {
|
|
|
3119
3119
|
const {current: current, pushData: pushData, copyData: copyData} = PathConvert;
|
|
3120
3120
|
const {M: M$3, L: L$4, C: C$2, Q: Q$2, Z: Z$3, N: N$2, D: D$3, X: X$2, G: G$2, F: F$3, O: O$2, P: P$2, U: U$2} = PathCommandMap;
|
|
3121
3121
|
const {getMinDistanceFrom: getMinDistanceFrom, getRadianFrom: getRadianFrom} = PointHelper;
|
|
3122
|
-
const {tan: tan, min: min$1, abs: abs$
|
|
3122
|
+
const {tan: tan, min: min$1, abs: abs$4} = Math;
|
|
3123
3123
|
const startPoint = {};
|
|
3124
3124
|
const PathCommandDataHelper = {
|
|
3125
3125
|
beginPath(data) {
|
|
@@ -3177,7 +3177,7 @@ var LeaferUI = function(exports) {
|
|
|
3177
3177
|
arcTo(data, x1, y1, x2, y2, radius, lastX, lastY, fullRadius) {
|
|
3178
3178
|
if (!isUndefined(lastX)) {
|
|
3179
3179
|
const r = getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2) / (fullRadius ? 1 : 2);
|
|
3180
|
-
radius = min$1(radius, min$1(r, r * abs$
|
|
3180
|
+
radius = min$1(radius, min$1(r, r * abs$4(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
|
|
3181
3181
|
}
|
|
3182
3182
|
data.push(U$2, x1, y1, x2, y2, radius);
|
|
3183
3183
|
},
|
|
@@ -3499,7 +3499,7 @@ var LeaferUI = function(exports) {
|
|
|
3499
3499
|
const {arcTo: arcTo} = PathCommandDataHelper;
|
|
3500
3500
|
const PathCorner = {
|
|
3501
3501
|
smooth(data, cornerRadius, _cornerSmoothing) {
|
|
3502
|
-
let command, lastCommand, commandLen;
|
|
3502
|
+
let command, lastCommand, commandLen, startXIndex, startYIndex, smoothLen;
|
|
3503
3503
|
let i = 0, x = 0, y = 0, startX = 0, startY = 0, secondX = 0, secondY = 0, lastX = 0, lastY = 0;
|
|
3504
3504
|
if (isArray(cornerRadius)) cornerRadius = cornerRadius[0] || 0;
|
|
3505
3505
|
const len = data.length, three = len === 9;
|
|
@@ -3508,6 +3508,11 @@ var LeaferUI = function(exports) {
|
|
|
3508
3508
|
command = data[i];
|
|
3509
3509
|
switch (command) {
|
|
3510
3510
|
case M:
|
|
3511
|
+
smoothLen = smooth.length;
|
|
3512
|
+
if (smoothLen && lastCommand !== Z) {
|
|
3513
|
+
smooth[startXIndex] = startX;
|
|
3514
|
+
smooth[startYIndex] = startY;
|
|
3515
|
+
}
|
|
3511
3516
|
startX = lastX = data[i + 1];
|
|
3512
3517
|
startY = lastY = data[i + 2];
|
|
3513
3518
|
i += 3;
|
|
@@ -3518,6 +3523,8 @@ var LeaferUI = function(exports) {
|
|
|
3518
3523
|
} else {
|
|
3519
3524
|
smooth.push(M, startX, startY);
|
|
3520
3525
|
}
|
|
3526
|
+
startXIndex = smoothLen + 1;
|
|
3527
|
+
startYIndex = smoothLen + 2;
|
|
3521
3528
|
break;
|
|
3522
3529
|
|
|
3523
3530
|
case L$1:
|
|
@@ -3556,8 +3563,8 @@ var LeaferUI = function(exports) {
|
|
|
3556
3563
|
lastCommand = command;
|
|
3557
3564
|
}
|
|
3558
3565
|
if (command !== Z) {
|
|
3559
|
-
smooth[
|
|
3560
|
-
smooth[
|
|
3566
|
+
smooth[startXIndex] = startX;
|
|
3567
|
+
smooth[startYIndex] = startY;
|
|
3561
3568
|
}
|
|
3562
3569
|
return smooth;
|
|
3563
3570
|
}
|
|
@@ -5642,7 +5649,7 @@ var LeaferUI = function(exports) {
|
|
|
5642
5649
|
}
|
|
5643
5650
|
};
|
|
5644
5651
|
const {setLayout: setLayout, multiplyParent: multiplyParent$2, translateInner: translateInner, defaultWorld: defaultWorld} = MatrixHelper;
|
|
5645
|
-
const {toPoint: toPoint$3, tempPoint: tempPoint$
|
|
5652
|
+
const {toPoint: toPoint$3, tempPoint: tempPoint$2} = AroundHelper;
|
|
5646
5653
|
const LeafMatrix = {
|
|
5647
5654
|
__updateWorldMatrix() {
|
|
5648
5655
|
const {parent: parent, __layout: __layout, __world: __world, __scrollWorld: __scrollWorld, __: __} = this;
|
|
@@ -5662,8 +5669,8 @@ var LeaferUI = function(exports) {
|
|
|
5662
5669
|
local.e = data.x + data.offsetX;
|
|
5663
5670
|
local.f = data.y + data.offsetY;
|
|
5664
5671
|
if (data.around || data.origin) {
|
|
5665
|
-
toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint$
|
|
5666
|
-
translateInner(local, -tempPoint$
|
|
5672
|
+
toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint$2);
|
|
5673
|
+
translateInner(local, -tempPoint$2.x, -tempPoint$2.y, !data.around);
|
|
5667
5674
|
}
|
|
5668
5675
|
}
|
|
5669
5676
|
this.__layout.matrixChanged = undefined;
|
|
@@ -6560,7 +6567,7 @@ var LeaferUI = function(exports) {
|
|
|
6560
6567
|
this.levelMap = null;
|
|
6561
6568
|
}
|
|
6562
6569
|
}
|
|
6563
|
-
const version = "2.1.
|
|
6570
|
+
const version = "2.1.7";
|
|
6564
6571
|
const debug$5 = Debug.get("LeaferCanvas");
|
|
6565
6572
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6566
6573
|
set zIndex(zIndex) {
|
|
@@ -7383,7 +7390,7 @@ var LeaferUI = function(exports) {
|
|
|
7383
7390
|
}
|
|
7384
7391
|
}
|
|
7385
7392
|
Renderer.clipSpread = 10;
|
|
7386
|
-
const tempPoint = {};
|
|
7393
|
+
const tempPoint$1 = {};
|
|
7387
7394
|
const {copyRadiusPoint: copyRadiusPoint$1} = PointHelper;
|
|
7388
7395
|
const {hitRadiusPoint: hitRadiusPoint$1} = BoundsHelper;
|
|
7389
7396
|
class Picker {
|
|
@@ -7515,7 +7522,7 @@ var LeaferUI = function(exports) {
|
|
|
7515
7522
|
for (let i = len - 1; i > -1; i--) {
|
|
7516
7523
|
child = children[i], data = child.__;
|
|
7517
7524
|
if (!data.visible || hitMask && !data.mask) continue;
|
|
7518
|
-
hit = hitRadiusPoint$1(child.__world, data.hitRadius ? copyRadiusPoint$1(tempPoint, point, data.hitRadius) : point);
|
|
7525
|
+
hit = hitRadiusPoint$1(child.__world, data.hitRadius ? copyRadiusPoint$1(tempPoint$1, point, data.hitRadius) : point);
|
|
7519
7526
|
if (child.isBranch) {
|
|
7520
7527
|
if (hit || child.__ignoreHitWorld) {
|
|
7521
7528
|
if (child.isBranchLeaf && data.__clipAfterFill && !child.__hitWorld(point, true)) continue;
|
|
@@ -8239,6 +8246,7 @@ var LeaferUI = function(exports) {
|
|
|
8239
8246
|
this.set(keyframe);
|
|
8240
8247
|
return Plugin.need("animate");
|
|
8241
8248
|
}
|
|
8249
|
+
killAnimate(_type, _nextStyle) {}
|
|
8242
8250
|
export(_filename, _options) {
|
|
8243
8251
|
return Plugin.need("export");
|
|
8244
8252
|
}
|
|
@@ -8886,31 +8894,52 @@ var LeaferUI = function(exports) {
|
|
|
8886
8894
|
__decorate([ surfaceType("#FFFFFF") ], exports.Frame.prototype, "fill", void 0);
|
|
8887
8895
|
__decorate([ affectRenderBoundsType("hide") ], exports.Frame.prototype, "overflow", void 0);
|
|
8888
8896
|
exports.Frame = __decorate([ registerUI() ], exports.Frame);
|
|
8889
|
-
const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse} = PathCommandDataHelper;
|
|
8897
|
+
const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse} = PathCommandDataHelper, {tempPoint: tempPoint, set: set$1, rotate: rotate$2} = PointHelper, {abs: abs$3} = Math, tempCenter = {};
|
|
8890
8898
|
exports.Ellipse = class Ellipse extends exports.UI {
|
|
8891
8899
|
get __tag() {
|
|
8892
8900
|
return "Ellipse";
|
|
8893
8901
|
}
|
|
8894
8902
|
__updatePath() {
|
|
8895
|
-
const data = this.__, {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle} = data;
|
|
8903
|
+
const data = this.__, {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle, closed: closed} = data;
|
|
8896
8904
|
const rx = width / 2, ry = height / 2;
|
|
8897
8905
|
const path = data.path = [];
|
|
8898
|
-
let open;
|
|
8906
|
+
let open, hasAngle, closedAngle;
|
|
8907
|
+
if (startAngle || endAngle) hasAngle = true;
|
|
8908
|
+
if (hasAngle) closedAngle = abs$3(endAngle - startAngle) === 360;
|
|
8899
8909
|
if (innerRadius) {
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8910
|
+
const drawInnerEllipse = innerRadius < 1 || closed;
|
|
8911
|
+
let outerStartAngle = startAngle, outerEndAngle = endAngle, outerAnticlockwise;
|
|
8912
|
+
if (hasAngle) {
|
|
8913
|
+
if (drawInnerEllipse) {
|
|
8914
|
+
ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle);
|
|
8915
|
+
if (closedAngle) {
|
|
8916
|
+
set$1(tempPoint, width, ry);
|
|
8917
|
+
set$1(tempCenter, rx, ry);
|
|
8918
|
+
rotate$2(tempPoint, endAngle, tempCenter, rx, ry);
|
|
8919
|
+
moveTo$3(path, tempPoint.x, tempPoint.y);
|
|
8920
|
+
}
|
|
8921
|
+
outerStartAngle = endAngle;
|
|
8922
|
+
outerEndAngle = startAngle;
|
|
8923
|
+
outerAnticlockwise = true;
|
|
8924
|
+
} else {
|
|
8925
|
+
if (!closedAngle) open = true;
|
|
8926
|
+
}
|
|
8903
8927
|
} else {
|
|
8904
|
-
if (
|
|
8928
|
+
if (drawInnerEllipse) {
|
|
8905
8929
|
ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
|
|
8930
|
+
closePath$2(path);
|
|
8906
8931
|
moveTo$3(path, width, ry);
|
|
8932
|
+
outerStartAngle = 360;
|
|
8933
|
+
outerAnticlockwise = true;
|
|
8934
|
+
} else {
|
|
8935
|
+
outerEndAngle = 360;
|
|
8907
8936
|
}
|
|
8908
|
-
ellipse(path, rx, ry, rx, ry, 0, 360, 0, true);
|
|
8909
8937
|
}
|
|
8938
|
+
ellipse(path, rx, ry, rx, ry, 0, outerStartAngle, outerEndAngle, outerAnticlockwise);
|
|
8910
8939
|
} else {
|
|
8911
|
-
if (
|
|
8912
|
-
moveTo$3(path, rx, ry);
|
|
8913
|
-
ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle
|
|
8940
|
+
if (hasAngle) {
|
|
8941
|
+
if (!closedAngle) moveTo$3(path, rx, ry);
|
|
8942
|
+
ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle);
|
|
8914
8943
|
} else {
|
|
8915
8944
|
ellipse(path, rx, ry, rx, ry);
|
|
8916
8945
|
}
|
|
@@ -11385,6 +11414,7 @@ var LeaferUI = function(exports) {
|
|
|
11385
11414
|
if (data.__autoSide) {
|
|
11386
11415
|
ui.forceUpdate("width");
|
|
11387
11416
|
LeafHelper.updateBounds(ui);
|
|
11417
|
+
ui.__layout.boundsChanged = true;
|
|
11388
11418
|
if (ui.__proxyData) {
|
|
11389
11419
|
ui.setProxyAttr("width", data.width);
|
|
11390
11420
|
ui.setProxyAttr("height", data.height);
|
|
@@ -11392,7 +11422,7 @@ var LeaferUI = function(exports) {
|
|
|
11392
11422
|
needUpdate = false;
|
|
11393
11423
|
}
|
|
11394
11424
|
}
|
|
11395
|
-
if (paint.mode === "brush") PaintImage.brush(
|
|
11425
|
+
if (paint.mode === "brush") PaintImage.brush(ui, attrName, leafPaint);
|
|
11396
11426
|
if (!leafPaint.data) {
|
|
11397
11427
|
PaintImage.createData(leafPaint, image, paint, boxBounds);
|
|
11398
11428
|
const {transform: transform} = leafPaint.data, {opacity: opacity} = paint;
|
|
@@ -11476,8 +11506,9 @@ var LeaferUI = function(exports) {
|
|
|
11476
11506
|
break;
|
|
11477
11507
|
|
|
11478
11508
|
case "repeat":
|
|
11479
|
-
case "brush":
|
|
11480
11509
|
if (!sameBox || scaleX || rotation || skew) PaintImage.repeatMode(data, box, width, height, tempImage.x, tempImage.y, scaleX, scaleY, rotation, skew, align, paint.freeTransform);
|
|
11510
|
+
|
|
11511
|
+
case "brush":
|
|
11481
11512
|
if (!repeat) data.repeat = "repeat";
|
|
11482
11513
|
const count = isObject(repeat);
|
|
11483
11514
|
if (gap || count) data.gap = getGapData(gap, count && repeat, tempImage.width, tempImage.height, box);
|
|
@@ -11488,7 +11519,7 @@ var LeaferUI = function(exports) {
|
|
|
11488
11519
|
default:
|
|
11489
11520
|
if (scaleX) PaintImage.fillOrFitMode(data, box, tempImage.x, tempImage.y, scaleX, scaleY, rotation);
|
|
11490
11521
|
}
|
|
11491
|
-
if (!data.transform) {
|
|
11522
|
+
if (!data.transform && mode !== "brush") {
|
|
11492
11523
|
if (box.x || box.y) translate$1(data.transform = get$3(), box.x, box.y);
|
|
11493
11524
|
}
|
|
11494
11525
|
if (scaleX) {
|
|
@@ -11604,8 +11635,9 @@ var LeaferUI = function(exports) {
|
|
|
11604
11635
|
let {scaleX: scaleX, scaleY: scaleY} = PaintImage.getImageRenderScaleData(paint, ui, canvas, renderOptions), id = paint.film ? paint.nowIndex : scaleX + "-" + scaleY;
|
|
11605
11636
|
if (paint.patternId !== id && !ui.destroyed) {
|
|
11606
11637
|
if (!(Platform.image.isLarge(paint.image, scaleX, scaleY) && !paint.data.repeat)) {
|
|
11607
|
-
const {image: image, brush: brush, data: data} = paint, {
|
|
11608
|
-
let imageMatrix, xGap, yGap, {width: width, height: height} = image;
|
|
11638
|
+
const {image: image, brush: brush, data: data} = paint, {transform: transform, gap: gap} = data, fixScale = PaintImage.getPatternFixScale(paint, scaleX, scaleY);
|
|
11639
|
+
let imageMatrix, xGap, yGap, {width: width, height: height} = image, {opacity: opacity} = paint.originPaint;
|
|
11640
|
+
if (brush || opacity === 1) opacity = undefined;
|
|
11609
11641
|
if (fixScale) scaleX *= fixScale, scaleY *= fixScale;
|
|
11610
11642
|
width *= scaleX;
|
|
11611
11643
|
height *= scaleY;
|
|
@@ -12718,7 +12750,7 @@ var LeaferUI = function(exports) {
|
|
|
12718
12750
|
exports.surfaceType = surfaceType;
|
|
12719
12751
|
exports.tempBounds = tempBounds$2;
|
|
12720
12752
|
exports.tempMatrix = tempMatrix$2;
|
|
12721
|
-
exports.tempPoint = tempPoint$
|
|
12753
|
+
exports.tempPoint = tempPoint$4;
|
|
12722
12754
|
exports.tryToNumber = tryToNumber;
|
|
12723
12755
|
exports.useCanvas = useCanvas;
|
|
12724
12756
|
exports.useModule = useModule;
|