@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.esm.js
CHANGED
|
@@ -204,6 +204,7 @@ class LeafData {
|
|
|
204
204
|
}
|
|
205
205
|
destroy() {
|
|
206
206
|
this.__input = this.__middle = null;
|
|
207
|
+
if (this.__complexData) this.__complexData.destroy();
|
|
207
208
|
}
|
|
208
209
|
}
|
|
209
210
|
|
|
@@ -302,6 +303,8 @@ const {set: set$1, get: get$1, setTemp: setTemp, toTempAB: toTempAB} = FourNumbe
|
|
|
302
303
|
|
|
303
304
|
const {round: round$3, pow: pow$1, max: max$1, floor: floor$2, PI: PI$1} = Math;
|
|
304
305
|
|
|
306
|
+
const tempScaleData = {};
|
|
307
|
+
|
|
305
308
|
const MathHelper = {
|
|
306
309
|
within(value, min, max) {
|
|
307
310
|
if (isObject(min)) max = min.max, min = min.min;
|
|
@@ -345,6 +348,24 @@ const MathHelper = {
|
|
|
345
348
|
} else if (scale) MathHelper.assignScale(scaleData, scale);
|
|
346
349
|
return scaleData;
|
|
347
350
|
},
|
|
351
|
+
getScaleFixedData(worldScaleData, scaleFixed, unscale, abs, _localScaleData) {
|
|
352
|
+
let {scaleX: scaleX, scaleY: scaleY} = worldScaleData;
|
|
353
|
+
if (abs || scaleFixed) scaleX < 0 && (scaleX = -scaleX), scaleY < 0 && (scaleY = -scaleY);
|
|
354
|
+
if (scaleFixed) {
|
|
355
|
+
if (scaleFixed === true) {
|
|
356
|
+
scaleX = scaleY = unscale ? 1 : 1 / scaleX;
|
|
357
|
+
} else {
|
|
358
|
+
let minScale;
|
|
359
|
+
if (isNumber(scaleFixed)) minScale = scaleFixed; else if (scaleFixed === "zoom-in") minScale = 1;
|
|
360
|
+
if (minScale) {
|
|
361
|
+
if (scaleX > minScale || scaleY > minScale) scaleX = scaleY = unscale ? 1 : 1 / scaleX; else scaleX = scaleY = unscale ? 1 : 1 / minScale;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
tempScaleData.scaleX = scaleX;
|
|
366
|
+
tempScaleData.scaleY = scaleY;
|
|
367
|
+
return tempScaleData;
|
|
368
|
+
},
|
|
348
369
|
assignScale(scaleData, scale) {
|
|
349
370
|
if (isNumber(scale)) {
|
|
350
371
|
scaleData.scaleX = scaleData.scaleY = scale;
|
|
@@ -841,8 +862,8 @@ const PointHelper = {
|
|
|
841
862
|
if (isObject(originPoints[0])) points = [], originPoints.forEach(p => points.push(p.x, p.y));
|
|
842
863
|
return points;
|
|
843
864
|
},
|
|
844
|
-
isSame(t, point) {
|
|
845
|
-
return float$1(t.x) === float$1(point.x) && float$1(t.y) === float$1(point.y);
|
|
865
|
+
isSame(t, point, quick) {
|
|
866
|
+
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);
|
|
846
867
|
},
|
|
847
868
|
reset(t) {
|
|
848
869
|
P$5.reset(t);
|
|
@@ -917,8 +938,8 @@ class Point {
|
|
|
917
938
|
getAtan2(to) {
|
|
918
939
|
return PointHelper.getAtan2(this, to);
|
|
919
940
|
}
|
|
920
|
-
isSame(point) {
|
|
921
|
-
return PointHelper.isSame(this, point);
|
|
941
|
+
isSame(point, quick) {
|
|
942
|
+
return PointHelper.isSame(this, point, quick);
|
|
922
943
|
}
|
|
923
944
|
reset() {
|
|
924
945
|
PointHelper.reset(this);
|
|
@@ -1174,9 +1195,9 @@ const AroundHelper = {
|
|
|
1174
1195
|
}
|
|
1175
1196
|
if (!onlyBoxSize) to.x += box.x, to.y += box.y;
|
|
1176
1197
|
},
|
|
1177
|
-
getPoint(around, box, to) {
|
|
1198
|
+
getPoint(around, box, to, onlyBoxSize = true) {
|
|
1178
1199
|
if (!to) to = {};
|
|
1179
|
-
AroundHelper.toPoint(around, box, to,
|
|
1200
|
+
AroundHelper.toPoint(around, box, to, onlyBoxSize);
|
|
1180
1201
|
return to;
|
|
1181
1202
|
}
|
|
1182
1203
|
};
|
|
@@ -1443,6 +1464,9 @@ const BoundsHelper = {
|
|
|
1443
1464
|
y: y + height
|
|
1444
1465
|
} ];
|
|
1445
1466
|
},
|
|
1467
|
+
getPoint(t, around, onlyBoxSize = false, to) {
|
|
1468
|
+
return AroundHelper.getPoint(around, t, to, onlyBoxSize);
|
|
1469
|
+
},
|
|
1446
1470
|
hitRadiusPoint(t, point, pointMatrix) {
|
|
1447
1471
|
if (pointMatrix) point = PointHelper.tempToInnerRadiusPointOf(point, pointMatrix);
|
|
1448
1472
|
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);
|
|
@@ -1614,6 +1638,9 @@ class Bounds {
|
|
|
1614
1638
|
getPoints() {
|
|
1615
1639
|
return BoundsHelper.getPoints(this);
|
|
1616
1640
|
}
|
|
1641
|
+
getPoint(around, onlyBoxSize, to) {
|
|
1642
|
+
return BoundsHelper.getPoint(this, around, onlyBoxSize, to);
|
|
1643
|
+
}
|
|
1617
1644
|
hitPoint(point, pointMatrix) {
|
|
1618
1645
|
return BoundsHelper.hitPoint(this, point, pointMatrix);
|
|
1619
1646
|
}
|
|
@@ -1888,7 +1915,10 @@ const UICreator = {
|
|
|
1888
1915
|
list$1[tag] = UI;
|
|
1889
1916
|
},
|
|
1890
1917
|
get(tag, data, x, y, width, height) {
|
|
1891
|
-
if (!list$1[tag])
|
|
1918
|
+
if (!list$1[tag]) {
|
|
1919
|
+
debug$9.warn("not register " + tag);
|
|
1920
|
+
return undefined;
|
|
1921
|
+
}
|
|
1892
1922
|
const ui = new list$1[tag](data);
|
|
1893
1923
|
if (!isUndefined(x)) {
|
|
1894
1924
|
ui.x = x;
|
|
@@ -3745,10 +3775,10 @@ function canvasPatch(drawer) {
|
|
|
3745
3775
|
const FileHelper = {
|
|
3746
3776
|
alphaPixelTypes: [ "png", "webp", "svg" ],
|
|
3747
3777
|
upperCaseTypeMap: {},
|
|
3748
|
-
|
|
3749
|
-
if (!type || type.startsWith(
|
|
3778
|
+
mimeType(type, base = "image") {
|
|
3779
|
+
if (!type || type.startsWith(base)) return type;
|
|
3750
3780
|
if (type === "jpg") type = "jpeg";
|
|
3751
|
-
return "
|
|
3781
|
+
return base + "/" + type;
|
|
3752
3782
|
},
|
|
3753
3783
|
fileType(filename) {
|
|
3754
3784
|
const l = filename.split(".");
|
|
@@ -3781,6 +3811,8 @@ const FileHelper = {
|
|
|
3781
3811
|
|
|
3782
3812
|
const F = FileHelper;
|
|
3783
3813
|
|
|
3814
|
+
F.mineType = F.mimeType;
|
|
3815
|
+
|
|
3784
3816
|
F.alphaPixelTypes.forEach(type => F.upperCaseTypeMap[type] = type.toUpperCase());
|
|
3785
3817
|
|
|
3786
3818
|
const debug$4 = Debug.get("TaskProcessor");
|
|
@@ -4025,6 +4057,9 @@ const debug$3 = Debug.get("Resource");
|
|
|
4025
4057
|
|
|
4026
4058
|
const Resource = {
|
|
4027
4059
|
tasker: new TaskProcessor,
|
|
4060
|
+
queue: new TaskProcessor({
|
|
4061
|
+
parallel: 1
|
|
4062
|
+
}),
|
|
4028
4063
|
map: {},
|
|
4029
4064
|
get isComplete() {
|
|
4030
4065
|
return R.tasker.isComplete;
|
|
@@ -4061,6 +4096,12 @@ const Resource = {
|
|
|
4061
4096
|
R.set(key, value);
|
|
4062
4097
|
return value;
|
|
4063
4098
|
},
|
|
4099
|
+
loadFilm(_key, _format) {
|
|
4100
|
+
return undefined;
|
|
4101
|
+
},
|
|
4102
|
+
loadVideo(_key, _format) {
|
|
4103
|
+
return undefined;
|
|
4104
|
+
},
|
|
4064
4105
|
destroy() {
|
|
4065
4106
|
R.map = {};
|
|
4066
4107
|
}
|
|
@@ -4071,16 +4112,15 @@ const R = Resource;
|
|
|
4071
4112
|
const ImageManager = {
|
|
4072
4113
|
maxRecycled: 10,
|
|
4073
4114
|
recycledList: [],
|
|
4074
|
-
patternTasker:
|
|
4075
|
-
|
|
4076
|
-
}),
|
|
4077
|
-
get(config) {
|
|
4115
|
+
patternTasker: Resource.queue,
|
|
4116
|
+
get(config, type) {
|
|
4078
4117
|
let image = Resource.get(config.url);
|
|
4079
|
-
if (!image) Resource.set(config.url, image = Creator.image(config));
|
|
4118
|
+
if (!image) Resource.set(config.url, image = type === "film" ? Creator.film(config) : Creator.image(config));
|
|
4080
4119
|
image.use++;
|
|
4081
4120
|
return image;
|
|
4082
4121
|
},
|
|
4083
4122
|
recycle(image) {
|
|
4123
|
+
if (image.parent) image = image.parent;
|
|
4084
4124
|
image.use--;
|
|
4085
4125
|
setTimeout(() => {
|
|
4086
4126
|
if (!image.use) {
|
|
@@ -4111,7 +4151,7 @@ const ImageManager = {
|
|
|
4111
4151
|
if (config.format) return config.format === format;
|
|
4112
4152
|
const {url: url} = config;
|
|
4113
4153
|
if (url.startsWith("data:")) {
|
|
4114
|
-
if (url.startsWith("data:" + FileHelper.
|
|
4154
|
+
if (url.startsWith("data:" + FileHelper.mimeType(format))) return true;
|
|
4115
4155
|
} else {
|
|
4116
4156
|
if (url.includes("." + format) || url.includes("." + FileHelper.upperCaseTypeMap[format])) return true; else if (format === "png" && !url.includes(".")) return true;
|
|
4117
4157
|
}
|
|
@@ -4127,6 +4167,9 @@ const I = ImageManager;
|
|
|
4127
4167
|
const {IMAGE: IMAGE, create: create$1} = IncrementId;
|
|
4128
4168
|
|
|
4129
4169
|
class LeaferImage {
|
|
4170
|
+
get tag() {
|
|
4171
|
+
return "Image";
|
|
4172
|
+
}
|
|
4130
4173
|
get url() {
|
|
4131
4174
|
return this.config.url;
|
|
4132
4175
|
}
|
|
@@ -4155,7 +4198,7 @@ class LeaferImage {
|
|
|
4155
4198
|
if (!this.loading) {
|
|
4156
4199
|
this.loading = true;
|
|
4157
4200
|
Resource.tasker.add(() => __awaiter(this, void 0, void 0, function*() {
|
|
4158
|
-
return yield Platform.origin.
|
|
4201
|
+
return yield Platform.origin["load" + this.tag](this.getLoadUrl(thumbSize), this.crossOrigin, this).then(img => {
|
|
4159
4202
|
if (thumbSize) this.setThumbView(img);
|
|
4160
4203
|
this.setView(img);
|
|
4161
4204
|
}).catch(e => {
|
|
@@ -4229,6 +4272,9 @@ class LeaferImage {
|
|
|
4229
4272
|
Platform.image.setPatternTransform(pattern, transform, paint);
|
|
4230
4273
|
return pattern;
|
|
4231
4274
|
}
|
|
4275
|
+
render(canvas, x, y, width, height, _leaf, _paint, _imageScaleX, _imageScaleY) {
|
|
4276
|
+
canvas.drawImage(this.view, x, y, width, height);
|
|
4277
|
+
}
|
|
4232
4278
|
getLoadUrl(_thumbSize) {
|
|
4233
4279
|
return this.url;
|
|
4234
4280
|
}
|
|
@@ -4243,8 +4289,10 @@ class LeaferImage {
|
|
|
4243
4289
|
return undefined;
|
|
4244
4290
|
}
|
|
4245
4291
|
clearLevels(_checkUse) {}
|
|
4292
|
+
destroyFilter() {}
|
|
4246
4293
|
destroy() {
|
|
4247
4294
|
this.clearLevels();
|
|
4295
|
+
this.destroyFilter();
|
|
4248
4296
|
const {view: view} = this;
|
|
4249
4297
|
if (view && view.close) view.close();
|
|
4250
4298
|
this.config = {
|
|
@@ -4255,6 +4303,18 @@ class LeaferImage {
|
|
|
4255
4303
|
}
|
|
4256
4304
|
}
|
|
4257
4305
|
|
|
4306
|
+
class LeaferFilm extends LeaferImage {
|
|
4307
|
+
get tag() {
|
|
4308
|
+
return "Film";
|
|
4309
|
+
}
|
|
4310
|
+
}
|
|
4311
|
+
|
|
4312
|
+
class LeaferVideo extends LeaferImage {
|
|
4313
|
+
get tag() {
|
|
4314
|
+
return "Video";
|
|
4315
|
+
}
|
|
4316
|
+
}
|
|
4317
|
+
|
|
4258
4318
|
function defineKey(target, key, descriptor, noConfigurable) {
|
|
4259
4319
|
if (!noConfigurable) descriptor.configurable = descriptor.enumerable = true;
|
|
4260
4320
|
Object.defineProperty(target, key, descriptor);
|
|
@@ -4429,7 +4489,6 @@ function dimType(defaultValue) {
|
|
|
4429
4489
|
if (this.__setAttr(key, value)) {
|
|
4430
4490
|
const data = this.__;
|
|
4431
4491
|
DataHelper.stintSet(data, "__useDim", data.dim || data.bright || data.dimskip);
|
|
4432
|
-
this.__layout.surfaceChange();
|
|
4433
4492
|
}
|
|
4434
4493
|
}
|
|
4435
4494
|
}));
|
|
@@ -4479,7 +4538,6 @@ function sortType(defaultValue) {
|
|
|
4479
4538
|
return decorateLeafAttr(defaultValue, key => attr({
|
|
4480
4539
|
set(value) {
|
|
4481
4540
|
if (this.__setAttr(key, value)) {
|
|
4482
|
-
this.__layout.surfaceChange();
|
|
4483
4541
|
this.waitParent(() => {
|
|
4484
4542
|
this.parent.__layout.childrenSortChange();
|
|
4485
4543
|
});
|
|
@@ -4516,7 +4574,6 @@ function hitType(defaultValue) {
|
|
|
4516
4574
|
set(value) {
|
|
4517
4575
|
if (this.__setAttr(key, value)) {
|
|
4518
4576
|
this.__layout.hitCanvasChanged = true;
|
|
4519
|
-
if (Debug.showBounds === "hit") this.__layout.surfaceChange();
|
|
4520
4577
|
if (this.leafer) this.leafer.updateCursor();
|
|
4521
4578
|
}
|
|
4522
4579
|
}
|
|
@@ -4722,6 +4779,10 @@ const LeafHelper = {
|
|
|
4722
4779
|
if (layout.stateStyleChanged) leaf.updateState();
|
|
4723
4780
|
if (layout.opacityChanged) updateAllWorldOpacity(leaf);
|
|
4724
4781
|
leaf.__updateChange();
|
|
4782
|
+
if (layout.surfaceChanged) {
|
|
4783
|
+
if (leaf.__hasComplex) L.updateComplex(leaf);
|
|
4784
|
+
layout.surfaceChanged = false;
|
|
4785
|
+
}
|
|
4725
4786
|
},
|
|
4726
4787
|
updateAllChange(leaf) {
|
|
4727
4788
|
updateChange(leaf);
|
|
@@ -4746,6 +4807,9 @@ const LeafHelper = {
|
|
|
4746
4807
|
if (!fromWorld) fromWorld = leaf.__nowWorld;
|
|
4747
4808
|
if (leaf.__worldFlipped || Platform.fullImageShadow) currentCanvas.copyWorldByReset(fromCanvas, fromWorld, leaf.__nowWorld, blendMode, onlyResetTransform); else currentCanvas.copyWorldToInner(fromCanvas, fromWorld, leaf.__layout.renderBounds, blendMode);
|
|
4748
4809
|
},
|
|
4810
|
+
renderComplex(_leaf, _canvas, _options) {},
|
|
4811
|
+
updateComplex(_leaf) {},
|
|
4812
|
+
checkComplex(_leaf) {},
|
|
4749
4813
|
moveWorld(t, x, y = 0, isInnerPoint, transition) {
|
|
4750
4814
|
const local = isObject(x) ? Object.assign({}, x) : {
|
|
4751
4815
|
x: x,
|
|
@@ -4857,6 +4921,9 @@ const LeafHelper = {
|
|
|
4857
4921
|
divideParent(matrix, relative.scrollWorldTransform);
|
|
4858
4922
|
return temp ? matrix : Object.assign({}, matrix);
|
|
4859
4923
|
},
|
|
4924
|
+
updateScaleFixedWorld(_t) {},
|
|
4925
|
+
updateOuterBounds(_t) {},
|
|
4926
|
+
cacheId(_t) {},
|
|
4860
4927
|
drop(t, parent, index, resize) {
|
|
4861
4928
|
t.setTransform(L.getRelativeWorld(t, parent, true), resize);
|
|
4862
4929
|
parent.add(t, index);
|
|
@@ -4907,7 +4974,8 @@ const LeafBoundsHelper = {
|
|
|
4907
4974
|
return target.__.eraser || target.__.visible === 0 ? null : target.__layout.localStrokeBounds;
|
|
4908
4975
|
},
|
|
4909
4976
|
localRenderBounds(target) {
|
|
4910
|
-
|
|
4977
|
+
const {__: __, __layout: __layout} = target;
|
|
4978
|
+
return __.eraser || __.visible === 0 ? null : __layout.localOuterBounds || __layout.localRenderBounds;
|
|
4911
4979
|
},
|
|
4912
4980
|
maskLocalBoxBounds(target, index) {
|
|
4913
4981
|
return checkMask(target, index) && target.__localBoxBounds;
|
|
@@ -4916,7 +4984,8 @@ const LeafBoundsHelper = {
|
|
|
4916
4984
|
return checkMask(target, index) && target.__layout.localStrokeBounds;
|
|
4917
4985
|
},
|
|
4918
4986
|
maskLocalRenderBounds(target, index) {
|
|
4919
|
-
|
|
4987
|
+
const {__layout: __layout} = target;
|
|
4988
|
+
return checkMask(target, index) && (__layout.localOuterBounds || __layout.localRenderBounds);
|
|
4920
4989
|
},
|
|
4921
4990
|
excludeRenderBounds(child, options) {
|
|
4922
4991
|
if (options.bounds && !options.bounds.hit(child.__world, options.matrix)) return true;
|
|
@@ -5436,7 +5505,6 @@ class LeafLayout {
|
|
|
5436
5505
|
}
|
|
5437
5506
|
opacityChange() {
|
|
5438
5507
|
this.opacityChanged = true;
|
|
5439
|
-
this.surfaceChanged || this.surfaceChange();
|
|
5440
5508
|
}
|
|
5441
5509
|
childrenSortChange() {
|
|
5442
5510
|
if (!this.childrenSortChanged) {
|
|
@@ -5929,6 +5997,7 @@ const LeafMatrix = {
|
|
|
5929
5997
|
const {parent: parent, __layout: __layout, __world: __world, __scrollWorld: __scrollWorld, __: __} = this;
|
|
5930
5998
|
multiplyParent$1(this.__local || __layout, parent ? parent.__scrollWorld || parent.__world : defaultWorld, __world, !!__layout.affectScaleOrRotation, __);
|
|
5931
5999
|
if (__scrollWorld) translateInner(Object.assign(__scrollWorld, __world), __.scrollX, __.scrollY);
|
|
6000
|
+
if (__layout.scaleFixed) LeafHelper.updateScaleFixedWorld(this);
|
|
5932
6001
|
},
|
|
5933
6002
|
__updateLocalMatrix() {
|
|
5934
6003
|
if (this.__local) {
|
|
@@ -5962,6 +6031,7 @@ const LeafBounds = {
|
|
|
5962
6031
|
__updateWorldBounds() {
|
|
5963
6032
|
const {__layout: __layout, __world: __world} = this;
|
|
5964
6033
|
toOuterOf$1(__layout.renderBounds, __world, __world);
|
|
6034
|
+
if (this.__hasComplex) LeafHelper.checkComplex(this);
|
|
5965
6035
|
if (__layout.resized) {
|
|
5966
6036
|
if (__layout.resized === "inner") this.__onUpdateSize();
|
|
5967
6037
|
if (this.__hasLocalEvent) BoundsEvent.emitLocal(this);
|
|
@@ -6011,6 +6081,7 @@ const LeafBounds = {
|
|
|
6011
6081
|
layout.renderChanged = undefined;
|
|
6012
6082
|
if (this.parent) this.parent.__layout.renderChange();
|
|
6013
6083
|
}
|
|
6084
|
+
if (layout.outerScale) LeafHelper.updateOuterBounds(this);
|
|
6014
6085
|
layout.resized || (layout.resized = "local");
|
|
6015
6086
|
layout.boundsChanged = undefined;
|
|
6016
6087
|
},
|
|
@@ -6077,7 +6148,7 @@ const LeafRender = {
|
|
|
6077
6148
|
const data = this.__;
|
|
6078
6149
|
if (data.bright && !options.topRendering) return options.topList.add(this);
|
|
6079
6150
|
canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
|
|
6080
|
-
canvas.opacity = options.dimOpacity && !data.dimskip ? data.opacity * options.dimOpacity : data.opacity;
|
|
6151
|
+
canvas.opacity = options.ignoreOpacity ? 1 : options.dimOpacity && !data.dimskip ? data.opacity * options.dimOpacity : data.opacity;
|
|
6081
6152
|
if (this.__.__single) {
|
|
6082
6153
|
if (data.eraser === "path") return this.__renderEraser(canvas, options);
|
|
6083
6154
|
const tempCanvas = canvas.getSameCanvas(true, true);
|
|
@@ -6131,7 +6202,7 @@ const BranchRender = {
|
|
|
6131
6202
|
if (data.eraser === "path") return this.__renderEraser(canvas, options);
|
|
6132
6203
|
const tempCanvas = canvas.getSameCanvas(false, true);
|
|
6133
6204
|
this.__renderBranch(tempCanvas, options);
|
|
6134
|
-
canvas.opacity = options.dimOpacity ? data.opacity * options.dimOpacity : data.opacity;
|
|
6205
|
+
canvas.opacity = options.ignoreOpacity ? 1 : options.dimOpacity ? data.opacity * options.dimOpacity : data.opacity;
|
|
6135
6206
|
canvas.copyWorldByReset(tempCanvas, nowWorld, nowWorld, data.__blendMode, true);
|
|
6136
6207
|
tempCanvas.recycle(nowWorld);
|
|
6137
6208
|
} else {
|
|
@@ -6143,9 +6214,11 @@ const BranchRender = {
|
|
|
6143
6214
|
if (this.__hasMask) {
|
|
6144
6215
|
this.__renderMask(canvas, options);
|
|
6145
6216
|
} else {
|
|
6217
|
+
let child;
|
|
6146
6218
|
const {children: children} = this;
|
|
6147
6219
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
6148
|
-
|
|
6220
|
+
child = children[i];
|
|
6221
|
+
excludeRenderBounds(child, options) || (child.__hasComplex ? LeafHelper.renderComplex(child, canvas, options) : child.__render(canvas, options));
|
|
6149
6222
|
}
|
|
6150
6223
|
}
|
|
6151
6224
|
},
|
|
@@ -6159,8 +6232,6 @@ const BranchRender = {
|
|
|
6159
6232
|
}
|
|
6160
6233
|
};
|
|
6161
6234
|
|
|
6162
|
-
const tempScaleData = {};
|
|
6163
|
-
|
|
6164
6235
|
const {LEAF: LEAF, create: create} = IncrementId;
|
|
6165
6236
|
|
|
6166
6237
|
const {stintSet: stintSet} = DataHelper;
|
|
@@ -6171,6 +6242,8 @@ const {toOuterOf: toOuterOf} = BoundsHelper;
|
|
|
6171
6242
|
|
|
6172
6243
|
const {copy: copy, move: move} = PointHelper;
|
|
6173
6244
|
|
|
6245
|
+
const {getScaleFixedData: getScaleFixedData} = MathHelper;
|
|
6246
|
+
|
|
6174
6247
|
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;
|
|
6175
6248
|
|
|
6176
6249
|
let Leaf = class Leaf {
|
|
@@ -6329,6 +6402,7 @@ let Leaf = class Leaf {
|
|
|
6329
6402
|
this.__level = this.parent ? this.parent.__level + 1 : 1;
|
|
6330
6403
|
if (this.animation) this.__runAnimation("in");
|
|
6331
6404
|
if (this.__bubbleMap) this.__emitLifeEvent(ChildEvent.MOUNTED);
|
|
6405
|
+
if (leafer.cacheId) LeafHelper.cacheId(this);
|
|
6332
6406
|
} else {
|
|
6333
6407
|
this.__emitLifeEvent(ChildEvent.UNMOUNTED);
|
|
6334
6408
|
}
|
|
@@ -6458,13 +6532,8 @@ let Leaf = class Leaf {
|
|
|
6458
6532
|
if (scaleX < 0) scaleX = -scaleX;
|
|
6459
6533
|
return scaleX > 1 ? scaleX : 1;
|
|
6460
6534
|
}
|
|
6461
|
-
getRenderScaleData(abs, scaleFixed) {
|
|
6462
|
-
|
|
6463
|
-
if (abs) scaleX < 0 && (scaleX = -scaleX), scaleY < 0 && (scaleY = -scaleY);
|
|
6464
|
-
if (scaleFixed === true || scaleFixed === "zoom-in" && scaleX > 1 && scaleY > 1) scaleX = scaleY = 1;
|
|
6465
|
-
tempScaleData.scaleX = scaleX;
|
|
6466
|
-
tempScaleData.scaleY = scaleY;
|
|
6467
|
-
return tempScaleData;
|
|
6535
|
+
getRenderScaleData(abs, scaleFixed, unscale = true) {
|
|
6536
|
+
return getScaleFixedData(ImageManager.patternLocked ? this.__world : this.__nowWorld || this.__world, scaleFixed, unscale, abs);
|
|
6468
6537
|
}
|
|
6469
6538
|
getTransform(relative) {
|
|
6470
6539
|
return this.__layout.getTransform(relative || "local");
|
|
@@ -6636,7 +6705,7 @@ let Leaf = class Leaf {
|
|
|
6636
6705
|
__drawPath(_canvas) {}
|
|
6637
6706
|
__drawRenderPath(_canvas) {}
|
|
6638
6707
|
__updatePath() {}
|
|
6639
|
-
__updateRenderPath() {}
|
|
6708
|
+
__updateRenderPath(_updateCache) {}
|
|
6640
6709
|
getMotionPathData() {
|
|
6641
6710
|
return Plugin.need("path");
|
|
6642
6711
|
}
|
|
@@ -6710,9 +6779,11 @@ let Branch = class Branch extends Leaf {
|
|
|
6710
6779
|
return 0;
|
|
6711
6780
|
}
|
|
6712
6781
|
__updateRenderSpread() {
|
|
6782
|
+
let layout;
|
|
6713
6783
|
const {children: children} = this;
|
|
6714
6784
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
6715
|
-
|
|
6785
|
+
layout = children[i].__layout;
|
|
6786
|
+
if (layout.renderSpread || layout.localOuterBounds) return 1;
|
|
6716
6787
|
}
|
|
6717
6788
|
return 0;
|
|
6718
6789
|
}
|
|
@@ -6745,6 +6816,7 @@ let Branch = class Branch extends Leaf {
|
|
|
6745
6816
|
this.add(item, index);
|
|
6746
6817
|
noIndex || index++;
|
|
6747
6818
|
}); else child = UICreator.get(child.tag, child);
|
|
6819
|
+
if (!child) return;
|
|
6748
6820
|
}
|
|
6749
6821
|
if (child.parent) child.parent.remove(child);
|
|
6750
6822
|
child.parent = this;
|
|
@@ -6970,6 +7042,6 @@ class LeafLevelList {
|
|
|
6970
7042
|
}
|
|
6971
7043
|
}
|
|
6972
7044
|
|
|
6973
|
-
const version = "2.0.
|
|
7045
|
+
const version = "2.0.3";
|
|
6974
7046
|
|
|
6975
|
-
export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Branch, BranchHelper, BranchRender, CanvasManager, ChildEvent, Creator, DataHelper, Debug, Direction4, Direction9, EllipseHelper, Event, EventCreator, Eventer, FileHelper, FourNumberHelper, ImageEvent, ImageManager, IncrementId, LayoutEvent, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, LeaferCanvasBase, LeaferEvent, LeaferImage, MathHelper, Matrix, MatrixHelper, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Platform, Plugin, Point, PointHelper, PropertyEvent, RectHelper, RenderEvent, ResizeEvent, Resource, Run, StringNumberMap, TaskItem, TaskProcessor, TwoPointBoundsHelper, UICreator, UnitConvertHelper, WaitHelper, WatchEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, 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, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, tempBounds, tempMatrix, tempPoint$2 as tempPoint, tryToNumber, useModule, version, visibleType };
|
|
7047
|
+
export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Branch, BranchHelper, BranchRender, CanvasManager, ChildEvent, Creator, DataHelper, Debug, Direction4, Direction9, EllipseHelper, Event, EventCreator, Eventer, FileHelper, FourNumberHelper, ImageEvent, ImageManager, IncrementId, LayoutEvent, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, LeaferCanvasBase, LeaferEvent, LeaferFilm, LeaferImage, LeaferVideo, MathHelper, Matrix, MatrixHelper, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Platform, Plugin, Point, PointHelper, PropertyEvent, RectHelper, RenderEvent, ResizeEvent, Resource, Run, StringNumberMap, TaskItem, TaskProcessor, TwoPointBoundsHelper, UICreator, UnitConvertHelper, WaitHelper, WatchEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, 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, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, tempBounds, tempMatrix, tempPoint$2 as tempPoint, tryToNumber, useModule, version, visibleType };
|