@leafer-draw/worker 2.2.5 → 2.2.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/worker.cjs +70 -46
- package/dist/worker.esm.js +69 -47
- package/dist/worker.esm.min.js +1 -1
- package/dist/worker.esm.min.js.map +1 -1
- package/dist/worker.js +124 -81
- package/dist/worker.min.cjs +1 -1
- package/dist/worker.min.cjs.map +1 -1
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +126 -83
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +7 -7
package/dist/worker.js
CHANGED
|
@@ -1814,7 +1814,7 @@ var LeaferUI = function(exports) {
|
|
|
1814
1814
|
return name;
|
|
1815
1815
|
}
|
|
1816
1816
|
const D$4 = Debug;
|
|
1817
|
-
const debug$
|
|
1817
|
+
const debug$f = Debug.get("RunTime");
|
|
1818
1818
|
const Run = {
|
|
1819
1819
|
currentId: 0,
|
|
1820
1820
|
currentName: "",
|
|
@@ -1832,7 +1832,7 @@ var LeaferUI = function(exports) {
|
|
|
1832
1832
|
const time = R$1.idMap[id], name = R$1.nameMap[id];
|
|
1833
1833
|
const duration = microsecond ? (performance.now() - time) / 1e3 : Date.now() - time;
|
|
1834
1834
|
R$1.idMap[id] = R$1.nameMap[id] = R$1.nameToIdMap[name] = undefined;
|
|
1835
|
-
debug$
|
|
1835
|
+
debug$f.log(name, duration, "ms");
|
|
1836
1836
|
},
|
|
1837
1837
|
endOfName(name, microsecond) {
|
|
1838
1838
|
const id = R$1.nameToIdMap[name];
|
|
@@ -1862,17 +1862,17 @@ var LeaferUI = function(exports) {
|
|
|
1862
1862
|
return Plugin.need("editor");
|
|
1863
1863
|
}
|
|
1864
1864
|
};
|
|
1865
|
-
const debug$
|
|
1865
|
+
const debug$e = Debug.get("UICreator");
|
|
1866
1866
|
const UICreator = {
|
|
1867
1867
|
list: {},
|
|
1868
1868
|
register(UI) {
|
|
1869
1869
|
const {__tag: tag} = UI.prototype;
|
|
1870
|
-
if (list$1[tag]) debug$
|
|
1870
|
+
if (list$1[tag]) debug$e.repeat(tag);
|
|
1871
1871
|
list$1[tag] = UI;
|
|
1872
1872
|
},
|
|
1873
1873
|
get(tag, data, x, y, width, height) {
|
|
1874
1874
|
if (!list$1[tag]) {
|
|
1875
|
-
debug$
|
|
1875
|
+
debug$e.warn("not register " + tag);
|
|
1876
1876
|
return undefined;
|
|
1877
1877
|
}
|
|
1878
1878
|
const ui = new list$1[tag](data);
|
|
@@ -1886,14 +1886,14 @@ var LeaferUI = function(exports) {
|
|
|
1886
1886
|
}
|
|
1887
1887
|
};
|
|
1888
1888
|
const {list: list$1} = UICreator;
|
|
1889
|
-
const debug$
|
|
1889
|
+
const debug$d = Debug.get("EventCreator");
|
|
1890
1890
|
const EventCreator = {
|
|
1891
1891
|
nameList: {},
|
|
1892
1892
|
register(Event) {
|
|
1893
1893
|
let name;
|
|
1894
1894
|
Object.keys(Event).forEach(key => {
|
|
1895
1895
|
name = Event[key];
|
|
1896
|
-
if (isString(name)) nameList[name] && debug$
|
|
1896
|
+
if (isString(name)) nameList[name] && debug$d.repeat(name), nameList[name] = Event;
|
|
1897
1897
|
});
|
|
1898
1898
|
},
|
|
1899
1899
|
changeName(oldName, newName) {
|
|
@@ -2807,7 +2807,7 @@ var LeaferUI = function(exports) {
|
|
|
2807
2807
|
const {M: M$4, m: m, L: L$5, l: l, H: H, h: h, V: V, v: v, C: C$3, c: c, S: S, s: s, Q: Q$3, q: q, T: T, t: t, A: A, a: a, Z: Z$4, z: z, N: N$3, D: D$3, X: X$3, G: G$3, F: F$4, O: O$3, P: P$3, U: U$3} = PathCommandMap;
|
|
2808
2808
|
const {rect: rect$2, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
|
|
2809
2809
|
const {ellipticalArc: ellipticalArc} = EllipseHelper;
|
|
2810
|
-
const debug$
|
|
2810
|
+
const debug$c = Debug.get("PathConvert");
|
|
2811
2811
|
const setEndPoint$1 = {};
|
|
2812
2812
|
const PathConvert = {
|
|
2813
2813
|
current: {
|
|
@@ -3072,7 +3072,7 @@ var LeaferUI = function(exports) {
|
|
|
3072
3072
|
break;
|
|
3073
3073
|
|
|
3074
3074
|
default:
|
|
3075
|
-
debug$
|
|
3075
|
+
debug$c.error(`command: ${command} [index:${i}]`, old);
|
|
3076
3076
|
return data;
|
|
3077
3077
|
}
|
|
3078
3078
|
lastCommand = command;
|
|
@@ -3129,7 +3129,9 @@ var LeaferUI = function(exports) {
|
|
|
3129
3129
|
const {getMinDistanceFrom: getMinDistanceFrom, getRadianFrom: getRadianFrom} = PointHelper;
|
|
3130
3130
|
const {tan: tan, min: min, abs: abs$3} = Math;
|
|
3131
3131
|
const startPoint = {};
|
|
3132
|
+
const debug$b = Debug.get("PointsCurve");
|
|
3132
3133
|
const PathCommandDataHelper = {
|
|
3134
|
+
pointsCurveList: {},
|
|
3133
3135
|
beginPath(data) {
|
|
3134
3136
|
data.length = 0;
|
|
3135
3137
|
},
|
|
@@ -3199,11 +3201,19 @@ var LeaferUI = function(exports) {
|
|
|
3199
3201
|
data.push(M$3, startPoint.x, startPoint.y);
|
|
3200
3202
|
arc$2(data, x, y, radius, startAngle, endAngle, anticlockwise);
|
|
3201
3203
|
},
|
|
3202
|
-
drawPoints(data, points, curve, close) {
|
|
3203
|
-
|
|
3204
|
+
drawPoints(data, points, curve, close, options) {
|
|
3205
|
+
let type = "Q";
|
|
3206
|
+
if (isObject(curve)) type = curve.type, curve = curve.value;
|
|
3207
|
+
if (!pointsCurveList[type]) debug$b.warn("not found:", type), type = "Q";
|
|
3208
|
+
pointsCurveList[type](data, points, curve, close, options);
|
|
3204
3209
|
}
|
|
3205
3210
|
};
|
|
3206
|
-
const {ellipse: ellipse$3, arc: arc$2} = PathCommandDataHelper;
|
|
3211
|
+
const {ellipse: ellipse$3, arc: arc$2, pointsCurveList: pointsCurveList} = PathCommandDataHelper;
|
|
3212
|
+
function registerPointsCurve(type, fn) {
|
|
3213
|
+
if (pointsCurveList[type]) debug$b.repeat(type);
|
|
3214
|
+
pointsCurveList[type] = fn;
|
|
3215
|
+
}
|
|
3216
|
+
registerPointsCurve("Q", BezierHelper.points);
|
|
3207
3217
|
const {moveTo: moveTo$4, lineTo: lineTo$3, quadraticCurveTo: quadraticCurveTo, bezierCurveTo: bezierCurveTo, closePath: closePath$3, beginPath: beginPath, rect: rect$1, roundRect: roundRect$1, ellipse: ellipse$2, arc: arc$1, arcTo: arcTo$2, drawEllipse: drawEllipse, drawArc: drawArc, drawPoints: drawPoints$2} = PathCommandDataHelper;
|
|
3208
3218
|
class PathCreator {
|
|
3209
3219
|
set path(value) {
|
|
@@ -4503,7 +4513,7 @@ var LeaferUI = function(exports) {
|
|
|
4503
4513
|
const LeafHelper = {
|
|
4504
4514
|
updateAllMatrix(leaf, checkAutoLayout, waitAutoLayout) {
|
|
4505
4515
|
if (checkAutoLayout && leaf.__hasAutoLayout && leaf.__layout.matrixChanged) waitAutoLayout = true;
|
|
4506
|
-
updateMatrix$
|
|
4516
|
+
updateMatrix$1(leaf, checkAutoLayout, waitAutoLayout);
|
|
4507
4517
|
if (leaf.isBranch) {
|
|
4508
4518
|
const {children: children} = leaf;
|
|
4509
4519
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
@@ -4524,9 +4534,10 @@ var LeaferUI = function(exports) {
|
|
|
4524
4534
|
if (layout.matrixChanged) leaf.__updateLocalMatrix();
|
|
4525
4535
|
if (!layout.waitAutoLayout) leaf.__updateWorldMatrix();
|
|
4526
4536
|
},
|
|
4527
|
-
updateBounds(leaf) {
|
|
4537
|
+
updateBounds(leaf, noUpdateSize) {
|
|
4528
4538
|
const layout = leaf.__layout;
|
|
4529
4539
|
if (layout.boundsChanged) leaf.__updateLocalBounds();
|
|
4540
|
+
if (noUpdateSize) layout.resized = undefined;
|
|
4530
4541
|
if (!layout.waitAutoLayout) leaf.__updateWorldBounds();
|
|
4531
4542
|
},
|
|
4532
4543
|
updateAllWorldOpacity(leaf) {
|
|
@@ -4549,7 +4560,7 @@ var LeaferUI = function(exports) {
|
|
|
4549
4560
|
}
|
|
4550
4561
|
},
|
|
4551
4562
|
updateAllChange(leaf) {
|
|
4552
|
-
updateChange
|
|
4563
|
+
updateChange(leaf);
|
|
4553
4564
|
if (leaf.isBranch) {
|
|
4554
4565
|
const {children: children} = leaf;
|
|
4555
4566
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
@@ -4719,7 +4730,7 @@ var LeaferUI = function(exports) {
|
|
|
4719
4730
|
}
|
|
4720
4731
|
};
|
|
4721
4732
|
const L = LeafHelper;
|
|
4722
|
-
const {updateAllMatrix: updateAllMatrix$3, updateMatrix: updateMatrix$
|
|
4733
|
+
const {updateAllMatrix: updateAllMatrix$3, updateMatrix: updateMatrix$1, updateAllWorldOpacity: updateAllWorldOpacity, updateAllChange: updateAllChange$1, updateChange: updateChange} = L;
|
|
4723
4734
|
function getTempLocal(t, worldPoint) {
|
|
4724
4735
|
t.updateLayout();
|
|
4725
4736
|
return t.parent ? PointHelper.tempToInnerOf(worldPoint, t.parent.scrollWorldTransform) : worldPoint;
|
|
@@ -4760,7 +4771,7 @@ var LeaferUI = function(exports) {
|
|
|
4760
4771
|
if (target.__.mask) findMask = 1;
|
|
4761
4772
|
return findMask < 0 ? null : (findMask && (findMask = -1), true);
|
|
4762
4773
|
}
|
|
4763
|
-
const {updateBounds: updateBounds$
|
|
4774
|
+
const {updateBounds: updateBounds$2} = LeafHelper;
|
|
4764
4775
|
const BranchHelper = {
|
|
4765
4776
|
sort(a, b) {
|
|
4766
4777
|
return a.__.zIndex === b.__.zIndex ? a.__tempNumber - b.__tempNumber : a.__.zIndex - b.__.zIndex;
|
|
@@ -4820,10 +4831,10 @@ var LeaferUI = function(exports) {
|
|
|
4820
4831
|
branch = branchStack[i];
|
|
4821
4832
|
children = branch.children;
|
|
4822
4833
|
for (let j = 0, len = children.length; j < len; j++) {
|
|
4823
|
-
updateBounds$
|
|
4834
|
+
updateBounds$2(children[j]);
|
|
4824
4835
|
}
|
|
4825
4836
|
if (exclude && exclude === branch) continue;
|
|
4826
|
-
updateBounds$
|
|
4837
|
+
updateBounds$2(branch);
|
|
4827
4838
|
}
|
|
4828
4839
|
},
|
|
4829
4840
|
move(branch, x, y) {
|
|
@@ -4882,7 +4893,7 @@ var LeaferUI = function(exports) {
|
|
|
4882
4893
|
}
|
|
4883
4894
|
}
|
|
4884
4895
|
};
|
|
4885
|
-
const {getRelativeWorld: getRelativeWorld$1, updateBounds: updateBounds$
|
|
4896
|
+
const {getRelativeWorld: getRelativeWorld$1, updateBounds: updateBounds$1} = LeafHelper;
|
|
4886
4897
|
const {toOuterOf: toOuterOf$3, getPoints: getPoints, copy: copy$4} = BoundsHelper;
|
|
4887
4898
|
const localContent = "_localContentBounds";
|
|
4888
4899
|
const worldContent = "_worldContentBounds", worldBox = "_worldBoxBounds", worldStroke = "_worldStrokeBounds";
|
|
@@ -4986,7 +4997,7 @@ var LeaferUI = function(exports) {
|
|
|
4986
4997
|
}
|
|
4987
4998
|
update() {
|
|
4988
4999
|
const {leaf: leaf} = this, {leafer: leafer} = leaf;
|
|
4989
|
-
if (leaf.isApp) return updateBounds$
|
|
5000
|
+
if (leaf.isApp) return updateBounds$1(leaf);
|
|
4990
5001
|
if (leafer) {
|
|
4991
5002
|
if (leafer.ready) leafer.watcher.changed && leafer.layouter.layout(); else leafer.start();
|
|
4992
5003
|
} else {
|
|
@@ -5648,9 +5659,12 @@ var LeaferUI = function(exports) {
|
|
|
5648
5659
|
}
|
|
5649
5660
|
},
|
|
5650
5661
|
emitPropertyEvent(type, name, oldValue, newValue) {
|
|
5651
|
-
const
|
|
5652
|
-
|
|
5653
|
-
|
|
5662
|
+
const {leafer: leafer} = this;
|
|
5663
|
+
if (leafer.config.trackChanges || leafer.zoomLayer === this) {
|
|
5664
|
+
const event = new PropertyEvent(type, this, name, oldValue, newValue);
|
|
5665
|
+
this.isLeafer || this.hasEvent(type) && this.emitEvent(event);
|
|
5666
|
+
leafer.emitEvent(event);
|
|
5667
|
+
} else leafer.watcher.add(this);
|
|
5654
5668
|
},
|
|
5655
5669
|
__realSetAttr(name, newValue) {
|
|
5656
5670
|
const data = this.__;
|
|
@@ -5691,8 +5705,8 @@ var LeaferUI = function(exports) {
|
|
|
5691
5705
|
this.__layout.matrixChanged = undefined;
|
|
5692
5706
|
}
|
|
5693
5707
|
};
|
|
5694
|
-
const {updateMatrix: updateMatrix
|
|
5695
|
-
const {updateBounds: updateBounds
|
|
5708
|
+
const {updateMatrix: updateMatrix, updateAllMatrix: updateAllMatrix$2} = LeafHelper;
|
|
5709
|
+
const {updateBounds: updateBounds} = BranchHelper;
|
|
5696
5710
|
const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$2, copy: copy$3} = BoundsHelper;
|
|
5697
5711
|
const {toBounds: toBounds} = PathBounds;
|
|
5698
5712
|
const LeafBounds = {
|
|
@@ -5792,14 +5806,14 @@ var LeaferUI = function(exports) {
|
|
|
5792
5806
|
if (this.__layout.childrenSortChanged) this.__updateSortChildren();
|
|
5793
5807
|
if (this.__layout.boxChanged) this.__updateFlowLayout();
|
|
5794
5808
|
updateAllMatrix$2(this);
|
|
5795
|
-
updateBounds
|
|
5809
|
+
updateBounds(this, this);
|
|
5796
5810
|
if (this.__.__autoSide) this.__updateBoxBounds(true);
|
|
5797
5811
|
} else {
|
|
5798
5812
|
updateAllMatrix$2(this);
|
|
5799
|
-
updateBounds
|
|
5813
|
+
updateBounds(this, this);
|
|
5800
5814
|
}
|
|
5801
5815
|
} else {
|
|
5802
|
-
updateMatrix
|
|
5816
|
+
updateMatrix(this);
|
|
5803
5817
|
}
|
|
5804
5818
|
},
|
|
5805
5819
|
__updateNaturalSize() {
|
|
@@ -6455,9 +6469,12 @@ var LeaferUI = function(exports) {
|
|
|
6455
6469
|
if (this.isFrame) child.__bindFrame(null);
|
|
6456
6470
|
}
|
|
6457
6471
|
__emitChildEvent(type, child) {
|
|
6458
|
-
const
|
|
6459
|
-
if (
|
|
6460
|
-
|
|
6472
|
+
const {leafer: leafer} = this;
|
|
6473
|
+
if (leafer.config.trackChanges || leafer.zoomLayer === this) {
|
|
6474
|
+
const event = new ChildEvent(type, child, this);
|
|
6475
|
+
if (this.hasEvent(type) && !this.isLeafer) this.emitEvent(event);
|
|
6476
|
+
leafer.emitEvent(event);
|
|
6477
|
+
} else leafer.watcher.addChild(child, this, type);
|
|
6461
6478
|
}
|
|
6462
6479
|
};
|
|
6463
6480
|
exports.Branch = __decorate([ useModule(BranchRender) ], exports.Branch);
|
|
@@ -6606,7 +6623,7 @@ var LeaferUI = function(exports) {
|
|
|
6606
6623
|
this.levelMap = null;
|
|
6607
6624
|
}
|
|
6608
6625
|
}
|
|
6609
|
-
const version = "2.2.
|
|
6626
|
+
const version = "2.2.7";
|
|
6610
6627
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6611
6628
|
get allowBackgroundColor() {
|
|
6612
6629
|
return true;
|
|
@@ -6726,6 +6743,7 @@ var LeaferUI = function(exports) {
|
|
|
6726
6743
|
}
|
|
6727
6744
|
constructor(target, userConfig) {
|
|
6728
6745
|
this.totalTimes = 0;
|
|
6746
|
+
this.changed = 0;
|
|
6729
6747
|
this.config = {};
|
|
6730
6748
|
this.__updatedList = new LeafList;
|
|
6731
6749
|
this.target = target;
|
|
@@ -6745,8 +6763,10 @@ var LeaferUI = function(exports) {
|
|
|
6745
6763
|
this.disabled = true;
|
|
6746
6764
|
}
|
|
6747
6765
|
update() {
|
|
6748
|
-
this.changed
|
|
6749
|
-
|
|
6766
|
+
if (this.changed < 100) {
|
|
6767
|
+
this.changed++;
|
|
6768
|
+
if (this.running) this.target.emit(RenderEvent.REQUEST);
|
|
6769
|
+
}
|
|
6750
6770
|
}
|
|
6751
6771
|
__onAttrChange(event) {
|
|
6752
6772
|
this.add(event.target);
|
|
@@ -6755,18 +6775,21 @@ var LeaferUI = function(exports) {
|
|
|
6755
6775
|
if (this.config.usePartLayout) this.__updatedList.add(leaf);
|
|
6756
6776
|
this.update();
|
|
6757
6777
|
}
|
|
6758
|
-
|
|
6778
|
+
addChild(child, parent, eventType) {
|
|
6759
6779
|
if (this.config.usePartLayout) {
|
|
6760
|
-
if (
|
|
6780
|
+
if (eventType === ChildEvent.ADD) {
|
|
6761
6781
|
this.hasAdd = true;
|
|
6762
|
-
this.__pushChild(
|
|
6782
|
+
this.__pushChild(child);
|
|
6763
6783
|
} else {
|
|
6764
6784
|
this.hasRemove = true;
|
|
6765
|
-
this.__updatedList.add(
|
|
6785
|
+
this.__updatedList.add(parent);
|
|
6766
6786
|
}
|
|
6767
6787
|
}
|
|
6768
6788
|
this.update();
|
|
6769
6789
|
}
|
|
6790
|
+
__onChildEvent(event) {
|
|
6791
|
+
this.addChild(event.child, event.parent, event.type);
|
|
6792
|
+
}
|
|
6770
6793
|
__pushChild(child) {
|
|
6771
6794
|
this.__updatedList.add(child);
|
|
6772
6795
|
if (child.isBranch) this.__loopChildren(child);
|
|
@@ -6781,7 +6804,8 @@ var LeaferUI = function(exports) {
|
|
|
6781
6804
|
}));
|
|
6782
6805
|
this.__updatedList = new LeafList;
|
|
6783
6806
|
this.totalTimes++;
|
|
6784
|
-
this.
|
|
6807
|
+
this.hasVisible = this.hasRemove = this.hasAdd = false;
|
|
6808
|
+
this.changed = 0;
|
|
6785
6809
|
}
|
|
6786
6810
|
__listenEvents() {
|
|
6787
6811
|
this.__eventIds = [ this.target.on_([ [ PropertyEvent.CHANGE, this.__onAttrChange, this ], [ [ ChildEvent.ADD, ChildEvent.REMOVE ], this.__onChildEvent, this ], [ WatchEvent.REQUEST, this.__onRquestData, this ] ]) ];
|
|
@@ -6799,45 +6823,56 @@ var LeaferUI = function(exports) {
|
|
|
6799
6823
|
}
|
|
6800
6824
|
const {updateAllMatrix: updateAllMatrix$1, updateBounds: updateOneBounds, updateChange: updateOneChange} = LeafHelper;
|
|
6801
6825
|
const {pushAllChildBranch: pushAllChildBranch, pushAllParent: pushAllParent} = BranchHelper;
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
if (
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
if (
|
|
6815
|
-
|
|
6826
|
+
const LayouterHelper = {
|
|
6827
|
+
updateMatrix(updateList, levelList) {
|
|
6828
|
+
let index = 0, leaf, layout;
|
|
6829
|
+
const {list: list} = updateList;
|
|
6830
|
+
while (index < list.length) {
|
|
6831
|
+
leaf = list[index];
|
|
6832
|
+
layout = leaf.__layout;
|
|
6833
|
+
if (levelList.without(leaf) && !layout.proxyZoom) {
|
|
6834
|
+
if (layout.matrixChanged) {
|
|
6835
|
+
updateAllMatrix$1(leaf, true);
|
|
6836
|
+
if (leaf.isBranch) pushAllChildBranch(leaf, levelList);
|
|
6837
|
+
push(leaf, levelList);
|
|
6838
|
+
} else if (layout.boundsChanged) {
|
|
6839
|
+
if (leaf.isBranch) leaf.__tempNumber = 0;
|
|
6840
|
+
push(leaf, levelList);
|
|
6841
|
+
}
|
|
6816
6842
|
}
|
|
6843
|
+
index++;
|
|
6817
6844
|
}
|
|
6818
|
-
}
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6845
|
+
},
|
|
6846
|
+
updateBounds(boundsList) {
|
|
6847
|
+
let index = 0, level, list, branch, children;
|
|
6848
|
+
const {levels: levels, levelMap: levelMap} = boundsList;
|
|
6849
|
+
boundsList.sort(true);
|
|
6850
|
+
while (index < levels.length) {
|
|
6851
|
+
level = levels[index];
|
|
6852
|
+
list = levelMap[level];
|
|
6853
|
+
for (let i = 0, len = list.length; i < len; i++) {
|
|
6854
|
+
branch = list[i];
|
|
6855
|
+
if (branch.isBranch && branch.__tempNumber) {
|
|
6856
|
+
children = branch.children;
|
|
6857
|
+
for (let j = 0, jLen = children.length; j < jLen; j++) {
|
|
6858
|
+
if (!children[j].isBranch) {
|
|
6859
|
+
updateOneBounds(children[j]);
|
|
6860
|
+
}
|
|
6832
6861
|
}
|
|
6833
6862
|
}
|
|
6863
|
+
updateOneBounds(branch);
|
|
6834
6864
|
}
|
|
6835
|
-
|
|
6865
|
+
index++;
|
|
6836
6866
|
}
|
|
6837
|
-
}
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
|
|
6867
|
+
},
|
|
6868
|
+
updateChange(updateList) {
|
|
6869
|
+
updateList.list.forEach(updateOneChange);
|
|
6870
|
+
},
|
|
6871
|
+
push: push
|
|
6872
|
+
};
|
|
6873
|
+
function push(leaf, levelList) {
|
|
6874
|
+
levelList.add(leaf);
|
|
6875
|
+
pushAllParent(leaf, levelList);
|
|
6841
6876
|
}
|
|
6842
6877
|
const {worldBounds: worldBounds} = LeafBoundsHelper;
|
|
6843
6878
|
class LayoutBlockData {
|
|
@@ -6939,9 +6974,9 @@ var LeaferUI = function(exports) {
|
|
|
6939
6974
|
target.emitEvent(new LayoutEvent(BEFORE, blocks, this.times));
|
|
6940
6975
|
this.extraBlock = null;
|
|
6941
6976
|
updateList.sort();
|
|
6942
|
-
updateMatrix(updateList, this.__levelList);
|
|
6943
|
-
updateBounds(this.__levelList);
|
|
6944
|
-
updateChange(updateList);
|
|
6977
|
+
LayouterHelper.updateMatrix(updateList, this.__levelList);
|
|
6978
|
+
LayouterHelper.updateBounds(this.__levelList);
|
|
6979
|
+
LayouterHelper.updateChange(updateList);
|
|
6945
6980
|
if (this.extraBlock) blocks.push(this.extraBlock);
|
|
6946
6981
|
blocks.forEach(item => item.setAfter());
|
|
6947
6982
|
target.emitEvent(new LayoutEvent(LAYOUT, blocks, this.times));
|
|
@@ -6971,11 +7006,16 @@ var LeaferUI = function(exports) {
|
|
|
6971
7006
|
if (target.isBranch) BranchHelper.updateBounds(target); else LeafHelper.updateBounds(target);
|
|
6972
7007
|
updateAllChange(target);
|
|
6973
7008
|
}
|
|
6974
|
-
addExtra(leaf) {
|
|
7009
|
+
addExtra(leaf, updateBounds) {
|
|
6975
7010
|
if (!this.__updatedList.has(leaf)) {
|
|
6976
7011
|
const {updatedList: updatedList, beforeBounds: beforeBounds} = this.extraBlock || (this.extraBlock = new LayoutBlockData([]));
|
|
6977
7012
|
updatedList.length ? beforeBounds.add(leaf.__world) : beforeBounds.set(leaf.__world);
|
|
6978
7013
|
updatedList.add(leaf);
|
|
7014
|
+
if (updateBounds) {
|
|
7015
|
+
const list = this.__levelList;
|
|
7016
|
+
LayouterHelper.push(leaf, list);
|
|
7017
|
+
list.sort(true);
|
|
7018
|
+
}
|
|
6979
7019
|
}
|
|
6980
7020
|
}
|
|
6981
7021
|
createBlock(data) {
|
|
@@ -7679,7 +7719,7 @@ var LeaferUI = function(exports) {
|
|
|
7679
7719
|
}
|
|
7680
7720
|
if (data.__useEffect) {
|
|
7681
7721
|
const {shadow: shadow, fill: fill, stroke: stroke} = data, otherEffect = data.innerShadow || data.blur || data.backgroundBlur || data.filter;
|
|
7682
|
-
stintSet$2(data, "__isFastShadow", shadow && !otherEffect && shadow.length < 2 && !shadow[0].spread && !Effect.isTransformShadow(shadow[0]) && fill && !data.__isTransparentFill && !(isArray(fill) && fill.length > 1) && (this.useFastShadow || !stroke || stroke && data.strokeAlign === "inside"));
|
|
7722
|
+
stintSet$2(data, "__isFastShadow", shadow && !otherEffect && shadow.length < 2 && !shadow[0].spread && !Effect.isTransformShadow(shadow[0]) && !(shadow[0].blendMode && shadow[0].blendMode !== "pass-through") && fill && !data.__isTransparentFill && !(isArray(fill) && fill.length > 1) && (this.useFastShadow || !stroke || stroke && data.strokeAlign === "inside"));
|
|
7683
7723
|
data.__useEffect = !!(shadow || otherEffect);
|
|
7684
7724
|
}
|
|
7685
7725
|
data.__checkSingle();
|
|
@@ -8088,6 +8128,7 @@ var LeaferUI = function(exports) {
|
|
|
8088
8128
|
start: true,
|
|
8089
8129
|
hittable: true,
|
|
8090
8130
|
smooth: true,
|
|
8131
|
+
trackChanges: true,
|
|
8091
8132
|
lazySpeard: 100
|
|
8092
8133
|
};
|
|
8093
8134
|
this.leafs = 0;
|
|
@@ -8611,7 +8652,7 @@ var LeaferUI = function(exports) {
|
|
|
8611
8652
|
const data = this.__;
|
|
8612
8653
|
const path = data.path = [];
|
|
8613
8654
|
if (data.points) {
|
|
8614
|
-
drawPoints$1(path, data.points, data.curve, data.closed);
|
|
8655
|
+
drawPoints$1(path, data.points, data.curve, data.closed, data);
|
|
8615
8656
|
} else {
|
|
8616
8657
|
const {width: width, height: height, sides: sides, startAngle: startAngle} = data;
|
|
8617
8658
|
const rx = width / 2, ry = height / 2;
|
|
@@ -8686,7 +8727,7 @@ var LeaferUI = function(exports) {
|
|
|
8686
8727
|
const data = this.__;
|
|
8687
8728
|
const path = data.path = [];
|
|
8688
8729
|
if (data.points) {
|
|
8689
|
-
drawPoints(path, data.points, data.curve, data.closed);
|
|
8730
|
+
drawPoints(path, data.points, data.curve, data.closed, data);
|
|
8690
8731
|
} else {
|
|
8691
8732
|
moveTo(path, 0, 0);
|
|
8692
8733
|
lineTo(path, this.width, 0);
|
|
@@ -9346,7 +9387,7 @@ var LeaferUI = function(exports) {
|
|
|
9346
9387
|
data.__naturalHeight = image.height / data.pixelRatio;
|
|
9347
9388
|
if (data.__autoSide) {
|
|
9348
9389
|
ui.forceUpdate();
|
|
9349
|
-
LeafHelper.updateBounds(ui);
|
|
9390
|
+
LeafHelper.updateBounds(ui, true);
|
|
9350
9391
|
ui.__layout.boundsChanged = true;
|
|
9351
9392
|
if (ui.__proxyData) {
|
|
9352
9393
|
ui.setProxyAttr("width", data.width);
|
|
@@ -10525,6 +10566,7 @@ var LeaferUI = function(exports) {
|
|
|
10525
10566
|
exports.IncrementId = IncrementId;
|
|
10526
10567
|
exports.LayoutEvent = LayoutEvent;
|
|
10527
10568
|
exports.Layouter = Layouter;
|
|
10569
|
+
exports.LayouterHelper = LayouterHelper;
|
|
10528
10570
|
exports.LeafBounds = LeafBounds;
|
|
10529
10571
|
exports.LeafBoundsHelper = LeafBoundsHelper;
|
|
10530
10572
|
exports.LeafData = LeafData;
|
|
@@ -10649,6 +10691,7 @@ var LeaferUI = function(exports) {
|
|
|
10649
10691
|
exports.pathType = pathType;
|
|
10650
10692
|
exports.pen = pen;
|
|
10651
10693
|
exports.positionType = positionType;
|
|
10694
|
+
exports.registerPointsCurve = registerPointsCurve;
|
|
10652
10695
|
exports.registerUI = registerUI;
|
|
10653
10696
|
exports.registerUIEvent = registerUIEvent;
|
|
10654
10697
|
exports.resizeType = resizeType;
|