@leafer/core 2.0.1 → 2.0.3
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/lib/core.cjs +114 -38
- package/lib/core.esm.js +111 -39
- package/lib/core.esm.min.js +1 -1
- package/lib/core.esm.min.js.map +1 -1
- package/lib/core.min.cjs +1 -1
- package/lib/core.min.cjs.map +1 -1
- package/package.json +17 -17
- package/src/index.ts +1 -1
- package/types/index.d.ts +1 -1
package/lib/core.cjs
CHANGED
|
@@ -206,6 +206,7 @@ class LeafData {
|
|
|
206
206
|
}
|
|
207
207
|
destroy() {
|
|
208
208
|
this.__input = this.__middle = null;
|
|
209
|
+
if (this.__complexData) this.__complexData.destroy();
|
|
209
210
|
}
|
|
210
211
|
}
|
|
211
212
|
|
|
@@ -304,6 +305,8 @@ const {set: set$1, get: get$1, setTemp: setTemp, toTempAB: toTempAB} = FourNumbe
|
|
|
304
305
|
|
|
305
306
|
const {round: round$3, pow: pow$1, max: max$1, floor: floor$2, PI: PI$1} = Math;
|
|
306
307
|
|
|
308
|
+
const tempScaleData = {};
|
|
309
|
+
|
|
307
310
|
const MathHelper = {
|
|
308
311
|
within(value, min, max) {
|
|
309
312
|
if (isObject(min)) max = min.max, min = min.min;
|
|
@@ -347,6 +350,24 @@ const MathHelper = {
|
|
|
347
350
|
} else if (scale) MathHelper.assignScale(scaleData, scale);
|
|
348
351
|
return scaleData;
|
|
349
352
|
},
|
|
353
|
+
getScaleFixedData(worldScaleData, scaleFixed, unscale, abs, _localScaleData) {
|
|
354
|
+
let {scaleX: scaleX, scaleY: scaleY} = worldScaleData;
|
|
355
|
+
if (abs || scaleFixed) scaleX < 0 && (scaleX = -scaleX), scaleY < 0 && (scaleY = -scaleY);
|
|
356
|
+
if (scaleFixed) {
|
|
357
|
+
if (scaleFixed === true) {
|
|
358
|
+
scaleX = scaleY = unscale ? 1 : 1 / scaleX;
|
|
359
|
+
} else {
|
|
360
|
+
let minScale;
|
|
361
|
+
if (isNumber(scaleFixed)) minScale = scaleFixed; else if (scaleFixed === "zoom-in") minScale = 1;
|
|
362
|
+
if (minScale) {
|
|
363
|
+
if (scaleX > minScale || scaleY > minScale) scaleX = scaleY = unscale ? 1 : 1 / scaleX; else scaleX = scaleY = unscale ? 1 : 1 / minScale;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
tempScaleData.scaleX = scaleX;
|
|
368
|
+
tempScaleData.scaleY = scaleY;
|
|
369
|
+
return tempScaleData;
|
|
370
|
+
},
|
|
350
371
|
assignScale(scaleData, scale) {
|
|
351
372
|
if (isNumber(scale)) {
|
|
352
373
|
scaleData.scaleX = scaleData.scaleY = scale;
|
|
@@ -843,8 +864,8 @@ const PointHelper = {
|
|
|
843
864
|
if (isObject(originPoints[0])) points = [], originPoints.forEach(p => points.push(p.x, p.y));
|
|
844
865
|
return points;
|
|
845
866
|
},
|
|
846
|
-
isSame(t, point) {
|
|
847
|
-
return float$1(t.x) === float$1(point.x) && float$1(t.y) === float$1(point.y);
|
|
867
|
+
isSame(t, point, quick) {
|
|
868
|
+
return quick ? t.x === point.x && t.y === point.y : float$1(t.x) === float$1(point.x) && float$1(t.y) === float$1(point.y);
|
|
848
869
|
},
|
|
849
870
|
reset(t) {
|
|
850
871
|
P$5.reset(t);
|
|
@@ -919,8 +940,8 @@ class Point {
|
|
|
919
940
|
getAtan2(to) {
|
|
920
941
|
return PointHelper.getAtan2(this, to);
|
|
921
942
|
}
|
|
922
|
-
isSame(point) {
|
|
923
|
-
return PointHelper.isSame(this, point);
|
|
943
|
+
isSame(point, quick) {
|
|
944
|
+
return PointHelper.isSame(this, point, quick);
|
|
924
945
|
}
|
|
925
946
|
reset() {
|
|
926
947
|
PointHelper.reset(this);
|
|
@@ -1176,9 +1197,9 @@ const AroundHelper = {
|
|
|
1176
1197
|
}
|
|
1177
1198
|
if (!onlyBoxSize) to.x += box.x, to.y += box.y;
|
|
1178
1199
|
},
|
|
1179
|
-
getPoint(around, box, to) {
|
|
1200
|
+
getPoint(around, box, to, onlyBoxSize = true) {
|
|
1180
1201
|
if (!to) to = {};
|
|
1181
|
-
AroundHelper.toPoint(around, box, to,
|
|
1202
|
+
AroundHelper.toPoint(around, box, to, onlyBoxSize);
|
|
1182
1203
|
return to;
|
|
1183
1204
|
}
|
|
1184
1205
|
};
|
|
@@ -1445,6 +1466,9 @@ const BoundsHelper = {
|
|
|
1445
1466
|
y: y + height
|
|
1446
1467
|
} ];
|
|
1447
1468
|
},
|
|
1469
|
+
getPoint(t, around, onlyBoxSize = false, to) {
|
|
1470
|
+
return AroundHelper.getPoint(around, t, to, onlyBoxSize);
|
|
1471
|
+
},
|
|
1448
1472
|
hitRadiusPoint(t, point, pointMatrix) {
|
|
1449
1473
|
if (pointMatrix) point = PointHelper.tempToInnerRadiusPointOf(point, pointMatrix);
|
|
1450
1474
|
return point.x >= t.x - point.radiusX && point.x <= t.x + t.width + point.radiusX && (point.y >= t.y - point.radiusY && point.y <= t.y + t.height + point.radiusY);
|
|
@@ -1616,6 +1640,9 @@ class Bounds {
|
|
|
1616
1640
|
getPoints() {
|
|
1617
1641
|
return BoundsHelper.getPoints(this);
|
|
1618
1642
|
}
|
|
1643
|
+
getPoint(around, onlyBoxSize, to) {
|
|
1644
|
+
return BoundsHelper.getPoint(this, around, onlyBoxSize, to);
|
|
1645
|
+
}
|
|
1619
1646
|
hitPoint(point, pointMatrix) {
|
|
1620
1647
|
return BoundsHelper.hitPoint(this, point, pointMatrix);
|
|
1621
1648
|
}
|
|
@@ -1890,7 +1917,10 @@ const UICreator = {
|
|
|
1890
1917
|
list$1[tag] = UI;
|
|
1891
1918
|
},
|
|
1892
1919
|
get(tag, data, x, y, width, height) {
|
|
1893
|
-
if (!list$1[tag])
|
|
1920
|
+
if (!list$1[tag]) {
|
|
1921
|
+
debug$9.warn("not register " + tag);
|
|
1922
|
+
return undefined;
|
|
1923
|
+
}
|
|
1894
1924
|
const ui = new list$1[tag](data);
|
|
1895
1925
|
if (!isUndefined(x)) {
|
|
1896
1926
|
ui.x = x;
|
|
@@ -3747,10 +3777,10 @@ function canvasPatch(drawer) {
|
|
|
3747
3777
|
const FileHelper = {
|
|
3748
3778
|
alphaPixelTypes: [ "png", "webp", "svg" ],
|
|
3749
3779
|
upperCaseTypeMap: {},
|
|
3750
|
-
|
|
3751
|
-
if (!type || type.startsWith(
|
|
3780
|
+
mimeType(type, base = "image") {
|
|
3781
|
+
if (!type || type.startsWith(base)) return type;
|
|
3752
3782
|
if (type === "jpg") type = "jpeg";
|
|
3753
|
-
return "
|
|
3783
|
+
return base + "/" + type;
|
|
3754
3784
|
},
|
|
3755
3785
|
fileType(filename) {
|
|
3756
3786
|
const l = filename.split(".");
|
|
@@ -3783,6 +3813,8 @@ const FileHelper = {
|
|
|
3783
3813
|
|
|
3784
3814
|
const F = FileHelper;
|
|
3785
3815
|
|
|
3816
|
+
F.mineType = F.mimeType;
|
|
3817
|
+
|
|
3786
3818
|
F.alphaPixelTypes.forEach(type => F.upperCaseTypeMap[type] = type.toUpperCase());
|
|
3787
3819
|
|
|
3788
3820
|
const debug$4 = Debug.get("TaskProcessor");
|
|
@@ -4027,6 +4059,9 @@ const debug$3 = Debug.get("Resource");
|
|
|
4027
4059
|
|
|
4028
4060
|
const Resource = {
|
|
4029
4061
|
tasker: new TaskProcessor,
|
|
4062
|
+
queue: new TaskProcessor({
|
|
4063
|
+
parallel: 1
|
|
4064
|
+
}),
|
|
4030
4065
|
map: {},
|
|
4031
4066
|
get isComplete() {
|
|
4032
4067
|
return R.tasker.isComplete;
|
|
@@ -4063,6 +4098,12 @@ const Resource = {
|
|
|
4063
4098
|
R.set(key, value);
|
|
4064
4099
|
return value;
|
|
4065
4100
|
},
|
|
4101
|
+
loadFilm(_key, _format) {
|
|
4102
|
+
return undefined;
|
|
4103
|
+
},
|
|
4104
|
+
loadVideo(_key, _format) {
|
|
4105
|
+
return undefined;
|
|
4106
|
+
},
|
|
4066
4107
|
destroy() {
|
|
4067
4108
|
R.map = {};
|
|
4068
4109
|
}
|
|
@@ -4073,16 +4114,15 @@ const R = Resource;
|
|
|
4073
4114
|
const ImageManager = {
|
|
4074
4115
|
maxRecycled: 10,
|
|
4075
4116
|
recycledList: [],
|
|
4076
|
-
patternTasker:
|
|
4077
|
-
|
|
4078
|
-
}),
|
|
4079
|
-
get(config) {
|
|
4117
|
+
patternTasker: Resource.queue,
|
|
4118
|
+
get(config, type) {
|
|
4080
4119
|
let image = Resource.get(config.url);
|
|
4081
|
-
if (!image) Resource.set(config.url, image = Creator.image(config));
|
|
4120
|
+
if (!image) Resource.set(config.url, image = type === "film" ? Creator.film(config) : Creator.image(config));
|
|
4082
4121
|
image.use++;
|
|
4083
4122
|
return image;
|
|
4084
4123
|
},
|
|
4085
4124
|
recycle(image) {
|
|
4125
|
+
if (image.parent) image = image.parent;
|
|
4086
4126
|
image.use--;
|
|
4087
4127
|
setTimeout(() => {
|
|
4088
4128
|
if (!image.use) {
|
|
@@ -4113,7 +4153,7 @@ const ImageManager = {
|
|
|
4113
4153
|
if (config.format) return config.format === format;
|
|
4114
4154
|
const {url: url} = config;
|
|
4115
4155
|
if (url.startsWith("data:")) {
|
|
4116
|
-
if (url.startsWith("data:" + FileHelper.
|
|
4156
|
+
if (url.startsWith("data:" + FileHelper.mimeType(format))) return true;
|
|
4117
4157
|
} else {
|
|
4118
4158
|
if (url.includes("." + format) || url.includes("." + FileHelper.upperCaseTypeMap[format])) return true; else if (format === "png" && !url.includes(".")) return true;
|
|
4119
4159
|
}
|
|
@@ -4129,6 +4169,9 @@ const I = ImageManager;
|
|
|
4129
4169
|
const {IMAGE: IMAGE, create: create$1} = IncrementId;
|
|
4130
4170
|
|
|
4131
4171
|
class LeaferImage {
|
|
4172
|
+
get tag() {
|
|
4173
|
+
return "Image";
|
|
4174
|
+
}
|
|
4132
4175
|
get url() {
|
|
4133
4176
|
return this.config.url;
|
|
4134
4177
|
}
|
|
@@ -4157,7 +4200,7 @@ class LeaferImage {
|
|
|
4157
4200
|
if (!this.loading) {
|
|
4158
4201
|
this.loading = true;
|
|
4159
4202
|
Resource.tasker.add(() => __awaiter(this, void 0, void 0, function*() {
|
|
4160
|
-
return yield Platform.origin.
|
|
4203
|
+
return yield Platform.origin["load" + this.tag](this.getLoadUrl(thumbSize), this.crossOrigin, this).then(img => {
|
|
4161
4204
|
if (thumbSize) this.setThumbView(img);
|
|
4162
4205
|
this.setView(img);
|
|
4163
4206
|
}).catch(e => {
|
|
@@ -4231,6 +4274,9 @@ class LeaferImage {
|
|
|
4231
4274
|
Platform.image.setPatternTransform(pattern, transform, paint);
|
|
4232
4275
|
return pattern;
|
|
4233
4276
|
}
|
|
4277
|
+
render(canvas, x, y, width, height, _leaf, _paint, _imageScaleX, _imageScaleY) {
|
|
4278
|
+
canvas.drawImage(this.view, x, y, width, height);
|
|
4279
|
+
}
|
|
4234
4280
|
getLoadUrl(_thumbSize) {
|
|
4235
4281
|
return this.url;
|
|
4236
4282
|
}
|
|
@@ -4245,8 +4291,10 @@ class LeaferImage {
|
|
|
4245
4291
|
return undefined;
|
|
4246
4292
|
}
|
|
4247
4293
|
clearLevels(_checkUse) {}
|
|
4294
|
+
destroyFilter() {}
|
|
4248
4295
|
destroy() {
|
|
4249
4296
|
this.clearLevels();
|
|
4297
|
+
this.destroyFilter();
|
|
4250
4298
|
const {view: view} = this;
|
|
4251
4299
|
if (view && view.close) view.close();
|
|
4252
4300
|
this.config = {
|
|
@@ -4257,6 +4305,18 @@ class LeaferImage {
|
|
|
4257
4305
|
}
|
|
4258
4306
|
}
|
|
4259
4307
|
|
|
4308
|
+
class LeaferFilm extends LeaferImage {
|
|
4309
|
+
get tag() {
|
|
4310
|
+
return "Film";
|
|
4311
|
+
}
|
|
4312
|
+
}
|
|
4313
|
+
|
|
4314
|
+
class LeaferVideo extends LeaferImage {
|
|
4315
|
+
get tag() {
|
|
4316
|
+
return "Video";
|
|
4317
|
+
}
|
|
4318
|
+
}
|
|
4319
|
+
|
|
4260
4320
|
function defineKey(target, key, descriptor, noConfigurable) {
|
|
4261
4321
|
if (!noConfigurable) descriptor.configurable = descriptor.enumerable = true;
|
|
4262
4322
|
Object.defineProperty(target, key, descriptor);
|
|
@@ -4431,7 +4491,6 @@ function dimType(defaultValue) {
|
|
|
4431
4491
|
if (this.__setAttr(key, value)) {
|
|
4432
4492
|
const data = this.__;
|
|
4433
4493
|
DataHelper.stintSet(data, "__useDim", data.dim || data.bright || data.dimskip);
|
|
4434
|
-
this.__layout.surfaceChange();
|
|
4435
4494
|
}
|
|
4436
4495
|
}
|
|
4437
4496
|
}));
|
|
@@ -4481,7 +4540,6 @@ function sortType(defaultValue) {
|
|
|
4481
4540
|
return decorateLeafAttr(defaultValue, key => attr({
|
|
4482
4541
|
set(value) {
|
|
4483
4542
|
if (this.__setAttr(key, value)) {
|
|
4484
|
-
this.__layout.surfaceChange();
|
|
4485
4543
|
this.waitParent(() => {
|
|
4486
4544
|
this.parent.__layout.childrenSortChange();
|
|
4487
4545
|
});
|
|
@@ -4518,7 +4576,6 @@ function hitType(defaultValue) {
|
|
|
4518
4576
|
set(value) {
|
|
4519
4577
|
if (this.__setAttr(key, value)) {
|
|
4520
4578
|
this.__layout.hitCanvasChanged = true;
|
|
4521
|
-
if (Debug.showBounds === "hit") this.__layout.surfaceChange();
|
|
4522
4579
|
if (this.leafer) this.leafer.updateCursor();
|
|
4523
4580
|
}
|
|
4524
4581
|
}
|
|
@@ -4724,6 +4781,10 @@ const LeafHelper = {
|
|
|
4724
4781
|
if (layout.stateStyleChanged) leaf.updateState();
|
|
4725
4782
|
if (layout.opacityChanged) updateAllWorldOpacity(leaf);
|
|
4726
4783
|
leaf.__updateChange();
|
|
4784
|
+
if (layout.surfaceChanged) {
|
|
4785
|
+
if (leaf.__hasComplex) L.updateComplex(leaf);
|
|
4786
|
+
layout.surfaceChanged = false;
|
|
4787
|
+
}
|
|
4727
4788
|
},
|
|
4728
4789
|
updateAllChange(leaf) {
|
|
4729
4790
|
updateChange(leaf);
|
|
@@ -4748,6 +4809,9 @@ const LeafHelper = {
|
|
|
4748
4809
|
if (!fromWorld) fromWorld = leaf.__nowWorld;
|
|
4749
4810
|
if (leaf.__worldFlipped || Platform.fullImageShadow) currentCanvas.copyWorldByReset(fromCanvas, fromWorld, leaf.__nowWorld, blendMode, onlyResetTransform); else currentCanvas.copyWorldToInner(fromCanvas, fromWorld, leaf.__layout.renderBounds, blendMode);
|
|
4750
4811
|
},
|
|
4812
|
+
renderComplex(_leaf, _canvas, _options) {},
|
|
4813
|
+
updateComplex(_leaf) {},
|
|
4814
|
+
checkComplex(_leaf) {},
|
|
4751
4815
|
moveWorld(t, x, y = 0, isInnerPoint, transition) {
|
|
4752
4816
|
const local = isObject(x) ? Object.assign({}, x) : {
|
|
4753
4817
|
x: x,
|
|
@@ -4859,6 +4923,9 @@ const LeafHelper = {
|
|
|
4859
4923
|
divideParent(matrix, relative.scrollWorldTransform);
|
|
4860
4924
|
return temp ? matrix : Object.assign({}, matrix);
|
|
4861
4925
|
},
|
|
4926
|
+
updateScaleFixedWorld(_t) {},
|
|
4927
|
+
updateOuterBounds(_t) {},
|
|
4928
|
+
cacheId(_t) {},
|
|
4862
4929
|
drop(t, parent, index, resize) {
|
|
4863
4930
|
t.setTransform(L.getRelativeWorld(t, parent, true), resize);
|
|
4864
4931
|
parent.add(t, index);
|
|
@@ -4909,7 +4976,8 @@ const LeafBoundsHelper = {
|
|
|
4909
4976
|
return target.__.eraser || target.__.visible === 0 ? null : target.__layout.localStrokeBounds;
|
|
4910
4977
|
},
|
|
4911
4978
|
localRenderBounds(target) {
|
|
4912
|
-
|
|
4979
|
+
const {__: __, __layout: __layout} = target;
|
|
4980
|
+
return __.eraser || __.visible === 0 ? null : __layout.localOuterBounds || __layout.localRenderBounds;
|
|
4913
4981
|
},
|
|
4914
4982
|
maskLocalBoxBounds(target, index) {
|
|
4915
4983
|
return checkMask(target, index) && target.__localBoxBounds;
|
|
@@ -4918,7 +4986,8 @@ const LeafBoundsHelper = {
|
|
|
4918
4986
|
return checkMask(target, index) && target.__layout.localStrokeBounds;
|
|
4919
4987
|
},
|
|
4920
4988
|
maskLocalRenderBounds(target, index) {
|
|
4921
|
-
|
|
4989
|
+
const {__layout: __layout} = target;
|
|
4990
|
+
return checkMask(target, index) && (__layout.localOuterBounds || __layout.localRenderBounds);
|
|
4922
4991
|
},
|
|
4923
4992
|
excludeRenderBounds(child, options) {
|
|
4924
4993
|
if (options.bounds && !options.bounds.hit(child.__world, options.matrix)) return true;
|
|
@@ -5438,7 +5507,6 @@ class LeafLayout {
|
|
|
5438
5507
|
}
|
|
5439
5508
|
opacityChange() {
|
|
5440
5509
|
this.opacityChanged = true;
|
|
5441
|
-
this.surfaceChanged || this.surfaceChange();
|
|
5442
5510
|
}
|
|
5443
5511
|
childrenSortChange() {
|
|
5444
5512
|
if (!this.childrenSortChanged) {
|
|
@@ -5931,6 +5999,7 @@ const LeafMatrix = {
|
|
|
5931
5999
|
const {parent: parent, __layout: __layout, __world: __world, __scrollWorld: __scrollWorld, __: __} = this;
|
|
5932
6000
|
multiplyParent$1(this.__local || __layout, parent ? parent.__scrollWorld || parent.__world : defaultWorld, __world, !!__layout.affectScaleOrRotation, __);
|
|
5933
6001
|
if (__scrollWorld) translateInner(Object.assign(__scrollWorld, __world), __.scrollX, __.scrollY);
|
|
6002
|
+
if (__layout.scaleFixed) LeafHelper.updateScaleFixedWorld(this);
|
|
5934
6003
|
},
|
|
5935
6004
|
__updateLocalMatrix() {
|
|
5936
6005
|
if (this.__local) {
|
|
@@ -5964,6 +6033,7 @@ const LeafBounds = {
|
|
|
5964
6033
|
__updateWorldBounds() {
|
|
5965
6034
|
const {__layout: __layout, __world: __world} = this;
|
|
5966
6035
|
toOuterOf$1(__layout.renderBounds, __world, __world);
|
|
6036
|
+
if (this.__hasComplex) LeafHelper.checkComplex(this);
|
|
5967
6037
|
if (__layout.resized) {
|
|
5968
6038
|
if (__layout.resized === "inner") this.__onUpdateSize();
|
|
5969
6039
|
if (this.__hasLocalEvent) BoundsEvent.emitLocal(this);
|
|
@@ -6013,6 +6083,7 @@ const LeafBounds = {
|
|
|
6013
6083
|
layout.renderChanged = undefined;
|
|
6014
6084
|
if (this.parent) this.parent.__layout.renderChange();
|
|
6015
6085
|
}
|
|
6086
|
+
if (layout.outerScale) LeafHelper.updateOuterBounds(this);
|
|
6016
6087
|
layout.resized || (layout.resized = "local");
|
|
6017
6088
|
layout.boundsChanged = undefined;
|
|
6018
6089
|
},
|
|
@@ -6079,7 +6150,7 @@ const LeafRender = {
|
|
|
6079
6150
|
const data = this.__;
|
|
6080
6151
|
if (data.bright && !options.topRendering) return options.topList.add(this);
|
|
6081
6152
|
canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
|
|
6082
|
-
canvas.opacity = options.dimOpacity && !data.dimskip ? data.opacity * options.dimOpacity : data.opacity;
|
|
6153
|
+
canvas.opacity = options.ignoreOpacity ? 1 : options.dimOpacity && !data.dimskip ? data.opacity * options.dimOpacity : data.opacity;
|
|
6083
6154
|
if (this.__.__single) {
|
|
6084
6155
|
if (data.eraser === "path") return this.__renderEraser(canvas, options);
|
|
6085
6156
|
const tempCanvas = canvas.getSameCanvas(true, true);
|
|
@@ -6133,7 +6204,7 @@ const BranchRender = {
|
|
|
6133
6204
|
if (data.eraser === "path") return this.__renderEraser(canvas, options);
|
|
6134
6205
|
const tempCanvas = canvas.getSameCanvas(false, true);
|
|
6135
6206
|
this.__renderBranch(tempCanvas, options);
|
|
6136
|
-
canvas.opacity = options.dimOpacity ? data.opacity * options.dimOpacity : data.opacity;
|
|
6207
|
+
canvas.opacity = options.ignoreOpacity ? 1 : options.dimOpacity ? data.opacity * options.dimOpacity : data.opacity;
|
|
6137
6208
|
canvas.copyWorldByReset(tempCanvas, nowWorld, nowWorld, data.__blendMode, true);
|
|
6138
6209
|
tempCanvas.recycle(nowWorld);
|
|
6139
6210
|
} else {
|
|
@@ -6145,9 +6216,11 @@ const BranchRender = {
|
|
|
6145
6216
|
if (this.__hasMask) {
|
|
6146
6217
|
this.__renderMask(canvas, options);
|
|
6147
6218
|
} else {
|
|
6219
|
+
let child;
|
|
6148
6220
|
const {children: children} = this;
|
|
6149
6221
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
6150
|
-
|
|
6222
|
+
child = children[i];
|
|
6223
|
+
excludeRenderBounds(child, options) || (child.__hasComplex ? LeafHelper.renderComplex(child, canvas, options) : child.__render(canvas, options));
|
|
6151
6224
|
}
|
|
6152
6225
|
}
|
|
6153
6226
|
},
|
|
@@ -6161,8 +6234,6 @@ const BranchRender = {
|
|
|
6161
6234
|
}
|
|
6162
6235
|
};
|
|
6163
6236
|
|
|
6164
|
-
const tempScaleData = {};
|
|
6165
|
-
|
|
6166
6237
|
const {LEAF: LEAF, create: create} = IncrementId;
|
|
6167
6238
|
|
|
6168
6239
|
const {stintSet: stintSet} = DataHelper;
|
|
@@ -6173,6 +6244,8 @@ const {toOuterOf: toOuterOf} = BoundsHelper;
|
|
|
6173
6244
|
|
|
6174
6245
|
const {copy: copy, move: move} = PointHelper;
|
|
6175
6246
|
|
|
6247
|
+
const {getScaleFixedData: getScaleFixedData} = MathHelper;
|
|
6248
|
+
|
|
6176
6249
|
const {moveLocal: moveLocal, zoomOfLocal: zoomOfLocal, rotateOfLocal: rotateOfLocal, skewOfLocal: skewOfLocal, moveWorld: moveWorld, zoomOfWorld: zoomOfWorld, rotateOfWorld: rotateOfWorld, skewOfWorld: skewOfWorld, transform: transform, transformWorld: transformWorld, setTransform: setTransform, getFlipTransform: getFlipTransform, getLocalOrigin: getLocalOrigin, getRelativeWorld: getRelativeWorld, drop: drop} = LeafHelper;
|
|
6177
6250
|
|
|
6178
6251
|
exports.Leaf = class Leaf {
|
|
@@ -6331,6 +6404,7 @@ exports.Leaf = class Leaf {
|
|
|
6331
6404
|
this.__level = this.parent ? this.parent.__level + 1 : 1;
|
|
6332
6405
|
if (this.animation) this.__runAnimation("in");
|
|
6333
6406
|
if (this.__bubbleMap) this.__emitLifeEvent(ChildEvent.MOUNTED);
|
|
6407
|
+
if (leafer.cacheId) LeafHelper.cacheId(this);
|
|
6334
6408
|
} else {
|
|
6335
6409
|
this.__emitLifeEvent(ChildEvent.UNMOUNTED);
|
|
6336
6410
|
}
|
|
@@ -6460,13 +6534,8 @@ exports.Leaf = class Leaf {
|
|
|
6460
6534
|
if (scaleX < 0) scaleX = -scaleX;
|
|
6461
6535
|
return scaleX > 1 ? scaleX : 1;
|
|
6462
6536
|
}
|
|
6463
|
-
getRenderScaleData(abs, scaleFixed) {
|
|
6464
|
-
|
|
6465
|
-
if (abs) scaleX < 0 && (scaleX = -scaleX), scaleY < 0 && (scaleY = -scaleY);
|
|
6466
|
-
if (scaleFixed === true || scaleFixed === "zoom-in" && scaleX > 1 && scaleY > 1) scaleX = scaleY = 1;
|
|
6467
|
-
tempScaleData.scaleX = scaleX;
|
|
6468
|
-
tempScaleData.scaleY = scaleY;
|
|
6469
|
-
return tempScaleData;
|
|
6537
|
+
getRenderScaleData(abs, scaleFixed, unscale = true) {
|
|
6538
|
+
return getScaleFixedData(ImageManager.patternLocked ? this.__world : this.__nowWorld || this.__world, scaleFixed, unscale, abs);
|
|
6470
6539
|
}
|
|
6471
6540
|
getTransform(relative) {
|
|
6472
6541
|
return this.__layout.getTransform(relative || "local");
|
|
@@ -6638,7 +6707,7 @@ exports.Leaf = class Leaf {
|
|
|
6638
6707
|
__drawPath(_canvas) {}
|
|
6639
6708
|
__drawRenderPath(_canvas) {}
|
|
6640
6709
|
__updatePath() {}
|
|
6641
|
-
__updateRenderPath() {}
|
|
6710
|
+
__updateRenderPath(_updateCache) {}
|
|
6642
6711
|
getMotionPathData() {
|
|
6643
6712
|
return Plugin.need("path");
|
|
6644
6713
|
}
|
|
@@ -6712,9 +6781,11 @@ exports.Branch = class Branch extends exports.Leaf {
|
|
|
6712
6781
|
return 0;
|
|
6713
6782
|
}
|
|
6714
6783
|
__updateRenderSpread() {
|
|
6784
|
+
let layout;
|
|
6715
6785
|
const {children: children} = this;
|
|
6716
6786
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
6717
|
-
|
|
6787
|
+
layout = children[i].__layout;
|
|
6788
|
+
if (layout.renderSpread || layout.localOuterBounds) return 1;
|
|
6718
6789
|
}
|
|
6719
6790
|
return 0;
|
|
6720
6791
|
}
|
|
@@ -6747,6 +6818,7 @@ exports.Branch = class Branch extends exports.Leaf {
|
|
|
6747
6818
|
this.add(item, index);
|
|
6748
6819
|
noIndex || index++;
|
|
6749
6820
|
}); else child = UICreator.get(child.tag, child);
|
|
6821
|
+
if (!child) return;
|
|
6750
6822
|
}
|
|
6751
6823
|
if (child.parent) child.parent.remove(child);
|
|
6752
6824
|
child.parent = this;
|
|
@@ -6972,7 +7044,7 @@ class LeafLevelList {
|
|
|
6972
7044
|
}
|
|
6973
7045
|
}
|
|
6974
7046
|
|
|
6975
|
-
const version = "2.0.
|
|
7047
|
+
const version = "2.0.3";
|
|
6976
7048
|
|
|
6977
7049
|
exports.AlignHelper = AlignHelper;
|
|
6978
7050
|
|
|
@@ -7048,8 +7120,12 @@ exports.LeaferCanvasBase = LeaferCanvasBase;
|
|
|
7048
7120
|
|
|
7049
7121
|
exports.LeaferEvent = LeaferEvent;
|
|
7050
7122
|
|
|
7123
|
+
exports.LeaferFilm = LeaferFilm;
|
|
7124
|
+
|
|
7051
7125
|
exports.LeaferImage = LeaferImage;
|
|
7052
7126
|
|
|
7127
|
+
exports.LeaferVideo = LeaferVideo;
|
|
7128
|
+
|
|
7053
7129
|
exports.MathHelper = MathHelper;
|
|
7054
7130
|
|
|
7055
7131
|
exports.Matrix = Matrix;
|