@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.module.js
CHANGED
|
@@ -1904,7 +1904,7 @@ function getNameList(name) {
|
|
|
1904
1904
|
|
|
1905
1905
|
const D$4 = Debug;
|
|
1906
1906
|
|
|
1907
|
-
const debug$
|
|
1907
|
+
const debug$f = Debug.get("RunTime");
|
|
1908
1908
|
|
|
1909
1909
|
const Run = {
|
|
1910
1910
|
currentId: 0,
|
|
@@ -1923,7 +1923,7 @@ const Run = {
|
|
|
1923
1923
|
const time = R$1.idMap[id], name = R$1.nameMap[id];
|
|
1924
1924
|
const duration = microsecond ? (performance.now() - time) / 1e3 : Date.now() - time;
|
|
1925
1925
|
R$1.idMap[id] = R$1.nameMap[id] = R$1.nameToIdMap[name] = undefined;
|
|
1926
|
-
debug$
|
|
1926
|
+
debug$f.log(name, duration, "ms");
|
|
1927
1927
|
},
|
|
1928
1928
|
endOfName(name, microsecond) {
|
|
1929
1929
|
const id = R$1.nameToIdMap[name];
|
|
@@ -1959,18 +1959,18 @@ const Creator = {
|
|
|
1959
1959
|
}
|
|
1960
1960
|
};
|
|
1961
1961
|
|
|
1962
|
-
const debug$
|
|
1962
|
+
const debug$e = Debug.get("UICreator");
|
|
1963
1963
|
|
|
1964
1964
|
const UICreator = {
|
|
1965
1965
|
list: {},
|
|
1966
1966
|
register(UI) {
|
|
1967
1967
|
const {__tag: tag} = UI.prototype;
|
|
1968
|
-
if (list$1[tag]) debug$
|
|
1968
|
+
if (list$1[tag]) debug$e.repeat(tag);
|
|
1969
1969
|
list$1[tag] = UI;
|
|
1970
1970
|
},
|
|
1971
1971
|
get(tag, data, x, y, width, height) {
|
|
1972
1972
|
if (!list$1[tag]) {
|
|
1973
|
-
debug$
|
|
1973
|
+
debug$e.warn("not register " + tag);
|
|
1974
1974
|
return undefined;
|
|
1975
1975
|
}
|
|
1976
1976
|
const ui = new list$1[tag](data);
|
|
@@ -1986,7 +1986,7 @@ const UICreator = {
|
|
|
1986
1986
|
|
|
1987
1987
|
const {list: list$1} = UICreator;
|
|
1988
1988
|
|
|
1989
|
-
const debug$
|
|
1989
|
+
const debug$d = Debug.get("EventCreator");
|
|
1990
1990
|
|
|
1991
1991
|
const EventCreator = {
|
|
1992
1992
|
nameList: {},
|
|
@@ -1994,7 +1994,7 @@ const EventCreator = {
|
|
|
1994
1994
|
let name;
|
|
1995
1995
|
Object.keys(Event).forEach(key => {
|
|
1996
1996
|
name = Event[key];
|
|
1997
|
-
if (isString(name)) nameList[name] && debug$
|
|
1997
|
+
if (isString(name)) nameList[name] && debug$d.repeat(name), nameList[name] = Event;
|
|
1998
1998
|
});
|
|
1999
1999
|
},
|
|
2000
2000
|
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() {
|
|
@@ -7157,6 +7177,7 @@ class Watcher {
|
|
|
7157
7177
|
}
|
|
7158
7178
|
constructor(target, userConfig) {
|
|
7159
7179
|
this.totalTimes = 0;
|
|
7180
|
+
this.changed = 0;
|
|
7160
7181
|
this.config = {};
|
|
7161
7182
|
this.__updatedList = new LeafList;
|
|
7162
7183
|
this.target = target;
|
|
@@ -7176,8 +7197,10 @@ class Watcher {
|
|
|
7176
7197
|
this.disabled = true;
|
|
7177
7198
|
}
|
|
7178
7199
|
update() {
|
|
7179
|
-
this.changed
|
|
7180
|
-
|
|
7200
|
+
if (this.changed < 100) {
|
|
7201
|
+
this.changed++;
|
|
7202
|
+
if (this.running) this.target.emit(RenderEvent.REQUEST);
|
|
7203
|
+
}
|
|
7181
7204
|
}
|
|
7182
7205
|
__onAttrChange(event) {
|
|
7183
7206
|
this.add(event.target);
|
|
@@ -7186,18 +7209,21 @@ class Watcher {
|
|
|
7186
7209
|
if (this.config.usePartLayout) this.__updatedList.add(leaf);
|
|
7187
7210
|
this.update();
|
|
7188
7211
|
}
|
|
7189
|
-
|
|
7212
|
+
addChild(child, parent, eventType) {
|
|
7190
7213
|
if (this.config.usePartLayout) {
|
|
7191
|
-
if (
|
|
7214
|
+
if (eventType === ChildEvent.ADD) {
|
|
7192
7215
|
this.hasAdd = true;
|
|
7193
|
-
this.__pushChild(
|
|
7216
|
+
this.__pushChild(child);
|
|
7194
7217
|
} else {
|
|
7195
7218
|
this.hasRemove = true;
|
|
7196
|
-
this.__updatedList.add(
|
|
7219
|
+
this.__updatedList.add(parent);
|
|
7197
7220
|
}
|
|
7198
7221
|
}
|
|
7199
7222
|
this.update();
|
|
7200
7223
|
}
|
|
7224
|
+
__onChildEvent(event) {
|
|
7225
|
+
this.addChild(event.child, event.parent, event.type);
|
|
7226
|
+
}
|
|
7201
7227
|
__pushChild(child) {
|
|
7202
7228
|
this.__updatedList.add(child);
|
|
7203
7229
|
if (child.isBranch) this.__loopChildren(child);
|
|
@@ -7212,7 +7238,8 @@ class Watcher {
|
|
|
7212
7238
|
}));
|
|
7213
7239
|
this.__updatedList = new LeafList;
|
|
7214
7240
|
this.totalTimes++;
|
|
7215
|
-
this.
|
|
7241
|
+
this.hasVisible = this.hasRemove = this.hasAdd = false;
|
|
7242
|
+
this.changed = 0;
|
|
7216
7243
|
}
|
|
7217
7244
|
__listenEvents() {
|
|
7218
7245
|
this.__eventIds = [ this.target.on_([ [ PropertyEvent.CHANGE, this.__onAttrChange, this ], [ [ ChildEvent.ADD, ChildEvent.REMOVE ], this.__onChildEvent, this ], [ WatchEvent.REQUEST, this.__onRquestData, this ] ]) ];
|
|
@@ -7233,47 +7260,57 @@ const {updateAllMatrix: updateAllMatrix$1, updateBounds: updateOneBounds, update
|
|
|
7233
7260
|
|
|
7234
7261
|
const {pushAllChildBranch: pushAllChildBranch, pushAllParent: pushAllParent} = BranchHelper;
|
|
7235
7262
|
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
if (
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
if (
|
|
7249
|
-
|
|
7263
|
+
const LayouterHelper = {
|
|
7264
|
+
updateMatrix(updateList, levelList) {
|
|
7265
|
+
let index = 0, leaf, layout;
|
|
7266
|
+
const {list: list} = updateList;
|
|
7267
|
+
while (index < list.length) {
|
|
7268
|
+
leaf = list[index];
|
|
7269
|
+
layout = leaf.__layout;
|
|
7270
|
+
if (levelList.without(leaf) && !layout.proxyZoom) {
|
|
7271
|
+
if (layout.matrixChanged) {
|
|
7272
|
+
updateAllMatrix$1(leaf, true);
|
|
7273
|
+
if (leaf.isBranch) pushAllChildBranch(leaf, levelList);
|
|
7274
|
+
push(leaf, levelList);
|
|
7275
|
+
} else if (layout.boundsChanged) {
|
|
7276
|
+
if (leaf.isBranch) leaf.__tempNumber = 0;
|
|
7277
|
+
push(leaf, levelList);
|
|
7278
|
+
}
|
|
7250
7279
|
}
|
|
7280
|
+
index++;
|
|
7251
7281
|
}
|
|
7252
|
-
}
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7282
|
+
},
|
|
7283
|
+
updateBounds(boundsList) {
|
|
7284
|
+
let index = 0, level, list, branch, children;
|
|
7285
|
+
const {levels: levels, levelMap: levelMap} = boundsList;
|
|
7286
|
+
boundsList.sort(true);
|
|
7287
|
+
while (index < levels.length) {
|
|
7288
|
+
level = levels[index];
|
|
7289
|
+
list = levelMap[level];
|
|
7290
|
+
for (let i = 0, len = list.length; i < len; i++) {
|
|
7291
|
+
branch = list[i];
|
|
7292
|
+
if (branch.isBranch && branch.__tempNumber) {
|
|
7293
|
+
children = branch.children;
|
|
7294
|
+
for (let j = 0, jLen = children.length; j < jLen; j++) {
|
|
7295
|
+
if (!children[j].isBranch) {
|
|
7296
|
+
updateOneBounds(children[j]);
|
|
7297
|
+
}
|
|
7267
7298
|
}
|
|
7268
7299
|
}
|
|
7300
|
+
updateOneBounds(branch);
|
|
7269
7301
|
}
|
|
7270
|
-
|
|
7302
|
+
index++;
|
|
7271
7303
|
}
|
|
7272
|
-
}
|
|
7273
|
-
|
|
7304
|
+
},
|
|
7305
|
+
updateChange(updateList) {
|
|
7306
|
+
updateList.list.forEach(updateOneChange);
|
|
7307
|
+
},
|
|
7308
|
+
push: push
|
|
7309
|
+
};
|
|
7274
7310
|
|
|
7275
|
-
function
|
|
7276
|
-
|
|
7311
|
+
function push(leaf, levelList) {
|
|
7312
|
+
levelList.add(leaf);
|
|
7313
|
+
pushAllParent(leaf, levelList);
|
|
7277
7314
|
}
|
|
7278
7315
|
|
|
7279
7316
|
const {worldBounds: worldBounds} = LeafBoundsHelper;
|
|
@@ -7380,9 +7417,9 @@ class Layouter {
|
|
|
7380
7417
|
target.emitEvent(new LayoutEvent(BEFORE, blocks, this.times));
|
|
7381
7418
|
this.extraBlock = null;
|
|
7382
7419
|
updateList.sort();
|
|
7383
|
-
updateMatrix(updateList, this.__levelList);
|
|
7384
|
-
updateBounds(this.__levelList);
|
|
7385
|
-
updateChange(updateList);
|
|
7420
|
+
LayouterHelper.updateMatrix(updateList, this.__levelList);
|
|
7421
|
+
LayouterHelper.updateBounds(this.__levelList);
|
|
7422
|
+
LayouterHelper.updateChange(updateList);
|
|
7386
7423
|
if (this.extraBlock) blocks.push(this.extraBlock);
|
|
7387
7424
|
blocks.forEach(item => item.setAfter());
|
|
7388
7425
|
target.emitEvent(new LayoutEvent(LAYOUT, blocks, this.times));
|
|
@@ -7412,11 +7449,16 @@ class Layouter {
|
|
|
7412
7449
|
if (target.isBranch) BranchHelper.updateBounds(target); else LeafHelper.updateBounds(target);
|
|
7413
7450
|
updateAllChange(target);
|
|
7414
7451
|
}
|
|
7415
|
-
addExtra(leaf) {
|
|
7452
|
+
addExtra(leaf, updateBounds) {
|
|
7416
7453
|
if (!this.__updatedList.has(leaf)) {
|
|
7417
7454
|
const {updatedList: updatedList, beforeBounds: beforeBounds} = this.extraBlock || (this.extraBlock = new LayoutBlockData([]));
|
|
7418
7455
|
updatedList.length ? beforeBounds.add(leaf.__world) : beforeBounds.set(leaf.__world);
|
|
7419
7456
|
updatedList.add(leaf);
|
|
7457
|
+
if (updateBounds) {
|
|
7458
|
+
const list = this.__levelList;
|
|
7459
|
+
LayouterHelper.push(leaf, list);
|
|
7460
|
+
list.sort(true);
|
|
7461
|
+
}
|
|
7420
7462
|
}
|
|
7421
7463
|
}
|
|
7422
7464
|
createBlock(data) {
|
|
@@ -8168,7 +8210,7 @@ const UIRender = {
|
|
|
8168
8210
|
}
|
|
8169
8211
|
if (data.__useEffect) {
|
|
8170
8212
|
const {shadow: shadow, fill: fill, stroke: stroke} = data, otherEffect = data.innerShadow || data.blur || data.backgroundBlur || data.filter;
|
|
8171
|
-
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"));
|
|
8213
|
+
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"));
|
|
8172
8214
|
data.__useEffect = !!(shadow || otherEffect);
|
|
8173
8215
|
}
|
|
8174
8216
|
data.__checkSingle();
|
|
@@ -8663,6 +8705,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8663
8705
|
start: true,
|
|
8664
8706
|
hittable: true,
|
|
8665
8707
|
smooth: true,
|
|
8708
|
+
trackChanges: true,
|
|
8666
8709
|
lazySpeard: 100
|
|
8667
8710
|
};
|
|
8668
8711
|
this.leafs = 0;
|
|
@@ -9226,7 +9269,7 @@ let Polygon = class Polygon extends UI {
|
|
|
9226
9269
|
const data = this.__;
|
|
9227
9270
|
const path = data.path = [];
|
|
9228
9271
|
if (data.points) {
|
|
9229
|
-
drawPoints$1(path, data.points, data.curve, data.closed);
|
|
9272
|
+
drawPoints$1(path, data.points, data.curve, data.closed, data);
|
|
9230
9273
|
} else {
|
|
9231
9274
|
const {width: width, height: height, sides: sides, startAngle: startAngle} = data;
|
|
9232
9275
|
const rx = width / 2, ry = height / 2;
|
|
@@ -9318,7 +9361,7 @@ let Line = class Line extends UI {
|
|
|
9318
9361
|
const data = this.__;
|
|
9319
9362
|
const path = data.path = [];
|
|
9320
9363
|
if (data.points) {
|
|
9321
|
-
drawPoints(path, data.points, data.curve, data.closed);
|
|
9364
|
+
drawPoints(path, data.points, data.curve, data.closed, data);
|
|
9322
9365
|
} else {
|
|
9323
9366
|
moveTo(path, 0, 0);
|
|
9324
9367
|
lineTo(path, this.width, 0);
|
|
@@ -10064,7 +10107,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
|
|
|
10064
10107
|
data.__naturalHeight = image.height / data.pixelRatio;
|
|
10065
10108
|
if (data.__autoSide) {
|
|
10066
10109
|
ui.forceUpdate();
|
|
10067
|
-
LeafHelper.updateBounds(ui);
|
|
10110
|
+
LeafHelper.updateBounds(ui, true);
|
|
10068
10111
|
ui.__layout.boundsChanged = true;
|
|
10069
10112
|
if (ui.__proxyData) {
|
|
10070
10113
|
ui.setProxyAttr("width", data.width);
|
|
@@ -11337,4 +11380,4 @@ Object.assign(Effect, EffectModule);
|
|
|
11337
11380
|
|
|
11338
11381
|
useCanvas();
|
|
11339
11382
|
|
|
11340
|
-
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 };
|
|
11383
|
+
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 };
|