@leafer-ui/miniapp 2.2.3 → 2.2.5
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 -4
- package/dist/miniapp.esm.js +23 -16
- 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 +27 -20
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +10 -10
package/dist/miniapp.module.js
CHANGED
|
@@ -2816,7 +2816,10 @@ const BezierHelper = {
|
|
|
2816
2816
|
if (endRadian < 0) endRadian += PI2;
|
|
2817
2817
|
let totalRadian = endRadian - startRadian;
|
|
2818
2818
|
if (totalRadian < 0) totalRadian += PI2; else if (totalRadian > PI2) totalRadian -= PI2;
|
|
2819
|
-
if (anticlockwise)
|
|
2819
|
+
if (anticlockwise) {
|
|
2820
|
+
const closedAngle = abs$5(endAngle - startAngle) === 360;
|
|
2821
|
+
if (closedAngle) totalRadian = -PI2; else totalRadian -= PI2;
|
|
2822
|
+
}
|
|
2820
2823
|
const parts = ceil(abs$5(totalRadian / PI_2));
|
|
2821
2824
|
const partRadian = totalRadian / parts;
|
|
2822
2825
|
const partRadian4Sin = sin$3(partRadian / 4);
|
|
@@ -4770,7 +4773,7 @@ function useModule(module, exclude) {
|
|
|
4770
4773
|
if (!excludeNames.includes(name) && (!exclude || !exclude.includes(name))) {
|
|
4771
4774
|
if (module.prototype) {
|
|
4772
4775
|
const d = getDescriptor(module.prototype, name);
|
|
4773
|
-
if (d
|
|
4776
|
+
if (d) Object.defineProperty(target.prototype, name, d);
|
|
4774
4777
|
} else {
|
|
4775
4778
|
target.prototype[name] = module[name];
|
|
4776
4779
|
}
|
|
@@ -6802,11 +6805,11 @@ let Branch = class Branch extends Leaf {
|
|
|
6802
6805
|
childLayout.boxChanged || childLayout.boxChange();
|
|
6803
6806
|
childLayout.matrixChanged || childLayout.matrixChange();
|
|
6804
6807
|
if (child.__bubbleMap) child.__emitLifeEvent(ChildEvent.ADD);
|
|
6808
|
+
if (this.isFrame) child.__bindFrame(this);
|
|
6805
6809
|
if (this.leafer) {
|
|
6806
6810
|
child.__bindLeafer(this.leafer);
|
|
6807
6811
|
if (this.leafer.created) this.__emitChildEvent(ChildEvent.ADD, child);
|
|
6808
6812
|
}
|
|
6809
|
-
if (this.isFrame) child.__bindFrame(this);
|
|
6810
6813
|
this.__layout.affectChildrenSort && this.__layout.childrenSortChange();
|
|
6811
6814
|
}
|
|
6812
6815
|
addMany(...children) {
|
|
@@ -7020,7 +7023,7 @@ class LeafLevelList {
|
|
|
7020
7023
|
}
|
|
7021
7024
|
}
|
|
7022
7025
|
|
|
7023
|
-
const version = "2.2.
|
|
7026
|
+
const version = "2.2.5";
|
|
7024
7027
|
|
|
7025
7028
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
7026
7029
|
get allowBackgroundColor() {
|
|
@@ -7992,7 +7995,7 @@ class Picker {
|
|
|
7992
7995
|
if (child.__hitWorld(point, onlyHitMask && child.mask === "path" ? true : undefined)) {
|
|
7993
7996
|
const {parent: parent, mask: mask} = child;
|
|
7994
7997
|
if (parent && parent.__hasMask && mask && !(mask === "clipping" || mask === "clipping-path")) {
|
|
7995
|
-
if (!parent.children.some(item => !item.mask &&
|
|
7998
|
+
if (!parent.children.some(item => !item.mask && this.isHitLeaf(item, point))) return;
|
|
7996
7999
|
}
|
|
7997
8000
|
const leaf = proxy || child, {hitThrough: hitThrough} = child, {findList: findList} = this;
|
|
7998
8001
|
if (hitThrough) {
|
|
@@ -8002,6 +8005,15 @@ class Picker {
|
|
|
8002
8005
|
findList.add(leaf);
|
|
8003
8006
|
}
|
|
8004
8007
|
}
|
|
8008
|
+
isHitLeaf(leaf, point) {
|
|
8009
|
+
if (leaf.isBranch) {
|
|
8010
|
+
const {findList: findList} = this, old = findList.length;
|
|
8011
|
+
this.eachFind([ leaf ], false);
|
|
8012
|
+
const count = findList.length - old;
|
|
8013
|
+
for (let i = 0; i < count; i++) findList.remove(findList.indexAt(findList.length - 1));
|
|
8014
|
+
return !!count;
|
|
8015
|
+
} else return leaf.__hitWorld(point);
|
|
8016
|
+
}
|
|
8005
8017
|
clear() {
|
|
8006
8018
|
this.point = null;
|
|
8007
8019
|
this.findList = null;
|
|
@@ -9515,34 +9527,28 @@ let Ellipse = class Ellipse extends UI {
|
|
|
9515
9527
|
if (hasAngle) closedAngle = abs$3(endAngle - startAngle) === 360;
|
|
9516
9528
|
if (innerRadius) {
|
|
9517
9529
|
const drawInnerEllipse = innerRadius < 1 || closed;
|
|
9518
|
-
|
|
9530
|
+
const innerRx = rx * innerRadius, innerRy = ry * innerRadius;
|
|
9519
9531
|
if (hasAngle) {
|
|
9532
|
+
ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle);
|
|
9520
9533
|
if (drawInnerEllipse) {
|
|
9521
|
-
ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle);
|
|
9522
9534
|
if (closedAngle) {
|
|
9523
|
-
|
|
9524
|
-
set$1(tempCenter, rx, ry);
|
|
9535
|
+
closePath$2(path);
|
|
9536
|
+
set$1(tempPoint, rx + innerRx, ry), set$1(tempCenter, rx, ry);
|
|
9525
9537
|
rotate$2(tempPoint, endAngle, tempCenter, rx, ry);
|
|
9526
9538
|
moveTo$3(path, tempPoint.x, tempPoint.y);
|
|
9527
9539
|
}
|
|
9528
|
-
|
|
9529
|
-
outerEndAngle = startAngle;
|
|
9530
|
-
outerAnticlockwise = true;
|
|
9540
|
+
ellipse(path, rx, ry, innerRx, innerRy, 0, endAngle, startAngle, true);
|
|
9531
9541
|
} else {
|
|
9532
9542
|
if (!closedAngle) open = true;
|
|
9533
9543
|
}
|
|
9534
9544
|
} else {
|
|
9545
|
+
ellipse(path, rx, ry, rx, ry);
|
|
9535
9546
|
if (drawInnerEllipse) {
|
|
9536
|
-
ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
|
|
9537
9547
|
closePath$2(path);
|
|
9538
|
-
moveTo$3(path,
|
|
9539
|
-
|
|
9540
|
-
outerAnticlockwise = true;
|
|
9541
|
-
} else {
|
|
9542
|
-
outerEndAngle = 360;
|
|
9548
|
+
moveTo$3(path, rx + innerRx, ry);
|
|
9549
|
+
ellipse(path, rx, ry, innerRx, innerRy, 0, 360, 0, true);
|
|
9543
9550
|
}
|
|
9544
9551
|
}
|
|
9545
|
-
ellipse(path, rx, ry, rx, ry, 0, outerStartAngle, outerEndAngle, outerAnticlockwise);
|
|
9546
9552
|
} else {
|
|
9547
9553
|
if (hasAngle) {
|
|
9548
9554
|
if (!closedAngle) {
|
|
@@ -11442,7 +11448,8 @@ ui$1.__hit = function(inner, forceHitFill) {
|
|
|
11442
11448
|
const {hitFill: hitFill} = data;
|
|
11443
11449
|
const needHitFillPath = (data.fill || data.__isCanvas) && (hitFill === "path" || hitFill === "pixel" && !(data.__isAlphaPixelFill || data.__isCanvas)) || hitFill === "all" || forceHitFill;
|
|
11444
11450
|
if (needHitFillPath && this.__hitFill(inner)) return true;
|
|
11445
|
-
const {hitStroke: hitStroke,
|
|
11451
|
+
const {hitStroke: hitStroke, strokeScaleFixed: strokeScaleFixed} = data;
|
|
11452
|
+
const strokeWidth = data.__maxStrokeWidth * (strokeScaleFixed ? this.getRenderScaleData(true, strokeScaleFixed, false).scaleX : 1);
|
|
11446
11453
|
const needHitStrokePath = data.stroke && (hitStroke === "path" || hitStroke === "pixel" && !data.__isAlphaPixelStroke) || hitStroke === "all";
|
|
11447
11454
|
if (!needHitFillPath && !needHitStrokePath) return false;
|
|
11448
11455
|
const radiusWidth = inner.radiusX * 2;
|