@leafer-draw/miniapp 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/miniapp.cjs +70 -46
- package/dist/miniapp.esm.js +69 -47
- 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 +126 -83
- 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
|
@@ -1865,7 +1865,7 @@ function getNameList(name) {
|
|
|
1865
1865
|
|
|
1866
1866
|
const D$4 = Debug;
|
|
1867
1867
|
|
|
1868
|
-
const debug$
|
|
1868
|
+
const debug$f = Debug.get("RunTime");
|
|
1869
1869
|
|
|
1870
1870
|
const Run = {
|
|
1871
1871
|
currentId: 0,
|
|
@@ -1884,7 +1884,7 @@ const Run = {
|
|
|
1884
1884
|
const time = R$1.idMap[id], name = R$1.nameMap[id];
|
|
1885
1885
|
const duration = microsecond ? (performance.now() - time) / 1e3 : Date.now() - time;
|
|
1886
1886
|
R$1.idMap[id] = R$1.nameMap[id] = R$1.nameToIdMap[name] = undefined;
|
|
1887
|
-
debug$
|
|
1887
|
+
debug$f.log(name, duration, "ms");
|
|
1888
1888
|
},
|
|
1889
1889
|
endOfName(name, microsecond) {
|
|
1890
1890
|
const id = R$1.nameToIdMap[name];
|
|
@@ -1920,18 +1920,18 @@ const Creator = {
|
|
|
1920
1920
|
}
|
|
1921
1921
|
};
|
|
1922
1922
|
|
|
1923
|
-
const debug$
|
|
1923
|
+
const debug$e = Debug.get("UICreator");
|
|
1924
1924
|
|
|
1925
1925
|
const UICreator = {
|
|
1926
1926
|
list: {},
|
|
1927
1927
|
register(UI) {
|
|
1928
1928
|
const {__tag: tag} = UI.prototype;
|
|
1929
|
-
if (list$1[tag]) debug$
|
|
1929
|
+
if (list$1[tag]) debug$e.repeat(tag);
|
|
1930
1930
|
list$1[tag] = UI;
|
|
1931
1931
|
},
|
|
1932
1932
|
get(tag, data, x, y, width, height) {
|
|
1933
1933
|
if (!list$1[tag]) {
|
|
1934
|
-
debug$
|
|
1934
|
+
debug$e.warn("not register " + tag);
|
|
1935
1935
|
return undefined;
|
|
1936
1936
|
}
|
|
1937
1937
|
const ui = new list$1[tag](data);
|
|
@@ -1947,7 +1947,7 @@ const UICreator = {
|
|
|
1947
1947
|
|
|
1948
1948
|
const {list: list$1} = UICreator;
|
|
1949
1949
|
|
|
1950
|
-
const debug$
|
|
1950
|
+
const debug$d = Debug.get("EventCreator");
|
|
1951
1951
|
|
|
1952
1952
|
const EventCreator = {
|
|
1953
1953
|
nameList: {},
|
|
@@ -1955,7 +1955,7 @@ const EventCreator = {
|
|
|
1955
1955
|
let name;
|
|
1956
1956
|
Object.keys(Event).forEach(key => {
|
|
1957
1957
|
name = Event[key];
|
|
1958
|
-
if (isString(name)) nameList[name] && debug$
|
|
1958
|
+
if (isString(name)) nameList[name] && debug$d.repeat(name), nameList[name] = Event;
|
|
1959
1959
|
});
|
|
1960
1960
|
},
|
|
1961
1961
|
changeName(oldName, newName) {
|
|
@@ -3003,7 +3003,7 @@ const {rect: rect$2, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse
|
|
|
3003
3003
|
|
|
3004
3004
|
const {ellipticalArc: ellipticalArc} = EllipseHelper;
|
|
3005
3005
|
|
|
3006
|
-
const debug$
|
|
3006
|
+
const debug$c = Debug.get("PathConvert");
|
|
3007
3007
|
|
|
3008
3008
|
const setEndPoint$1 = {};
|
|
3009
3009
|
|
|
@@ -3270,7 +3270,7 @@ const PathConvert = {
|
|
|
3270
3270
|
break;
|
|
3271
3271
|
|
|
3272
3272
|
default:
|
|
3273
|
-
debug$
|
|
3273
|
+
debug$c.error(`command: ${command} [index:${i}]`, old);
|
|
3274
3274
|
return data;
|
|
3275
3275
|
}
|
|
3276
3276
|
lastCommand = command;
|
|
@@ -3333,7 +3333,10 @@ const {tan: tan, min: min, abs: abs$3} = Math;
|
|
|
3333
3333
|
|
|
3334
3334
|
const startPoint = {};
|
|
3335
3335
|
|
|
3336
|
+
const debug$b = Debug.get("PointsCurve");
|
|
3337
|
+
|
|
3336
3338
|
const PathCommandDataHelper = {
|
|
3339
|
+
pointsCurveList: {},
|
|
3337
3340
|
beginPath(data) {
|
|
3338
3341
|
data.length = 0;
|
|
3339
3342
|
},
|
|
@@ -3403,12 +3406,22 @@ const PathCommandDataHelper = {
|
|
|
3403
3406
|
data.push(M$3, startPoint.x, startPoint.y);
|
|
3404
3407
|
arc$2(data, x, y, radius, startAngle, endAngle, anticlockwise);
|
|
3405
3408
|
},
|
|
3406
|
-
drawPoints(data, points, curve, close) {
|
|
3407
|
-
|
|
3409
|
+
drawPoints(data, points, curve, close, options) {
|
|
3410
|
+
let type = "Q";
|
|
3411
|
+
if (isObject(curve)) type = curve.type, curve = curve.value;
|
|
3412
|
+
if (!pointsCurveList[type]) debug$b.warn("not found:", type), type = "Q";
|
|
3413
|
+
pointsCurveList[type](data, points, curve, close, options);
|
|
3408
3414
|
}
|
|
3409
3415
|
};
|
|
3410
3416
|
|
|
3411
|
-
const {ellipse: ellipse$3, arc: arc$2} = PathCommandDataHelper;
|
|
3417
|
+
const {ellipse: ellipse$3, arc: arc$2, pointsCurveList: pointsCurveList} = PathCommandDataHelper;
|
|
3418
|
+
|
|
3419
|
+
function registerPointsCurve(type, fn) {
|
|
3420
|
+
if (pointsCurveList[type]) debug$b.repeat(type);
|
|
3421
|
+
pointsCurveList[type] = fn;
|
|
3422
|
+
}
|
|
3423
|
+
|
|
3424
|
+
registerPointsCurve("Q", BezierHelper.points);
|
|
3412
3425
|
|
|
3413
3426
|
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;
|
|
3414
3427
|
|
|
@@ -4801,7 +4814,7 @@ const matrix = {}, {round: round} = Math;
|
|
|
4801
4814
|
const LeafHelper = {
|
|
4802
4815
|
updateAllMatrix(leaf, checkAutoLayout, waitAutoLayout) {
|
|
4803
4816
|
if (checkAutoLayout && leaf.__hasAutoLayout && leaf.__layout.matrixChanged) waitAutoLayout = true;
|
|
4804
|
-
updateMatrix$
|
|
4817
|
+
updateMatrix$1(leaf, checkAutoLayout, waitAutoLayout);
|
|
4805
4818
|
if (leaf.isBranch) {
|
|
4806
4819
|
const {children: children} = leaf;
|
|
4807
4820
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
@@ -4822,9 +4835,10 @@ const LeafHelper = {
|
|
|
4822
4835
|
if (layout.matrixChanged) leaf.__updateLocalMatrix();
|
|
4823
4836
|
if (!layout.waitAutoLayout) leaf.__updateWorldMatrix();
|
|
4824
4837
|
},
|
|
4825
|
-
updateBounds(leaf) {
|
|
4838
|
+
updateBounds(leaf, noUpdateSize) {
|
|
4826
4839
|
const layout = leaf.__layout;
|
|
4827
4840
|
if (layout.boundsChanged) leaf.__updateLocalBounds();
|
|
4841
|
+
if (noUpdateSize) layout.resized = undefined;
|
|
4828
4842
|
if (!layout.waitAutoLayout) leaf.__updateWorldBounds();
|
|
4829
4843
|
},
|
|
4830
4844
|
updateAllWorldOpacity(leaf) {
|
|
@@ -4847,7 +4861,7 @@ const LeafHelper = {
|
|
|
4847
4861
|
}
|
|
4848
4862
|
},
|
|
4849
4863
|
updateAllChange(leaf) {
|
|
4850
|
-
updateChange
|
|
4864
|
+
updateChange(leaf);
|
|
4851
4865
|
if (leaf.isBranch) {
|
|
4852
4866
|
const {children: children} = leaf;
|
|
4853
4867
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
@@ -5019,7 +5033,7 @@ const LeafHelper = {
|
|
|
5019
5033
|
|
|
5020
5034
|
const L = LeafHelper;
|
|
5021
5035
|
|
|
5022
|
-
const {updateAllMatrix: updateAllMatrix$3, updateMatrix: updateMatrix$
|
|
5036
|
+
const {updateAllMatrix: updateAllMatrix$3, updateMatrix: updateMatrix$1, updateAllWorldOpacity: updateAllWorldOpacity, updateAllChange: updateAllChange$1, updateChange: updateChange} = L;
|
|
5023
5037
|
|
|
5024
5038
|
function getTempLocal(t, worldPoint) {
|
|
5025
5039
|
t.updateLayout();
|
|
@@ -5065,7 +5079,7 @@ function checkMask(target, index) {
|
|
|
5065
5079
|
return findMask < 0 ? null : (findMask && (findMask = -1), true);
|
|
5066
5080
|
}
|
|
5067
5081
|
|
|
5068
|
-
const {updateBounds: updateBounds$
|
|
5082
|
+
const {updateBounds: updateBounds$2} = LeafHelper;
|
|
5069
5083
|
|
|
5070
5084
|
const BranchHelper = {
|
|
5071
5085
|
sort(a, b) {
|
|
@@ -5126,10 +5140,10 @@ const BranchHelper = {
|
|
|
5126
5140
|
branch = branchStack[i];
|
|
5127
5141
|
children = branch.children;
|
|
5128
5142
|
for (let j = 0, len = children.length; j < len; j++) {
|
|
5129
|
-
updateBounds$
|
|
5143
|
+
updateBounds$2(children[j]);
|
|
5130
5144
|
}
|
|
5131
5145
|
if (exclude && exclude === branch) continue;
|
|
5132
|
-
updateBounds$
|
|
5146
|
+
updateBounds$2(branch);
|
|
5133
5147
|
}
|
|
5134
5148
|
},
|
|
5135
5149
|
move(branch, x, y) {
|
|
@@ -5191,7 +5205,7 @@ const WaitHelper = {
|
|
|
5191
5205
|
}
|
|
5192
5206
|
};
|
|
5193
5207
|
|
|
5194
|
-
const {getRelativeWorld: getRelativeWorld$1, updateBounds: updateBounds$
|
|
5208
|
+
const {getRelativeWorld: getRelativeWorld$1, updateBounds: updateBounds$1} = LeafHelper;
|
|
5195
5209
|
|
|
5196
5210
|
const {toOuterOf: toOuterOf$3, getPoints: getPoints, copy: copy$4} = BoundsHelper;
|
|
5197
5211
|
|
|
@@ -5299,7 +5313,7 @@ class LeafLayout {
|
|
|
5299
5313
|
}
|
|
5300
5314
|
update() {
|
|
5301
5315
|
const {leaf: leaf} = this, {leafer: leafer} = leaf;
|
|
5302
|
-
if (leaf.isApp) return updateBounds$
|
|
5316
|
+
if (leaf.isApp) return updateBounds$1(leaf);
|
|
5303
5317
|
if (leafer) {
|
|
5304
5318
|
if (leafer.ready) leafer.watcher.changed && leafer.layouter.layout(); else leafer.start();
|
|
5305
5319
|
} else {
|
|
@@ -6036,9 +6050,12 @@ const LeafDataProxy = {
|
|
|
6036
6050
|
}
|
|
6037
6051
|
},
|
|
6038
6052
|
emitPropertyEvent(type, name, oldValue, newValue) {
|
|
6039
|
-
const
|
|
6040
|
-
|
|
6041
|
-
|
|
6053
|
+
const {leafer: leafer} = this;
|
|
6054
|
+
if (leafer.config.trackChanges || leafer.zoomLayer === this) {
|
|
6055
|
+
const event = new PropertyEvent(type, this, name, oldValue, newValue);
|
|
6056
|
+
this.isLeafer || this.hasEvent(type) && this.emitEvent(event);
|
|
6057
|
+
leafer.emitEvent(event);
|
|
6058
|
+
} else leafer.watcher.add(this);
|
|
6042
6059
|
},
|
|
6043
6060
|
__realSetAttr(name, newValue) {
|
|
6044
6061
|
const data = this.__;
|
|
@@ -6083,9 +6100,9 @@ const LeafMatrix = {
|
|
|
6083
6100
|
}
|
|
6084
6101
|
};
|
|
6085
6102
|
|
|
6086
|
-
const {updateMatrix: updateMatrix
|
|
6103
|
+
const {updateMatrix: updateMatrix, updateAllMatrix: updateAllMatrix$2} = LeafHelper;
|
|
6087
6104
|
|
|
6088
|
-
const {updateBounds: updateBounds
|
|
6105
|
+
const {updateBounds: updateBounds} = BranchHelper;
|
|
6089
6106
|
|
|
6090
6107
|
const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$2, copy: copy$3} = BoundsHelper;
|
|
6091
6108
|
|
|
@@ -6188,14 +6205,14 @@ const LeafBounds = {
|
|
|
6188
6205
|
if (this.__layout.childrenSortChanged) this.__updateSortChildren();
|
|
6189
6206
|
if (this.__layout.boxChanged) this.__updateFlowLayout();
|
|
6190
6207
|
updateAllMatrix$2(this);
|
|
6191
|
-
updateBounds
|
|
6208
|
+
updateBounds(this, this);
|
|
6192
6209
|
if (this.__.__autoSide) this.__updateBoxBounds(true);
|
|
6193
6210
|
} else {
|
|
6194
6211
|
updateAllMatrix$2(this);
|
|
6195
|
-
updateBounds
|
|
6212
|
+
updateBounds(this, this);
|
|
6196
6213
|
}
|
|
6197
6214
|
} else {
|
|
6198
|
-
updateMatrix
|
|
6215
|
+
updateMatrix(this);
|
|
6199
6216
|
}
|
|
6200
6217
|
},
|
|
6201
6218
|
__updateNaturalSize() {
|
|
@@ -6868,9 +6885,12 @@ let Branch = class Branch extends Leaf {
|
|
|
6868
6885
|
if (this.isFrame) child.__bindFrame(null);
|
|
6869
6886
|
}
|
|
6870
6887
|
__emitChildEvent(type, child) {
|
|
6871
|
-
const
|
|
6872
|
-
if (
|
|
6873
|
-
|
|
6888
|
+
const {leafer: leafer} = this;
|
|
6889
|
+
if (leafer.config.trackChanges || leafer.zoomLayer === this) {
|
|
6890
|
+
const event = new ChildEvent(type, child, this);
|
|
6891
|
+
if (this.hasEvent(type) && !this.isLeafer) this.emitEvent(event);
|
|
6892
|
+
leafer.emitEvent(event);
|
|
6893
|
+
} else leafer.watcher.addChild(child, this, type);
|
|
6874
6894
|
}
|
|
6875
6895
|
};
|
|
6876
6896
|
|
|
@@ -7023,7 +7043,7 @@ class LeafLevelList {
|
|
|
7023
7043
|
}
|
|
7024
7044
|
}
|
|
7025
7045
|
|
|
7026
|
-
const version = "2.2.
|
|
7046
|
+
const version = "2.2.7";
|
|
7027
7047
|
|
|
7028
7048
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
7029
7049
|
get allowBackgroundColor() {
|
|
@@ -7316,6 +7336,7 @@ class Watcher {
|
|
|
7316
7336
|
}
|
|
7317
7337
|
constructor(target, userConfig) {
|
|
7318
7338
|
this.totalTimes = 0;
|
|
7339
|
+
this.changed = 0;
|
|
7319
7340
|
this.config = {};
|
|
7320
7341
|
this.__updatedList = new LeafList;
|
|
7321
7342
|
this.target = target;
|
|
@@ -7335,8 +7356,10 @@ class Watcher {
|
|
|
7335
7356
|
this.disabled = true;
|
|
7336
7357
|
}
|
|
7337
7358
|
update() {
|
|
7338
|
-
this.changed
|
|
7339
|
-
|
|
7359
|
+
if (this.changed < 100) {
|
|
7360
|
+
this.changed++;
|
|
7361
|
+
if (this.running) this.target.emit(RenderEvent.REQUEST);
|
|
7362
|
+
}
|
|
7340
7363
|
}
|
|
7341
7364
|
__onAttrChange(event) {
|
|
7342
7365
|
this.add(event.target);
|
|
@@ -7345,18 +7368,21 @@ class Watcher {
|
|
|
7345
7368
|
if (this.config.usePartLayout) this.__updatedList.add(leaf);
|
|
7346
7369
|
this.update();
|
|
7347
7370
|
}
|
|
7348
|
-
|
|
7371
|
+
addChild(child, parent, eventType) {
|
|
7349
7372
|
if (this.config.usePartLayout) {
|
|
7350
|
-
if (
|
|
7373
|
+
if (eventType === ChildEvent.ADD) {
|
|
7351
7374
|
this.hasAdd = true;
|
|
7352
|
-
this.__pushChild(
|
|
7375
|
+
this.__pushChild(child);
|
|
7353
7376
|
} else {
|
|
7354
7377
|
this.hasRemove = true;
|
|
7355
|
-
this.__updatedList.add(
|
|
7378
|
+
this.__updatedList.add(parent);
|
|
7356
7379
|
}
|
|
7357
7380
|
}
|
|
7358
7381
|
this.update();
|
|
7359
7382
|
}
|
|
7383
|
+
__onChildEvent(event) {
|
|
7384
|
+
this.addChild(event.child, event.parent, event.type);
|
|
7385
|
+
}
|
|
7360
7386
|
__pushChild(child) {
|
|
7361
7387
|
this.__updatedList.add(child);
|
|
7362
7388
|
if (child.isBranch) this.__loopChildren(child);
|
|
@@ -7371,7 +7397,8 @@ class Watcher {
|
|
|
7371
7397
|
}));
|
|
7372
7398
|
this.__updatedList = new LeafList;
|
|
7373
7399
|
this.totalTimes++;
|
|
7374
|
-
this.
|
|
7400
|
+
this.hasVisible = this.hasRemove = this.hasAdd = false;
|
|
7401
|
+
this.changed = 0;
|
|
7375
7402
|
}
|
|
7376
7403
|
__listenEvents() {
|
|
7377
7404
|
this.__eventIds = [ this.target.on_([ [ PropertyEvent.CHANGE, this.__onAttrChange, this ], [ [ ChildEvent.ADD, ChildEvent.REMOVE ], this.__onChildEvent, this ], [ WatchEvent.REQUEST, this.__onRquestData, this ] ]) ];
|
|
@@ -7392,47 +7419,57 @@ const {updateAllMatrix: updateAllMatrix$1, updateBounds: updateOneBounds, update
|
|
|
7392
7419
|
|
|
7393
7420
|
const {pushAllChildBranch: pushAllChildBranch, pushAllParent: pushAllParent} = BranchHelper;
|
|
7394
7421
|
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
if (
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
if (
|
|
7408
|
-
|
|
7422
|
+
const LayouterHelper = {
|
|
7423
|
+
updateMatrix(updateList, levelList) {
|
|
7424
|
+
let index = 0, leaf, layout;
|
|
7425
|
+
const {list: list} = updateList;
|
|
7426
|
+
while (index < list.length) {
|
|
7427
|
+
leaf = list[index];
|
|
7428
|
+
layout = leaf.__layout;
|
|
7429
|
+
if (levelList.without(leaf) && !layout.proxyZoom) {
|
|
7430
|
+
if (layout.matrixChanged) {
|
|
7431
|
+
updateAllMatrix$1(leaf, true);
|
|
7432
|
+
if (leaf.isBranch) pushAllChildBranch(leaf, levelList);
|
|
7433
|
+
push(leaf, levelList);
|
|
7434
|
+
} else if (layout.boundsChanged) {
|
|
7435
|
+
if (leaf.isBranch) leaf.__tempNumber = 0;
|
|
7436
|
+
push(leaf, levelList);
|
|
7437
|
+
}
|
|
7409
7438
|
}
|
|
7439
|
+
index++;
|
|
7410
7440
|
}
|
|
7411
|
-
}
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7441
|
+
},
|
|
7442
|
+
updateBounds(boundsList) {
|
|
7443
|
+
let index = 0, level, list, branch, children;
|
|
7444
|
+
const {levels: levels, levelMap: levelMap} = boundsList;
|
|
7445
|
+
boundsList.sort(true);
|
|
7446
|
+
while (index < levels.length) {
|
|
7447
|
+
level = levels[index];
|
|
7448
|
+
list = levelMap[level];
|
|
7449
|
+
for (let i = 0, len = list.length; i < len; i++) {
|
|
7450
|
+
branch = list[i];
|
|
7451
|
+
if (branch.isBranch && branch.__tempNumber) {
|
|
7452
|
+
children = branch.children;
|
|
7453
|
+
for (let j = 0, jLen = children.length; j < jLen; j++) {
|
|
7454
|
+
if (!children[j].isBranch) {
|
|
7455
|
+
updateOneBounds(children[j]);
|
|
7456
|
+
}
|
|
7426
7457
|
}
|
|
7427
7458
|
}
|
|
7459
|
+
updateOneBounds(branch);
|
|
7428
7460
|
}
|
|
7429
|
-
|
|
7461
|
+
index++;
|
|
7430
7462
|
}
|
|
7431
|
-
}
|
|
7432
|
-
|
|
7463
|
+
},
|
|
7464
|
+
updateChange(updateList) {
|
|
7465
|
+
updateList.list.forEach(updateOneChange);
|
|
7466
|
+
},
|
|
7467
|
+
push: push
|
|
7468
|
+
};
|
|
7433
7469
|
|
|
7434
|
-
function
|
|
7435
|
-
|
|
7470
|
+
function push(leaf, levelList) {
|
|
7471
|
+
levelList.add(leaf);
|
|
7472
|
+
pushAllParent(leaf, levelList);
|
|
7436
7473
|
}
|
|
7437
7474
|
|
|
7438
7475
|
const {worldBounds: worldBounds} = LeafBoundsHelper;
|
|
@@ -7539,9 +7576,9 @@ class Layouter {
|
|
|
7539
7576
|
target.emitEvent(new LayoutEvent(BEFORE, blocks, this.times));
|
|
7540
7577
|
this.extraBlock = null;
|
|
7541
7578
|
updateList.sort();
|
|
7542
|
-
updateMatrix(updateList, this.__levelList);
|
|
7543
|
-
updateBounds(this.__levelList);
|
|
7544
|
-
updateChange(updateList);
|
|
7579
|
+
LayouterHelper.updateMatrix(updateList, this.__levelList);
|
|
7580
|
+
LayouterHelper.updateBounds(this.__levelList);
|
|
7581
|
+
LayouterHelper.updateChange(updateList);
|
|
7545
7582
|
if (this.extraBlock) blocks.push(this.extraBlock);
|
|
7546
7583
|
blocks.forEach(item => item.setAfter());
|
|
7547
7584
|
target.emitEvent(new LayoutEvent(LAYOUT, blocks, this.times));
|
|
@@ -7571,11 +7608,16 @@ class Layouter {
|
|
|
7571
7608
|
if (target.isBranch) BranchHelper.updateBounds(target); else LeafHelper.updateBounds(target);
|
|
7572
7609
|
updateAllChange(target);
|
|
7573
7610
|
}
|
|
7574
|
-
addExtra(leaf) {
|
|
7611
|
+
addExtra(leaf, updateBounds) {
|
|
7575
7612
|
if (!this.__updatedList.has(leaf)) {
|
|
7576
7613
|
const {updatedList: updatedList, beforeBounds: beforeBounds} = this.extraBlock || (this.extraBlock = new LayoutBlockData([]));
|
|
7577
7614
|
updatedList.length ? beforeBounds.add(leaf.__world) : beforeBounds.set(leaf.__world);
|
|
7578
7615
|
updatedList.add(leaf);
|
|
7616
|
+
if (updateBounds) {
|
|
7617
|
+
const list = this.__levelList;
|
|
7618
|
+
LayouterHelper.push(leaf, list);
|
|
7619
|
+
list.sort(true);
|
|
7620
|
+
}
|
|
7579
7621
|
}
|
|
7580
7622
|
}
|
|
7581
7623
|
createBlock(data) {
|
|
@@ -8327,7 +8369,7 @@ const UIRender = {
|
|
|
8327
8369
|
}
|
|
8328
8370
|
if (data.__useEffect) {
|
|
8329
8371
|
const {shadow: shadow, fill: fill, stroke: stroke} = data, otherEffect = data.innerShadow || data.blur || data.backgroundBlur || data.filter;
|
|
8330
|
-
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"));
|
|
8372
|
+
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"));
|
|
8331
8373
|
data.__useEffect = !!(shadow || otherEffect);
|
|
8332
8374
|
}
|
|
8333
8375
|
data.__checkSingle();
|
|
@@ -8822,6 +8864,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8822
8864
|
start: true,
|
|
8823
8865
|
hittable: true,
|
|
8824
8866
|
smooth: true,
|
|
8867
|
+
trackChanges: true,
|
|
8825
8868
|
lazySpeard: 100
|
|
8826
8869
|
};
|
|
8827
8870
|
this.leafs = 0;
|
|
@@ -9385,7 +9428,7 @@ let Polygon = class Polygon extends UI {
|
|
|
9385
9428
|
const data = this.__;
|
|
9386
9429
|
const path = data.path = [];
|
|
9387
9430
|
if (data.points) {
|
|
9388
|
-
drawPoints$1(path, data.points, data.curve, data.closed);
|
|
9431
|
+
drawPoints$1(path, data.points, data.curve, data.closed, data);
|
|
9389
9432
|
} else {
|
|
9390
9433
|
const {width: width, height: height, sides: sides, startAngle: startAngle} = data;
|
|
9391
9434
|
const rx = width / 2, ry = height / 2;
|
|
@@ -9477,7 +9520,7 @@ let Line = class Line extends UI {
|
|
|
9477
9520
|
const data = this.__;
|
|
9478
9521
|
const path = data.path = [];
|
|
9479
9522
|
if (data.points) {
|
|
9480
|
-
drawPoints(path, data.points, data.curve, data.closed);
|
|
9523
|
+
drawPoints(path, data.points, data.curve, data.closed, data);
|
|
9481
9524
|
} else {
|
|
9482
9525
|
moveTo(path, 0, 0);
|
|
9483
9526
|
lineTo(path, this.width, 0);
|
|
@@ -10223,7 +10266,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
|
|
|
10223
10266
|
data.__naturalHeight = image.height / data.pixelRatio;
|
|
10224
10267
|
if (data.__autoSide) {
|
|
10225
10268
|
ui.forceUpdate();
|
|
10226
|
-
LeafHelper.updateBounds(ui);
|
|
10269
|
+
LeafHelper.updateBounds(ui, true);
|
|
10227
10270
|
ui.__layout.boundsChanged = true;
|
|
10228
10271
|
if (ui.__proxyData) {
|
|
10229
10272
|
ui.setProxyAttr("width", data.width);
|
|
@@ -11498,4 +11541,4 @@ try {
|
|
|
11498
11541
|
if (wx) useCanvas("miniapp", wx);
|
|
11499
11542
|
} catch (_a) {}
|
|
11500
11543
|
|
|
11501
|
-
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, doSurfaceType, 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 };
|
|
11544
|
+
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, LayouterHelper, 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, doSurfaceType, 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, registerPointsCurve, 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 };
|