@leafer-editor/worker 1.3.3 → 1.4.1
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 +1 -0
- package/dist/worker.cjs.map +1 -0
- package/dist/worker.esm.js +1 -0
- package/dist/worker.esm.js.map +1 -0
- package/dist/worker.esm.min.js +1 -0
- package/dist/worker.esm.min.js.map +1 -0
- package/dist/worker.js +423 -354
- package/dist/worker.js.map +1 -0
- package/dist/worker.min.cjs +1 -0
- package/dist/worker.min.cjs.map +1 -0
- package/dist/worker.min.js +2 -1
- package/dist/worker.min.js.map +1 -0
- package/dist/worker.module.js +422 -355
- package/dist/worker.module.js.map +1 -0
- package/dist/worker.module.min.js +2 -1
- package/dist/worker.module.min.js.map +1 -0
- package/package.json +20 -20
package/dist/worker.module.js
CHANGED
|
@@ -1374,7 +1374,7 @@ function getNameList(name) {
|
|
|
1374
1374
|
}
|
|
1375
1375
|
const D$6 = Debug;
|
|
1376
1376
|
|
|
1377
|
-
const debug$
|
|
1377
|
+
const debug$i = Debug.get('RunTime');
|
|
1378
1378
|
const Run = {
|
|
1379
1379
|
currentId: 0,
|
|
1380
1380
|
currentName: '',
|
|
@@ -1383,24 +1383,24 @@ const Run = {
|
|
|
1383
1383
|
nameToIdMap: {},
|
|
1384
1384
|
start(name, microsecond) {
|
|
1385
1385
|
const id = IncrementId.create(IncrementId.RUNTIME);
|
|
1386
|
-
R.currentId = R.idMap[id] = microsecond ? performance.now() : Date.now();
|
|
1387
|
-
R.currentName = R.nameMap[id] = name;
|
|
1388
|
-
R.nameToIdMap[name] = id;
|
|
1386
|
+
R$1.currentId = R$1.idMap[id] = microsecond ? performance.now() : Date.now();
|
|
1387
|
+
R$1.currentName = R$1.nameMap[id] = name;
|
|
1388
|
+
R$1.nameToIdMap[name] = id;
|
|
1389
1389
|
return id;
|
|
1390
1390
|
},
|
|
1391
1391
|
end(id, microsecond) {
|
|
1392
|
-
const time = R.idMap[id], name = R.nameMap[id];
|
|
1392
|
+
const time = R$1.idMap[id], name = R$1.nameMap[id];
|
|
1393
1393
|
const duration = microsecond ? (performance.now() - time) / 1000 : Date.now() - time;
|
|
1394
|
-
R.idMap[id] = R.nameMap[id] = R.nameToIdMap[name] = undefined;
|
|
1395
|
-
debug$
|
|
1394
|
+
R$1.idMap[id] = R$1.nameMap[id] = R$1.nameToIdMap[name] = undefined;
|
|
1395
|
+
debug$i.log(name, duration, 'ms');
|
|
1396
1396
|
},
|
|
1397
1397
|
endOfName(name, microsecond) {
|
|
1398
|
-
const id = R.nameToIdMap[name];
|
|
1398
|
+
const id = R$1.nameToIdMap[name];
|
|
1399
1399
|
if (id !== undefined)
|
|
1400
|
-
R.end(id, microsecond);
|
|
1400
|
+
R$1.end(id, microsecond);
|
|
1401
1401
|
}
|
|
1402
1402
|
};
|
|
1403
|
-
const R = Run;
|
|
1403
|
+
const R$1 = Run;
|
|
1404
1404
|
|
|
1405
1405
|
const check = [];
|
|
1406
1406
|
const Plugin = {
|
|
@@ -1421,18 +1421,18 @@ const Plugin = {
|
|
|
1421
1421
|
};
|
|
1422
1422
|
setTimeout(() => check.forEach(name => Plugin.has(name, true)));
|
|
1423
1423
|
|
|
1424
|
-
const debug$
|
|
1424
|
+
const debug$h = Debug.get('UICreator');
|
|
1425
1425
|
const UICreator = {
|
|
1426
1426
|
list: {},
|
|
1427
1427
|
register(UI) {
|
|
1428
1428
|
const { __tag: tag } = UI.prototype;
|
|
1429
1429
|
if (list$3[tag])
|
|
1430
|
-
debug$
|
|
1430
|
+
debug$h.repeat(tag);
|
|
1431
1431
|
list$3[tag] = UI;
|
|
1432
1432
|
},
|
|
1433
1433
|
get(tag, data, x, y, width, height) {
|
|
1434
1434
|
if (!list$3[tag])
|
|
1435
|
-
debug$
|
|
1435
|
+
debug$h.error('not register ' + tag);
|
|
1436
1436
|
const ui = new list$3[tag](data);
|
|
1437
1437
|
if (x !== undefined) {
|
|
1438
1438
|
ui.x = x;
|
|
@@ -1448,7 +1448,7 @@ const UICreator = {
|
|
|
1448
1448
|
};
|
|
1449
1449
|
const { list: list$3 } = UICreator;
|
|
1450
1450
|
|
|
1451
|
-
const debug$
|
|
1451
|
+
const debug$g = Debug.get('EventCreator');
|
|
1452
1452
|
const EventCreator = {
|
|
1453
1453
|
nameList: {},
|
|
1454
1454
|
register(Event) {
|
|
@@ -1456,7 +1456,7 @@ const EventCreator = {
|
|
|
1456
1456
|
Object.keys(Event).forEach(key => {
|
|
1457
1457
|
name = Event[key];
|
|
1458
1458
|
if (typeof name === 'string')
|
|
1459
|
-
nameList[name] && debug$
|
|
1459
|
+
nameList[name] && debug$g.repeat(name), nameList[name] = Event;
|
|
1460
1460
|
});
|
|
1461
1461
|
},
|
|
1462
1462
|
changeName(oldName, newName) {
|
|
@@ -1533,10 +1533,10 @@ const DataHelper = {
|
|
|
1533
1533
|
Object.keys(merge).forEach(key => {
|
|
1534
1534
|
var _a, _b;
|
|
1535
1535
|
value = merge[key];
|
|
1536
|
-
if ((value === null || value ===
|
|
1536
|
+
if ((value === null || value === void 0 ? void 0 : value.constructor) === Object && ((_a = t[key]) === null || _a === void 0 ? void 0 : _a.constructor) === Object)
|
|
1537
1537
|
return assign(t[key], merge[key], exclude && exclude[key]);
|
|
1538
1538
|
if (exclude && (key in exclude)) {
|
|
1539
|
-
if (((_b = exclude[key]) === null || _b ===
|
|
1539
|
+
if (((_b = exclude[key]) === null || _b === void 0 ? void 0 : _b.constructor) === Object)
|
|
1540
1540
|
assign(t[key] = {}, merge[key], exclude[key]);
|
|
1541
1541
|
return;
|
|
1542
1542
|
}
|
|
@@ -1660,7 +1660,7 @@ class LeafData {
|
|
|
1660
1660
|
const t = this;
|
|
1661
1661
|
if (t.blendMode === 'pass-through') {
|
|
1662
1662
|
const leaf = this.__leaf;
|
|
1663
|
-
if ((t.opacity < 1 && (leaf.isBranch || t.__hasMultiPaint)) || leaf.__hasEraser || t.eraser) {
|
|
1663
|
+
if ((t.opacity < 1 && (leaf.isBranch || t.__hasMultiPaint)) || leaf.__hasEraser || t.eraser || t.filter) {
|
|
1664
1664
|
t.__single = true;
|
|
1665
1665
|
}
|
|
1666
1666
|
else if (t.__single) {
|
|
@@ -1773,7 +1773,7 @@ let Canvas$1 = class Canvas {
|
|
|
1773
1773
|
}
|
|
1774
1774
|
setTransform(_a, _b, _c, _d, _e, _f) { }
|
|
1775
1775
|
resetTransform() { }
|
|
1776
|
-
getTransform() { return
|
|
1776
|
+
getTransform() { return void 0; }
|
|
1777
1777
|
save() { }
|
|
1778
1778
|
restore() { }
|
|
1779
1779
|
transform(a, b, c, d, e, f) {
|
|
@@ -1830,12 +1830,12 @@ let Canvas$1 = class Canvas {
|
|
|
1830
1830
|
ellipse(_x, _y, _radiusX, _radiusY, _rotation, _startAngle, _endAngle, _anticlockwise) { }
|
|
1831
1831
|
rect(_x, _y, _width, _height) { }
|
|
1832
1832
|
roundRect(_x, _y, _width, _height, _radius) { }
|
|
1833
|
-
createConicGradient(_startAngle, _x, _y) { return
|
|
1834
|
-
createLinearGradient(_x0, _y0, _x1, _y1) { return
|
|
1835
|
-
createPattern(_image, _repetition) { return
|
|
1836
|
-
createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return
|
|
1833
|
+
createConicGradient(_startAngle, _x, _y) { return void 0; }
|
|
1834
|
+
createLinearGradient(_x0, _y0, _x1, _y1) { return void 0; }
|
|
1835
|
+
createPattern(_image, _repetition) { return void 0; }
|
|
1836
|
+
createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return void 0; }
|
|
1837
1837
|
fillText(_text, _x, _y, _maxWidth) { }
|
|
1838
|
-
measureText(_text) { return
|
|
1838
|
+
measureText(_text) { return void 0; }
|
|
1839
1839
|
strokeText(_text, _x, _y, _maxWidth) { }
|
|
1840
1840
|
destroy() {
|
|
1841
1841
|
this.context = null;
|
|
@@ -1843,79 +1843,79 @@ let Canvas$1 = class Canvas {
|
|
|
1843
1843
|
};
|
|
1844
1844
|
__decorate([
|
|
1845
1845
|
contextAttr('imageSmoothingEnabled')
|
|
1846
|
-
], Canvas$1.prototype, "smooth",
|
|
1846
|
+
], Canvas$1.prototype, "smooth", void 0);
|
|
1847
1847
|
__decorate([
|
|
1848
1848
|
contextAttr('imageSmoothingQuality')
|
|
1849
|
-
], Canvas$1.prototype, "smoothLevel",
|
|
1849
|
+
], Canvas$1.prototype, "smoothLevel", void 0);
|
|
1850
1850
|
__decorate([
|
|
1851
1851
|
contextAttr('globalAlpha')
|
|
1852
|
-
], Canvas$1.prototype, "opacity",
|
|
1852
|
+
], Canvas$1.prototype, "opacity", void 0);
|
|
1853
1853
|
__decorate([
|
|
1854
1854
|
contextAttr()
|
|
1855
|
-
], Canvas$1.prototype, "fillStyle",
|
|
1855
|
+
], Canvas$1.prototype, "fillStyle", void 0);
|
|
1856
1856
|
__decorate([
|
|
1857
1857
|
contextAttr()
|
|
1858
|
-
], Canvas$1.prototype, "strokeStyle",
|
|
1858
|
+
], Canvas$1.prototype, "strokeStyle", void 0);
|
|
1859
1859
|
__decorate([
|
|
1860
1860
|
contextAttr('lineWidth')
|
|
1861
|
-
], Canvas$1.prototype, "strokeWidth",
|
|
1861
|
+
], Canvas$1.prototype, "strokeWidth", void 0);
|
|
1862
1862
|
__decorate([
|
|
1863
1863
|
contextAttr('lineCap')
|
|
1864
|
-
], Canvas$1.prototype, "strokeCap",
|
|
1864
|
+
], Canvas$1.prototype, "strokeCap", void 0);
|
|
1865
1865
|
__decorate([
|
|
1866
1866
|
contextAttr('lineJoin')
|
|
1867
|
-
], Canvas$1.prototype, "strokeJoin",
|
|
1867
|
+
], Canvas$1.prototype, "strokeJoin", void 0);
|
|
1868
1868
|
__decorate([
|
|
1869
1869
|
contextAttr('lineDashOffset')
|
|
1870
|
-
], Canvas$1.prototype, "dashOffset",
|
|
1870
|
+
], Canvas$1.prototype, "dashOffset", void 0);
|
|
1871
1871
|
__decorate([
|
|
1872
1872
|
contextAttr()
|
|
1873
|
-
], Canvas$1.prototype, "miterLimit",
|
|
1873
|
+
], Canvas$1.prototype, "miterLimit", void 0);
|
|
1874
1874
|
__decorate([
|
|
1875
1875
|
contextAttr()
|
|
1876
|
-
], Canvas$1.prototype, "shadowBlur",
|
|
1876
|
+
], Canvas$1.prototype, "shadowBlur", void 0);
|
|
1877
1877
|
__decorate([
|
|
1878
1878
|
contextAttr()
|
|
1879
|
-
], Canvas$1.prototype, "shadowColor",
|
|
1879
|
+
], Canvas$1.prototype, "shadowColor", void 0);
|
|
1880
1880
|
__decorate([
|
|
1881
1881
|
contextAttr()
|
|
1882
|
-
], Canvas$1.prototype, "shadowOffsetX",
|
|
1882
|
+
], Canvas$1.prototype, "shadowOffsetX", void 0);
|
|
1883
1883
|
__decorate([
|
|
1884
1884
|
contextAttr()
|
|
1885
|
-
], Canvas$1.prototype, "shadowOffsetY",
|
|
1885
|
+
], Canvas$1.prototype, "shadowOffsetY", void 0);
|
|
1886
1886
|
__decorate([
|
|
1887
1887
|
contextAttr()
|
|
1888
|
-
], Canvas$1.prototype, "filter",
|
|
1888
|
+
], Canvas$1.prototype, "filter", void 0);
|
|
1889
1889
|
__decorate([
|
|
1890
1890
|
contextAttr()
|
|
1891
|
-
], Canvas$1.prototype, "font",
|
|
1891
|
+
], Canvas$1.prototype, "font", void 0);
|
|
1892
1892
|
__decorate([
|
|
1893
1893
|
contextAttr()
|
|
1894
|
-
], Canvas$1.prototype, "fontKerning",
|
|
1894
|
+
], Canvas$1.prototype, "fontKerning", void 0);
|
|
1895
1895
|
__decorate([
|
|
1896
1896
|
contextAttr()
|
|
1897
|
-
], Canvas$1.prototype, "fontStretch",
|
|
1897
|
+
], Canvas$1.prototype, "fontStretch", void 0);
|
|
1898
1898
|
__decorate([
|
|
1899
1899
|
contextAttr()
|
|
1900
|
-
], Canvas$1.prototype, "fontVariantCaps",
|
|
1900
|
+
], Canvas$1.prototype, "fontVariantCaps", void 0);
|
|
1901
1901
|
__decorate([
|
|
1902
1902
|
contextAttr()
|
|
1903
|
-
], Canvas$1.prototype, "textAlign",
|
|
1903
|
+
], Canvas$1.prototype, "textAlign", void 0);
|
|
1904
1904
|
__decorate([
|
|
1905
1905
|
contextAttr()
|
|
1906
|
-
], Canvas$1.prototype, "textBaseline",
|
|
1906
|
+
], Canvas$1.prototype, "textBaseline", void 0);
|
|
1907
1907
|
__decorate([
|
|
1908
1908
|
contextAttr()
|
|
1909
|
-
], Canvas$1.prototype, "textRendering",
|
|
1909
|
+
], Canvas$1.prototype, "textRendering", void 0);
|
|
1910
1910
|
__decorate([
|
|
1911
1911
|
contextAttr()
|
|
1912
|
-
], Canvas$1.prototype, "wordSpacing",
|
|
1912
|
+
], Canvas$1.prototype, "wordSpacing", void 0);
|
|
1913
1913
|
__decorate([
|
|
1914
1914
|
contextAttr()
|
|
1915
|
-
], Canvas$1.prototype, "letterSpacing",
|
|
1915
|
+
], Canvas$1.prototype, "letterSpacing", void 0);
|
|
1916
1916
|
__decorate([
|
|
1917
1917
|
contextAttr()
|
|
1918
|
-
], Canvas$1.prototype, "direction",
|
|
1918
|
+
], Canvas$1.prototype, "direction", void 0);
|
|
1919
1919
|
__decorate([
|
|
1920
1920
|
contextMethod()
|
|
1921
1921
|
], Canvas$1.prototype, "setTransform", null);
|
|
@@ -2612,7 +2612,7 @@ const EllipseHelper = {
|
|
|
2612
2612
|
const { M: M$7, m, L: L$8, l, H, h, V, v, C: C$7, c, S, s, Q: Q$6, q, T, t, A, a, Z: Z$6, z, N: N$5, D: D$5, X: X$5, G: G$5, F: F$6, O: O$6, P: P$5, U: U$5 } = PathCommandMap;
|
|
2613
2613
|
const { rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1 } = BezierHelper;
|
|
2614
2614
|
const { ellipticalArc } = EllipseHelper;
|
|
2615
|
-
const debug$
|
|
2615
|
+
const debug$f = Debug.get('PathConvert');
|
|
2616
2616
|
const setEndPoint$1 = {};
|
|
2617
2617
|
const PathConvert = {
|
|
2618
2618
|
current: { dot: 0 },
|
|
@@ -2853,7 +2853,7 @@ const PathConvert = {
|
|
|
2853
2853
|
i += 6;
|
|
2854
2854
|
break;
|
|
2855
2855
|
default:
|
|
2856
|
-
debug$
|
|
2856
|
+
debug$f.error(`command: ${command} [index:${i}]`, old);
|
|
2857
2857
|
return data;
|
|
2858
2858
|
}
|
|
2859
2859
|
lastCommand = command;
|
|
@@ -2962,12 +2962,10 @@ const PathCommandDataHelper = {
|
|
|
2962
2962
|
},
|
|
2963
2963
|
arcTo(data, x1, y1, x2, y2, radius, lastX, lastY) {
|
|
2964
2964
|
if (lastX !== undefined) {
|
|
2965
|
-
const
|
|
2966
|
-
|
|
2967
|
-
}
|
|
2968
|
-
else {
|
|
2969
|
-
data.push(U$4, x1, y1, x2, y2, radius);
|
|
2965
|
+
const d = getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2);
|
|
2966
|
+
radius = min(radius, min(d / 2, d / 2 * abs$4(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
|
|
2970
2967
|
}
|
|
2968
|
+
data.push(U$4, x1, y1, x2, y2, radius);
|
|
2971
2969
|
},
|
|
2972
2970
|
drawEllipse(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
|
|
2973
2971
|
BezierHelper.ellipse(null, x, y, radiusX, radiusY, rotation === undefined ? 0 : rotation, startAngle === undefined ? 0 : startAngle, endAngle === undefined ? 360 : endAngle, anticlockwise, null, null, startPoint);
|
|
@@ -3078,7 +3076,7 @@ class PathCreator {
|
|
|
3078
3076
|
}
|
|
3079
3077
|
|
|
3080
3078
|
const { M: M$5, L: L$6, C: C$5, Q: Q$4, Z: Z$4, N: N$3, D: D$3, X: X$3, G: G$3, F: F$4, O: O$4, P: P$3, U: U$3 } = PathCommandMap;
|
|
3081
|
-
const debug$
|
|
3079
|
+
const debug$e = Debug.get('PathDrawer');
|
|
3082
3080
|
const PathDrawer = {
|
|
3083
3081
|
drawPathByData(drawer, data) {
|
|
3084
3082
|
if (!data)
|
|
@@ -3141,7 +3139,7 @@ const PathDrawer = {
|
|
|
3141
3139
|
i += 6;
|
|
3142
3140
|
break;
|
|
3143
3141
|
default:
|
|
3144
|
-
debug$
|
|
3142
|
+
debug$e.error(`command: ${command} [index:${i}]`, data);
|
|
3145
3143
|
return;
|
|
3146
3144
|
}
|
|
3147
3145
|
}
|
|
@@ -3151,7 +3149,7 @@ const PathDrawer = {
|
|
|
3151
3149
|
const { M: M$4, L: L$5, C: C$4, Q: Q$3, Z: Z$3, N: N$2, D: D$2, X: X$2, G: G$2, F: F$3, O: O$3, P: P$2, U: U$2 } = PathCommandMap;
|
|
3152
3150
|
const { toTwoPointBounds, toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc, ellipse: ellipse$1 } = BezierHelper;
|
|
3153
3151
|
const { addPointBounds, copy: copy$b, addPoint: addPoint$1, setPoint: setPoint$3, addBounds, toBounds: toBounds$3 } = TwoPointBoundsHelper;
|
|
3154
|
-
const debug$
|
|
3152
|
+
const debug$d = Debug.get('PathBounds');
|
|
3155
3153
|
let radius, radiusX, radiusY;
|
|
3156
3154
|
const tempPointBounds = {};
|
|
3157
3155
|
const setPointBounds = {};
|
|
@@ -3259,7 +3257,7 @@ const PathBounds = {
|
|
|
3259
3257
|
i += 6;
|
|
3260
3258
|
break;
|
|
3261
3259
|
default:
|
|
3262
|
-
debug$
|
|
3260
|
+
debug$d.error(`command: ${command} [index:${i}]`, data);
|
|
3263
3261
|
return;
|
|
3264
3262
|
}
|
|
3265
3263
|
}
|
|
@@ -3375,7 +3373,7 @@ const FileHelper = {
|
|
|
3375
3373
|
const F$2 = FileHelper;
|
|
3376
3374
|
F$2.opacityTypes.forEach(type => F$2.upperCaseTypeMap[type] = type.toUpperCase());
|
|
3377
3375
|
|
|
3378
|
-
const debug$
|
|
3376
|
+
const debug$c = Debug.get('TaskProcessor');
|
|
3379
3377
|
class TaskItem {
|
|
3380
3378
|
constructor(task) {
|
|
3381
3379
|
this.parallel = true;
|
|
@@ -3384,13 +3382,13 @@ class TaskItem {
|
|
|
3384
3382
|
this.task = task;
|
|
3385
3383
|
}
|
|
3386
3384
|
run() {
|
|
3387
|
-
return __awaiter(this,
|
|
3385
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3388
3386
|
try {
|
|
3389
3387
|
if (this.task && !this.isComplete && this.parent.running)
|
|
3390
3388
|
yield this.task();
|
|
3391
3389
|
}
|
|
3392
3390
|
catch (error) {
|
|
3393
|
-
debug$
|
|
3391
|
+
debug$c.error(error);
|
|
3394
3392
|
}
|
|
3395
3393
|
});
|
|
3396
3394
|
}
|
|
@@ -3623,18 +3621,52 @@ class TaskProcessor {
|
|
|
3623
3621
|
}
|
|
3624
3622
|
}
|
|
3625
3623
|
|
|
3626
|
-
const
|
|
3624
|
+
const debug$b = Debug.get('Resource');
|
|
3625
|
+
const Resource = {
|
|
3626
|
+
tasker: new TaskProcessor(),
|
|
3627
3627
|
map: {},
|
|
3628
|
+
get isComplete() { return R.tasker.isComplete; },
|
|
3629
|
+
set(key, value) {
|
|
3630
|
+
if (R.map[key])
|
|
3631
|
+
debug$b.repeat(key);
|
|
3632
|
+
R.map[key] = value;
|
|
3633
|
+
},
|
|
3634
|
+
get(key) {
|
|
3635
|
+
return R.map[key];
|
|
3636
|
+
},
|
|
3637
|
+
remove(key) {
|
|
3638
|
+
delete R.map[key];
|
|
3639
|
+
},
|
|
3640
|
+
loadImage(key, format) {
|
|
3641
|
+
return new Promise((resolve, reject) => {
|
|
3642
|
+
const image = this.setImage(key, key, format);
|
|
3643
|
+
image.load(() => resolve(image), (e) => reject(e));
|
|
3644
|
+
});
|
|
3645
|
+
},
|
|
3646
|
+
setImage(key, value, format) {
|
|
3647
|
+
let config;
|
|
3648
|
+
if (typeof value === 'string')
|
|
3649
|
+
config = { url: value };
|
|
3650
|
+
else if (!value.url)
|
|
3651
|
+
config = { url: key, view: value };
|
|
3652
|
+
if (config)
|
|
3653
|
+
format && (config.format = format), value = Creator.image(config);
|
|
3654
|
+
R.set(key, value);
|
|
3655
|
+
return value;
|
|
3656
|
+
},
|
|
3657
|
+
destroy() {
|
|
3658
|
+
R.map = {};
|
|
3659
|
+
}
|
|
3660
|
+
};
|
|
3661
|
+
const R = Resource;
|
|
3662
|
+
|
|
3663
|
+
const ImageManager = {
|
|
3628
3664
|
recycledList: [],
|
|
3629
|
-
tasker: new TaskProcessor(),
|
|
3630
3665
|
patternTasker: new TaskProcessor(),
|
|
3631
|
-
get isComplete() { return I$1.tasker.isComplete; },
|
|
3632
3666
|
get(config) {
|
|
3633
|
-
let image =
|
|
3634
|
-
if (!image)
|
|
3635
|
-
image = Creator.image(config);
|
|
3636
|
-
I$1.map[config.url] = image;
|
|
3637
|
-
}
|
|
3667
|
+
let image = Resource.get(config.url);
|
|
3668
|
+
if (!image)
|
|
3669
|
+
Resource.set(config.url, image = Creator.image(config));
|
|
3638
3670
|
image.use++;
|
|
3639
3671
|
return image;
|
|
3640
3672
|
},
|
|
@@ -3648,7 +3680,7 @@ const ImageManager = {
|
|
|
3648
3680
|
if (list.length > 100) {
|
|
3649
3681
|
list.forEach(image => {
|
|
3650
3682
|
if (!image.use && image.url) {
|
|
3651
|
-
|
|
3683
|
+
Resource.remove(image.url);
|
|
3652
3684
|
image.destroy();
|
|
3653
3685
|
}
|
|
3654
3686
|
});
|
|
@@ -3675,7 +3707,6 @@ const ImageManager = {
|
|
|
3675
3707
|
return false;
|
|
3676
3708
|
},
|
|
3677
3709
|
destroy() {
|
|
3678
|
-
I$1.map = {};
|
|
3679
3710
|
I$1.recycledList = [];
|
|
3680
3711
|
}
|
|
3681
3712
|
};
|
|
@@ -3689,21 +3720,19 @@ class LeaferImage {
|
|
|
3689
3720
|
this.use = 0;
|
|
3690
3721
|
this.waitComplete = [];
|
|
3691
3722
|
this.innerId = create$1(IMAGE);
|
|
3692
|
-
this.config = config || { url: '' };
|
|
3693
|
-
|
|
3694
|
-
|
|
3723
|
+
this.config = config || (config = { url: '' });
|
|
3724
|
+
if (config.view) {
|
|
3725
|
+
const { view } = config;
|
|
3726
|
+
this.setView(view.config ? view.view : view);
|
|
3727
|
+
}
|
|
3728
|
+
ImageManager.isFormat('svg', config) && (this.isSVG = true);
|
|
3729
|
+
ImageManager.hasOpacityPixel(config) && (this.hasOpacityPixel = true);
|
|
3695
3730
|
}
|
|
3696
3731
|
load(onSuccess, onError) {
|
|
3697
3732
|
if (!this.loading) {
|
|
3698
3733
|
this.loading = true;
|
|
3699
|
-
|
|
3700
|
-
return yield Platform.origin.loadImage(this.url).then((img) => {
|
|
3701
|
-
this.ready = true;
|
|
3702
|
-
this.width = img.naturalWidth || img.width;
|
|
3703
|
-
this.height = img.naturalHeight || img.height;
|
|
3704
|
-
this.view = img;
|
|
3705
|
-
this.onComplete(true);
|
|
3706
|
-
}).catch((e) => {
|
|
3734
|
+
Resource.tasker.add(() => __awaiter(this, void 0, void 0, function* () {
|
|
3735
|
+
return yield Platform.origin.loadImage(this.url).then(img => this.setView(img)).catch((e) => {
|
|
3707
3736
|
this.error = e;
|
|
3708
3737
|
this.onComplete(false);
|
|
3709
3738
|
});
|
|
@@ -3721,6 +3750,13 @@ class LeaferImage {
|
|
|
3721
3750
|
}
|
|
3722
3751
|
l[index] = l[index + 1] = undefined;
|
|
3723
3752
|
}
|
|
3753
|
+
setView(img) {
|
|
3754
|
+
this.ready = true;
|
|
3755
|
+
this.width = img.naturalWidth || img.width;
|
|
3756
|
+
this.height = img.naturalHeight || img.height;
|
|
3757
|
+
this.view = img;
|
|
3758
|
+
this.onComplete(true);
|
|
3759
|
+
}
|
|
3724
3760
|
onComplete(isSuccess) {
|
|
3725
3761
|
let odd;
|
|
3726
3762
|
this.waitComplete.forEach((item, index) => {
|
|
@@ -3739,6 +3775,9 @@ class LeaferImage {
|
|
|
3739
3775
|
this.waitComplete.length = 0;
|
|
3740
3776
|
this.loading = false;
|
|
3741
3777
|
}
|
|
3778
|
+
getFull(_filters) {
|
|
3779
|
+
return this.view;
|
|
3780
|
+
}
|
|
3742
3781
|
getCanvas(width, height, opacity, _filters) {
|
|
3743
3782
|
width || (width = this.width);
|
|
3744
3783
|
height || (height = this.height);
|
|
@@ -3821,10 +3860,10 @@ function autoLayoutType(defaultValue) {
|
|
|
3821
3860
|
return decorateLeafAttr(defaultValue, (key) => attr({
|
|
3822
3861
|
set(value) {
|
|
3823
3862
|
if (this.__setAttr(key, value)) {
|
|
3824
|
-
this.__layout.matrixChanged || this.__layout.matrixChange();
|
|
3825
3863
|
this.__hasAutoLayout = !!(this.origin || this.around || this.flow);
|
|
3826
3864
|
if (!this.__local)
|
|
3827
3865
|
this.__layout.createLocal();
|
|
3866
|
+
doBoundsType(this);
|
|
3828
3867
|
}
|
|
3829
3868
|
}
|
|
3830
3869
|
}));
|
|
@@ -4207,55 +4246,62 @@ const LeafHelper = {
|
|
|
4207
4246
|
y += t.y;
|
|
4208
4247
|
transition ? t.animate({ x, y }, transition) : (t.x = x, t.y = y);
|
|
4209
4248
|
},
|
|
4210
|
-
zoomOfWorld(t, origin, scaleX, scaleY, resize) {
|
|
4211
|
-
L$3.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize);
|
|
4249
|
+
zoomOfWorld(t, origin, scaleX, scaleY, resize, transition) {
|
|
4250
|
+
L$3.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize, transition);
|
|
4212
4251
|
},
|
|
4213
|
-
zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize) {
|
|
4214
|
-
|
|
4252
|
+
zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize, transition) {
|
|
4253
|
+
const o = t.__localMatrix;
|
|
4254
|
+
if (typeof scaleY !== 'number') {
|
|
4255
|
+
if (scaleY)
|
|
4256
|
+
transition = scaleY;
|
|
4257
|
+
scaleY = scaleX;
|
|
4258
|
+
}
|
|
4259
|
+
copy$a(matrix$3, o);
|
|
4215
4260
|
scaleOfOuter$2(matrix$3, origin, scaleX, scaleY);
|
|
4216
4261
|
if (t.origin || t.around) {
|
|
4217
|
-
L$3.setTransform(t, matrix$3, resize);
|
|
4262
|
+
L$3.setTransform(t, matrix$3, resize, transition);
|
|
4218
4263
|
}
|
|
4219
4264
|
else {
|
|
4220
|
-
|
|
4221
|
-
|
|
4265
|
+
const x = t.x + matrix$3.e - o.e, y = t.y + matrix$3.f - o.f;
|
|
4266
|
+
if (transition && !resize)
|
|
4267
|
+
t.animate({ x, y, scaleX: t.scaleX * scaleX, scaleY: t.scaleY * scaleY }, transition);
|
|
4268
|
+
else
|
|
4269
|
+
t.x = x, t.y = y, t.scaleResize(scaleX, scaleY, resize !== true);
|
|
4222
4270
|
}
|
|
4223
4271
|
},
|
|
4224
|
-
rotateOfWorld(t, origin, angle) {
|
|
4225
|
-
L$3.rotateOfLocal(t, getTempLocal(t, origin), angle);
|
|
4272
|
+
rotateOfWorld(t, origin, angle, transition) {
|
|
4273
|
+
L$3.rotateOfLocal(t, getTempLocal(t, origin), angle, transition);
|
|
4226
4274
|
},
|
|
4227
|
-
rotateOfLocal(t, origin, angle) {
|
|
4228
|
-
|
|
4275
|
+
rotateOfLocal(t, origin, angle, transition) {
|
|
4276
|
+
const o = t.__localMatrix;
|
|
4277
|
+
copy$a(matrix$3, o);
|
|
4229
4278
|
rotateOfOuter$2(matrix$3, origin, angle);
|
|
4230
|
-
if (t.origin || t.around)
|
|
4231
|
-
L$3.setTransform(t, matrix$3);
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
moveByMatrix(t, matrix$3);
|
|
4235
|
-
t.rotation = MathHelper.formatRotation(t.rotation + angle);
|
|
4236
|
-
}
|
|
4279
|
+
if (t.origin || t.around)
|
|
4280
|
+
L$3.setTransform(t, matrix$3, false, transition);
|
|
4281
|
+
else
|
|
4282
|
+
t.set({ x: t.x + matrix$3.e - o.e, y: t.y + matrix$3.f - o.f, rotation: MathHelper.formatRotation(t.rotation + angle) }, transition);
|
|
4237
4283
|
},
|
|
4238
|
-
skewOfWorld(t, origin, skewX, skewY, resize) {
|
|
4239
|
-
L$3.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize);
|
|
4284
|
+
skewOfWorld(t, origin, skewX, skewY, resize, transition) {
|
|
4285
|
+
L$3.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize, transition);
|
|
4240
4286
|
},
|
|
4241
|
-
skewOfLocal(t, origin, skewX, skewY = 0, resize) {
|
|
4287
|
+
skewOfLocal(t, origin, skewX, skewY = 0, resize, transition) {
|
|
4242
4288
|
copy$a(matrix$3, t.__localMatrix);
|
|
4243
4289
|
skewOfOuter(matrix$3, origin, skewX, skewY);
|
|
4244
|
-
L$3.setTransform(t, matrix$3, resize);
|
|
4290
|
+
L$3.setTransform(t, matrix$3, resize, transition);
|
|
4245
4291
|
},
|
|
4246
|
-
transformWorld(t, transform, resize) {
|
|
4292
|
+
transformWorld(t, transform, resize, transition) {
|
|
4247
4293
|
copy$a(matrix$3, t.worldTransform);
|
|
4248
4294
|
multiplyParent$2(matrix$3, transform);
|
|
4249
4295
|
if (t.parent)
|
|
4250
4296
|
divideParent(matrix$3, t.parent.worldTransform);
|
|
4251
|
-
L$3.setTransform(t, matrix$3, resize);
|
|
4297
|
+
L$3.setTransform(t, matrix$3, resize, transition);
|
|
4252
4298
|
},
|
|
4253
|
-
transform(t, transform, resize) {
|
|
4299
|
+
transform(t, transform, resize, transition) {
|
|
4254
4300
|
copy$a(matrix$3, t.localTransform);
|
|
4255
4301
|
multiplyParent$2(matrix$3, transform);
|
|
4256
|
-
L$3.setTransform(t, matrix$3, resize);
|
|
4302
|
+
L$3.setTransform(t, matrix$3, resize, transition);
|
|
4257
4303
|
},
|
|
4258
|
-
setTransform(t, transform, resize) {
|
|
4304
|
+
setTransform(t, transform, resize, transition) {
|
|
4259
4305
|
const data = t.__, originPoint = data.origin && L$3.getInnerOrigin(t, data.origin);
|
|
4260
4306
|
const layout = getLayout(transform, originPoint, data.around && L$3.getInnerOrigin(t, data.around));
|
|
4261
4307
|
if (resize) {
|
|
@@ -4270,7 +4316,7 @@ const LeafHelper = {
|
|
|
4270
4316
|
t.scaleResize(scaleX, scaleY, false);
|
|
4271
4317
|
}
|
|
4272
4318
|
else
|
|
4273
|
-
t.set(layout);
|
|
4319
|
+
t.set(layout, transition);
|
|
4274
4320
|
},
|
|
4275
4321
|
getFlipTransform(t, axis) {
|
|
4276
4322
|
const m = getMatrixData();
|
|
@@ -4307,11 +4353,6 @@ const LeafHelper = {
|
|
|
4307
4353
|
};
|
|
4308
4354
|
const L$3 = LeafHelper;
|
|
4309
4355
|
const { updateAllMatrix: updateAllMatrix$3, updateMatrix: updateMatrix$3, updateAllWorldOpacity: updateAllWorldOpacity$1, updateAllChange: updateAllChange$1 } = L$3;
|
|
4310
|
-
function moveByMatrix(t, matrix) {
|
|
4311
|
-
const { e, f } = t.__localMatrix;
|
|
4312
|
-
t.x += matrix.e - e;
|
|
4313
|
-
t.y += matrix.f - f;
|
|
4314
|
-
}
|
|
4315
4356
|
function getTempLocal(t, world) {
|
|
4316
4357
|
t.__layout.update();
|
|
4317
4358
|
return t.parent ? PointHelper.tempToInnerOf(world, t.parent.__world) : world;
|
|
@@ -5217,7 +5258,7 @@ const LeafRender = {
|
|
|
5217
5258
|
if (this.__.eraser === 'path')
|
|
5218
5259
|
return this.__renderEraser(canvas, options);
|
|
5219
5260
|
const tempCanvas = canvas.getSameCanvas(true, true);
|
|
5220
|
-
this.__draw(tempCanvas, options);
|
|
5261
|
+
this.__draw(tempCanvas, options, canvas);
|
|
5221
5262
|
if (this.__worldFlipped) {
|
|
5222
5263
|
canvas.copyWorldByReset(tempCanvas, this.__nowWorld, null, this.__.__blendMode, true);
|
|
5223
5264
|
}
|
|
@@ -5585,11 +5626,11 @@ let Leaf = class Leaf {
|
|
|
5585
5626
|
const layer = this.leafer ? this.leafer.zoomLayer : this;
|
|
5586
5627
|
return layer.getWorldPoint(page, relative, distance, change);
|
|
5587
5628
|
}
|
|
5588
|
-
setTransform(matrix, resize) {
|
|
5589
|
-
setTransform(this, matrix, resize);
|
|
5629
|
+
setTransform(matrix, resize, transition) {
|
|
5630
|
+
setTransform(this, matrix, resize, transition);
|
|
5590
5631
|
}
|
|
5591
|
-
transform(matrix, resize) {
|
|
5592
|
-
transform(this, matrix, resize);
|
|
5632
|
+
transform(matrix, resize, transition) {
|
|
5633
|
+
transform(this, matrix, resize, transition);
|
|
5593
5634
|
}
|
|
5594
5635
|
move(x, y, transition) {
|
|
5595
5636
|
moveLocal(this, x, y, transition);
|
|
@@ -5597,32 +5638,32 @@ let Leaf = class Leaf {
|
|
|
5597
5638
|
moveInner(x, y, transition) {
|
|
5598
5639
|
moveWorld(this, x, y, true, transition);
|
|
5599
5640
|
}
|
|
5600
|
-
scaleOf(origin, scaleX, scaleY, resize) {
|
|
5601
|
-
zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize);
|
|
5641
|
+
scaleOf(origin, scaleX, scaleY, resize, transition) {
|
|
5642
|
+
zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize, transition);
|
|
5602
5643
|
}
|
|
5603
|
-
rotateOf(origin, rotation) {
|
|
5604
|
-
rotateOfLocal(this, getLocalOrigin(this, origin), rotation);
|
|
5644
|
+
rotateOf(origin, rotation, transition) {
|
|
5645
|
+
rotateOfLocal(this, getLocalOrigin(this, origin), rotation, transition);
|
|
5605
5646
|
}
|
|
5606
|
-
skewOf(origin, skewX, skewY, resize) {
|
|
5607
|
-
skewOfLocal(this, getLocalOrigin(this, origin), skewX, skewY, resize);
|
|
5647
|
+
skewOf(origin, skewX, skewY, resize, transition) {
|
|
5648
|
+
skewOfLocal(this, getLocalOrigin(this, origin), skewX, skewY, resize, transition);
|
|
5608
5649
|
}
|
|
5609
|
-
transformWorld(worldTransform, resize) {
|
|
5610
|
-
transformWorld(this, worldTransform, resize);
|
|
5650
|
+
transformWorld(worldTransform, resize, transition) {
|
|
5651
|
+
transformWorld(this, worldTransform, resize, transition);
|
|
5611
5652
|
}
|
|
5612
5653
|
moveWorld(x, y, transition) {
|
|
5613
5654
|
moveWorld(this, x, y, false, transition);
|
|
5614
5655
|
}
|
|
5615
|
-
scaleOfWorld(worldOrigin, scaleX, scaleY, resize) {
|
|
5616
|
-
zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize);
|
|
5656
|
+
scaleOfWorld(worldOrigin, scaleX, scaleY, resize, transition) {
|
|
5657
|
+
zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize, transition);
|
|
5617
5658
|
}
|
|
5618
5659
|
rotateOfWorld(worldOrigin, rotation) {
|
|
5619
5660
|
rotateOfWorld(this, worldOrigin, rotation);
|
|
5620
5661
|
}
|
|
5621
|
-
skewOfWorld(worldOrigin, skewX, skewY, resize) {
|
|
5622
|
-
skewOfWorld(this, worldOrigin, skewX, skewY, resize);
|
|
5662
|
+
skewOfWorld(worldOrigin, skewX, skewY, resize, transition) {
|
|
5663
|
+
skewOfWorld(this, worldOrigin, skewX, skewY, resize, transition);
|
|
5623
5664
|
}
|
|
5624
|
-
flip(axis) {
|
|
5625
|
-
transform(this, getFlipTransform(this, axis));
|
|
5665
|
+
flip(axis, transition) {
|
|
5666
|
+
transform(this, getFlipTransform(this, axis), false, transition);
|
|
5626
5667
|
}
|
|
5627
5668
|
scaleResize(scaleX, scaleY = scaleX, _noResize) {
|
|
5628
5669
|
this.scaleX *= scaleX;
|
|
@@ -6010,7 +6051,7 @@ class LeafLevelList {
|
|
|
6010
6051
|
}
|
|
6011
6052
|
}
|
|
6012
6053
|
|
|
6013
|
-
const version = "1.
|
|
6054
|
+
const version = "1.4.1";
|
|
6014
6055
|
|
|
6015
6056
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6016
6057
|
get allowBackgroundColor() { return true; }
|
|
@@ -6355,7 +6396,7 @@ class Layouter {
|
|
|
6355
6396
|
}
|
|
6356
6397
|
partLayout() {
|
|
6357
6398
|
var _a;
|
|
6358
|
-
if (!((_a = this.__updatedList) === null || _a ===
|
|
6399
|
+
if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
|
|
6359
6400
|
return;
|
|
6360
6401
|
const t = Run.start('PartLayout');
|
|
6361
6402
|
const { target, __updatedList: updateList } = this;
|
|
@@ -6820,9 +6861,10 @@ class Selector {
|
|
|
6820
6861
|
this.finder = Creator.finder && Creator.finder();
|
|
6821
6862
|
}
|
|
6822
6863
|
getByPoint(hitPoint, hitRadius, options) {
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6864
|
+
const { target, picker } = this;
|
|
6865
|
+
if (Platform.backgrounder)
|
|
6866
|
+
target && target.updateLayout();
|
|
6867
|
+
return picker.getByPoint(hitPoint, hitRadius, options);
|
|
6826
6868
|
}
|
|
6827
6869
|
getBy(condition, branch, one, options) {
|
|
6828
6870
|
return this.finder ? this.finder.getBy(condition, branch, one, options) : Plugin.need('find');
|
|
@@ -6880,9 +6922,7 @@ const TextConvert = {};
|
|
|
6880
6922
|
const ColorConvert = {};
|
|
6881
6923
|
const UnitConvert = {
|
|
6882
6924
|
number(value, percentRefer) {
|
|
6883
|
-
|
|
6884
|
-
return value.type === 'percent' ? value.value * percentRefer : value.value;
|
|
6885
|
-
return value;
|
|
6925
|
+
return typeof value === 'object' ? (value.type === 'percent' ? value.value * percentRefer : value.value) : value;
|
|
6886
6926
|
}
|
|
6887
6927
|
};
|
|
6888
6928
|
const PathArrow = {};
|
|
@@ -6890,16 +6930,15 @@ const Paint = {};
|
|
|
6890
6930
|
const PaintImage = {};
|
|
6891
6931
|
const PaintGradient = {};
|
|
6892
6932
|
const Effect = {};
|
|
6933
|
+
const Filter = {
|
|
6934
|
+
apply() { Plugin.need('filter'); }
|
|
6935
|
+
};
|
|
6893
6936
|
const Export = {};
|
|
6894
6937
|
const State = {
|
|
6895
|
-
setStyleName(
|
|
6896
|
-
set(
|
|
6897
|
-
};
|
|
6898
|
-
const Transition = {
|
|
6899
|
-
list: {},
|
|
6900
|
-
register(attrName, fn) { Transition.list[attrName] = fn; },
|
|
6901
|
-
get(attrName) { return Transition.list[attrName]; }
|
|
6938
|
+
setStyleName() { return Plugin.need('state'); },
|
|
6939
|
+
set() { return Plugin.need('state'); }
|
|
6902
6940
|
};
|
|
6941
|
+
const Transition = {};
|
|
6903
6942
|
|
|
6904
6943
|
const { parse, objectToCanvasData } = PathConvert;
|
|
6905
6944
|
const emptyPaint = {};
|
|
@@ -7006,24 +7045,13 @@ class UIData extends LeafData {
|
|
|
7006
7045
|
}
|
|
7007
7046
|
}
|
|
7008
7047
|
setShadow(value) {
|
|
7009
|
-
this
|
|
7010
|
-
if (value instanceof Array) {
|
|
7011
|
-
if (value.some((item) => item.visible === false))
|
|
7012
|
-
value = value.filter((item) => item.visible !== false);
|
|
7013
|
-
this._shadow = value.length ? value : null;
|
|
7014
|
-
}
|
|
7015
|
-
else
|
|
7016
|
-
this._shadow = value && value.visible !== false ? [value] : null;
|
|
7048
|
+
setArray(this, 'shadow', value);
|
|
7017
7049
|
}
|
|
7018
7050
|
setInnerShadow(value) {
|
|
7019
|
-
this
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
this._innerShadow = value.length ? value : null;
|
|
7024
|
-
}
|
|
7025
|
-
else
|
|
7026
|
-
this._innerShadow = value && value.visible !== false ? [value] : null;
|
|
7051
|
+
setArray(this, 'innerShadow', value);
|
|
7052
|
+
}
|
|
7053
|
+
setFilter(value) {
|
|
7054
|
+
setArray(this, 'filter', value);
|
|
7027
7055
|
}
|
|
7028
7056
|
__computePaint() {
|
|
7029
7057
|
const { fill, stroke } = this.__input;
|
|
@@ -7034,6 +7062,17 @@ class UIData extends LeafData {
|
|
|
7034
7062
|
this.__needComputePaint = false;
|
|
7035
7063
|
}
|
|
7036
7064
|
}
|
|
7065
|
+
function setArray(data, key, value) {
|
|
7066
|
+
data.__setInput(key, value);
|
|
7067
|
+
if (value instanceof Array) {
|
|
7068
|
+
if (value.some((item) => item.visible === false))
|
|
7069
|
+
value = value.filter((item) => item.visible !== false);
|
|
7070
|
+
value.length || (value = null);
|
|
7071
|
+
}
|
|
7072
|
+
else
|
|
7073
|
+
value = value && value.visible !== false ? [value] : null;
|
|
7074
|
+
data['_' + key] = value;
|
|
7075
|
+
}
|
|
7037
7076
|
|
|
7038
7077
|
class GroupData extends UIData {
|
|
7039
7078
|
}
|
|
@@ -7156,11 +7195,13 @@ const UIBounds = {
|
|
|
7156
7195
|
},
|
|
7157
7196
|
__updateRenderSpread() {
|
|
7158
7197
|
let width = 0;
|
|
7159
|
-
const { shadow, innerShadow, blur, backgroundBlur } = this.__;
|
|
7198
|
+
const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
|
|
7160
7199
|
if (shadow)
|
|
7161
7200
|
shadow.forEach(item => width = Math.max(width, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread > 0 ? item.spread : 0) + item.blur * 1.5));
|
|
7162
7201
|
if (blur)
|
|
7163
7202
|
width = Math.max(width, blur);
|
|
7203
|
+
if (filter)
|
|
7204
|
+
width += Filter.getSpread(filter);
|
|
7164
7205
|
let shapeWidth = width = Math.ceil(width);
|
|
7165
7206
|
if (innerShadow)
|
|
7166
7207
|
innerShadow.forEach(item => shapeWidth = Math.max(shapeWidth, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread < 0 ? -item.spread : 0) + item.blur * 1.5));
|
|
@@ -7175,8 +7216,8 @@ const UIRender = {
|
|
|
7175
7216
|
__updateChange() {
|
|
7176
7217
|
const data = this.__;
|
|
7177
7218
|
if (data.__useEffect) {
|
|
7178
|
-
const { shadow, innerShadow, blur, backgroundBlur } = this.__;
|
|
7179
|
-
data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur);
|
|
7219
|
+
const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
|
|
7220
|
+
data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur || filter);
|
|
7180
7221
|
}
|
|
7181
7222
|
data.__checkSingle();
|
|
7182
7223
|
const complex = data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect;
|
|
@@ -7190,7 +7231,7 @@ const UIRender = {
|
|
|
7190
7231
|
__drawFast(canvas, options) {
|
|
7191
7232
|
drawFast(this, canvas, options);
|
|
7192
7233
|
},
|
|
7193
|
-
__draw(canvas, options) {
|
|
7234
|
+
__draw(canvas, options, originCanvas) {
|
|
7194
7235
|
const data = this.__;
|
|
7195
7236
|
if (data.__complex) {
|
|
7196
7237
|
if (data.__needComputePaint)
|
|
@@ -7200,7 +7241,7 @@ const UIRender = {
|
|
|
7200
7241
|
if (data.__useEffect) {
|
|
7201
7242
|
const shape = Paint.shape(this, canvas, options);
|
|
7202
7243
|
this.__nowWorld = this.__getNowWorld(options);
|
|
7203
|
-
const { shadow, innerShadow } = data;
|
|
7244
|
+
const { shadow, innerShadow, filter } = data;
|
|
7204
7245
|
if (shadow)
|
|
7205
7246
|
Effect.shadow(this, canvas, shape);
|
|
7206
7247
|
if (fill)
|
|
@@ -7211,6 +7252,8 @@ const UIRender = {
|
|
|
7211
7252
|
Effect.innerShadow(this, canvas, shape);
|
|
7212
7253
|
if (stroke)
|
|
7213
7254
|
data.__isStrokes ? Paint.strokes(stroke, this, canvas) : Paint.stroke(stroke, this, canvas);
|
|
7255
|
+
if (filter)
|
|
7256
|
+
Filter.apply(filter, this, this.__nowWorld, canvas, originCanvas, shape);
|
|
7214
7257
|
if (shape.worldCanvas)
|
|
7215
7258
|
shape.worldCanvas.recycle();
|
|
7216
7259
|
shape.canvas.recycle();
|
|
@@ -7430,199 +7473,202 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7430
7473
|
};
|
|
7431
7474
|
__decorate([
|
|
7432
7475
|
dataProcessor(UIData)
|
|
7433
|
-
], UI.prototype, "__",
|
|
7476
|
+
], UI.prototype, "__", void 0);
|
|
7434
7477
|
__decorate([
|
|
7435
7478
|
zoomLayerType()
|
|
7436
|
-
], UI.prototype, "zoomLayer",
|
|
7479
|
+
], UI.prototype, "zoomLayer", void 0);
|
|
7437
7480
|
__decorate([
|
|
7438
7481
|
dataType('')
|
|
7439
|
-
], UI.prototype, "id",
|
|
7482
|
+
], UI.prototype, "id", void 0);
|
|
7440
7483
|
__decorate([
|
|
7441
7484
|
dataType('')
|
|
7442
|
-
], UI.prototype, "name",
|
|
7485
|
+
], UI.prototype, "name", void 0);
|
|
7443
7486
|
__decorate([
|
|
7444
7487
|
dataType('')
|
|
7445
|
-
], UI.prototype, "className",
|
|
7488
|
+
], UI.prototype, "className", void 0);
|
|
7446
7489
|
__decorate([
|
|
7447
7490
|
surfaceType('pass-through')
|
|
7448
|
-
], UI.prototype, "blendMode",
|
|
7491
|
+
], UI.prototype, "blendMode", void 0);
|
|
7449
7492
|
__decorate([
|
|
7450
7493
|
opacityType(1)
|
|
7451
|
-
], UI.prototype, "opacity",
|
|
7494
|
+
], UI.prototype, "opacity", void 0);
|
|
7452
7495
|
__decorate([
|
|
7453
7496
|
visibleType(true)
|
|
7454
|
-
], UI.prototype, "visible",
|
|
7497
|
+
], UI.prototype, "visible", void 0);
|
|
7455
7498
|
__decorate([
|
|
7456
7499
|
surfaceType(false)
|
|
7457
|
-
], UI.prototype, "locked",
|
|
7500
|
+
], UI.prototype, "locked", void 0);
|
|
7458
7501
|
__decorate([
|
|
7459
7502
|
sortType(0)
|
|
7460
|
-
], UI.prototype, "zIndex",
|
|
7503
|
+
], UI.prototype, "zIndex", void 0);
|
|
7461
7504
|
__decorate([
|
|
7462
7505
|
maskType(false)
|
|
7463
|
-
], UI.prototype, "mask",
|
|
7506
|
+
], UI.prototype, "mask", void 0);
|
|
7464
7507
|
__decorate([
|
|
7465
7508
|
eraserType(false)
|
|
7466
|
-
], UI.prototype, "eraser",
|
|
7509
|
+
], UI.prototype, "eraser", void 0);
|
|
7467
7510
|
__decorate([
|
|
7468
7511
|
positionType(0, true)
|
|
7469
|
-
], UI.prototype, "x",
|
|
7512
|
+
], UI.prototype, "x", void 0);
|
|
7470
7513
|
__decorate([
|
|
7471
7514
|
positionType(0, true)
|
|
7472
|
-
], UI.prototype, "y",
|
|
7515
|
+
], UI.prototype, "y", void 0);
|
|
7473
7516
|
__decorate([
|
|
7474
7517
|
boundsType(100, true)
|
|
7475
|
-
], UI.prototype, "width",
|
|
7518
|
+
], UI.prototype, "width", void 0);
|
|
7476
7519
|
__decorate([
|
|
7477
7520
|
boundsType(100, true)
|
|
7478
|
-
], UI.prototype, "height",
|
|
7521
|
+
], UI.prototype, "height", void 0);
|
|
7479
7522
|
__decorate([
|
|
7480
7523
|
scaleType(1, true)
|
|
7481
|
-
], UI.prototype, "scaleX",
|
|
7524
|
+
], UI.prototype, "scaleX", void 0);
|
|
7482
7525
|
__decorate([
|
|
7483
7526
|
scaleType(1, true)
|
|
7484
|
-
], UI.prototype, "scaleY",
|
|
7527
|
+
], UI.prototype, "scaleY", void 0);
|
|
7485
7528
|
__decorate([
|
|
7486
7529
|
rotationType(0, true)
|
|
7487
|
-
], UI.prototype, "rotation",
|
|
7530
|
+
], UI.prototype, "rotation", void 0);
|
|
7488
7531
|
__decorate([
|
|
7489
7532
|
rotationType(0, true)
|
|
7490
|
-
], UI.prototype, "skewX",
|
|
7533
|
+
], UI.prototype, "skewX", void 0);
|
|
7491
7534
|
__decorate([
|
|
7492
7535
|
rotationType(0, true)
|
|
7493
|
-
], UI.prototype, "skewY",
|
|
7536
|
+
], UI.prototype, "skewY", void 0);
|
|
7494
7537
|
__decorate([
|
|
7495
7538
|
positionType(0, true)
|
|
7496
|
-
], UI.prototype, "offsetX",
|
|
7539
|
+
], UI.prototype, "offsetX", void 0);
|
|
7497
7540
|
__decorate([
|
|
7498
7541
|
positionType(0, true)
|
|
7499
|
-
], UI.prototype, "offsetY",
|
|
7542
|
+
], UI.prototype, "offsetY", void 0);
|
|
7500
7543
|
__decorate([
|
|
7501
7544
|
positionType(0, true)
|
|
7502
|
-
], UI.prototype, "scrollX",
|
|
7545
|
+
], UI.prototype, "scrollX", void 0);
|
|
7503
7546
|
__decorate([
|
|
7504
7547
|
positionType(0, true)
|
|
7505
|
-
], UI.prototype, "scrollY",
|
|
7548
|
+
], UI.prototype, "scrollY", void 0);
|
|
7506
7549
|
__decorate([
|
|
7507
7550
|
autoLayoutType()
|
|
7508
|
-
], UI.prototype, "origin",
|
|
7551
|
+
], UI.prototype, "origin", void 0);
|
|
7509
7552
|
__decorate([
|
|
7510
7553
|
autoLayoutType()
|
|
7511
|
-
], UI.prototype, "around",
|
|
7554
|
+
], UI.prototype, "around", void 0);
|
|
7512
7555
|
__decorate([
|
|
7513
7556
|
dataType(false)
|
|
7514
|
-
], UI.prototype, "lazy",
|
|
7557
|
+
], UI.prototype, "lazy", void 0);
|
|
7515
7558
|
__decorate([
|
|
7516
7559
|
naturalBoundsType(1)
|
|
7517
|
-
], UI.prototype, "pixelRatio",
|
|
7560
|
+
], UI.prototype, "pixelRatio", void 0);
|
|
7518
7561
|
__decorate([
|
|
7519
7562
|
pathInputType()
|
|
7520
|
-
], UI.prototype, "path",
|
|
7563
|
+
], UI.prototype, "path", void 0);
|
|
7521
7564
|
__decorate([
|
|
7522
7565
|
pathType()
|
|
7523
|
-
], UI.prototype, "windingRule",
|
|
7566
|
+
], UI.prototype, "windingRule", void 0);
|
|
7524
7567
|
__decorate([
|
|
7525
7568
|
pathType(true)
|
|
7526
|
-
], UI.prototype, "closed",
|
|
7569
|
+
], UI.prototype, "closed", void 0);
|
|
7527
7570
|
__decorate([
|
|
7528
7571
|
boundsType(0)
|
|
7529
|
-
], UI.prototype, "padding",
|
|
7572
|
+
], UI.prototype, "padding", void 0);
|
|
7530
7573
|
__decorate([
|
|
7531
7574
|
boundsType(false)
|
|
7532
|
-
], UI.prototype, "lockRatio",
|
|
7575
|
+
], UI.prototype, "lockRatio", void 0);
|
|
7533
7576
|
__decorate([
|
|
7534
7577
|
boundsType()
|
|
7535
|
-
], UI.prototype, "widthRange",
|
|
7578
|
+
], UI.prototype, "widthRange", void 0);
|
|
7536
7579
|
__decorate([
|
|
7537
7580
|
boundsType()
|
|
7538
|
-
], UI.prototype, "heightRange",
|
|
7581
|
+
], UI.prototype, "heightRange", void 0);
|
|
7539
7582
|
__decorate([
|
|
7540
7583
|
dataType(false)
|
|
7541
|
-
], UI.prototype, "draggable",
|
|
7584
|
+
], UI.prototype, "draggable", void 0);
|
|
7542
7585
|
__decorate([
|
|
7543
7586
|
dataType()
|
|
7544
|
-
], UI.prototype, "dragBounds",
|
|
7587
|
+
], UI.prototype, "dragBounds", void 0);
|
|
7545
7588
|
__decorate([
|
|
7546
7589
|
dataType(false)
|
|
7547
|
-
], UI.prototype, "editable",
|
|
7590
|
+
], UI.prototype, "editable", void 0);
|
|
7548
7591
|
__decorate([
|
|
7549
7592
|
hitType(true)
|
|
7550
|
-
], UI.prototype, "hittable",
|
|
7593
|
+
], UI.prototype, "hittable", void 0);
|
|
7551
7594
|
__decorate([
|
|
7552
7595
|
hitType('path')
|
|
7553
|
-
], UI.prototype, "hitFill",
|
|
7596
|
+
], UI.prototype, "hitFill", void 0);
|
|
7554
7597
|
__decorate([
|
|
7555
7598
|
strokeType('path')
|
|
7556
|
-
], UI.prototype, "hitStroke",
|
|
7599
|
+
], UI.prototype, "hitStroke", void 0);
|
|
7557
7600
|
__decorate([
|
|
7558
7601
|
hitType(false)
|
|
7559
|
-
], UI.prototype, "hitBox",
|
|
7602
|
+
], UI.prototype, "hitBox", void 0);
|
|
7560
7603
|
__decorate([
|
|
7561
7604
|
hitType(true)
|
|
7562
|
-
], UI.prototype, "hitChildren",
|
|
7605
|
+
], UI.prototype, "hitChildren", void 0);
|
|
7563
7606
|
__decorate([
|
|
7564
7607
|
hitType(true)
|
|
7565
|
-
], UI.prototype, "hitSelf",
|
|
7608
|
+
], UI.prototype, "hitSelf", void 0);
|
|
7566
7609
|
__decorate([
|
|
7567
7610
|
hitType()
|
|
7568
|
-
], UI.prototype, "hitRadius",
|
|
7611
|
+
], UI.prototype, "hitRadius", void 0);
|
|
7569
7612
|
__decorate([
|
|
7570
7613
|
cursorType('')
|
|
7571
|
-
], UI.prototype, "cursor",
|
|
7614
|
+
], UI.prototype, "cursor", void 0);
|
|
7572
7615
|
__decorate([
|
|
7573
7616
|
surfaceType()
|
|
7574
|
-
], UI.prototype, "fill",
|
|
7617
|
+
], UI.prototype, "fill", void 0);
|
|
7575
7618
|
__decorate([
|
|
7576
7619
|
strokeType()
|
|
7577
|
-
], UI.prototype, "stroke",
|
|
7620
|
+
], UI.prototype, "stroke", void 0);
|
|
7578
7621
|
__decorate([
|
|
7579
7622
|
strokeType('inside')
|
|
7580
|
-
], UI.prototype, "strokeAlign",
|
|
7623
|
+
], UI.prototype, "strokeAlign", void 0);
|
|
7581
7624
|
__decorate([
|
|
7582
7625
|
strokeType(1)
|
|
7583
|
-
], UI.prototype, "strokeWidth",
|
|
7626
|
+
], UI.prototype, "strokeWidth", void 0);
|
|
7584
7627
|
__decorate([
|
|
7585
7628
|
strokeType(false)
|
|
7586
|
-
], UI.prototype, "strokeWidthFixed",
|
|
7629
|
+
], UI.prototype, "strokeWidthFixed", void 0);
|
|
7587
7630
|
__decorate([
|
|
7588
7631
|
strokeType('none')
|
|
7589
|
-
], UI.prototype, "strokeCap",
|
|
7632
|
+
], UI.prototype, "strokeCap", void 0);
|
|
7590
7633
|
__decorate([
|
|
7591
7634
|
strokeType('miter')
|
|
7592
|
-
], UI.prototype, "strokeJoin",
|
|
7635
|
+
], UI.prototype, "strokeJoin", void 0);
|
|
7593
7636
|
__decorate([
|
|
7594
7637
|
strokeType()
|
|
7595
|
-
], UI.prototype, "dashPattern",
|
|
7638
|
+
], UI.prototype, "dashPattern", void 0);
|
|
7596
7639
|
__decorate([
|
|
7597
7640
|
strokeType()
|
|
7598
|
-
], UI.prototype, "dashOffset",
|
|
7641
|
+
], UI.prototype, "dashOffset", void 0);
|
|
7599
7642
|
__decorate([
|
|
7600
7643
|
strokeType(10)
|
|
7601
|
-
], UI.prototype, "miterLimit",
|
|
7644
|
+
], UI.prototype, "miterLimit", void 0);
|
|
7602
7645
|
__decorate([
|
|
7603
7646
|
pathType(0)
|
|
7604
|
-
], UI.prototype, "cornerRadius",
|
|
7647
|
+
], UI.prototype, "cornerRadius", void 0);
|
|
7605
7648
|
__decorate([
|
|
7606
7649
|
pathType()
|
|
7607
|
-
], UI.prototype, "cornerSmoothing",
|
|
7650
|
+
], UI.prototype, "cornerSmoothing", void 0);
|
|
7651
|
+
__decorate([
|
|
7652
|
+
effectType()
|
|
7653
|
+
], UI.prototype, "shadow", void 0);
|
|
7608
7654
|
__decorate([
|
|
7609
7655
|
effectType()
|
|
7610
|
-
], UI.prototype, "
|
|
7656
|
+
], UI.prototype, "innerShadow", void 0);
|
|
7611
7657
|
__decorate([
|
|
7612
7658
|
effectType()
|
|
7613
|
-
], UI.prototype, "
|
|
7659
|
+
], UI.prototype, "blur", void 0);
|
|
7614
7660
|
__decorate([
|
|
7615
7661
|
effectType()
|
|
7616
|
-
], UI.prototype, "
|
|
7662
|
+
], UI.prototype, "backgroundBlur", void 0);
|
|
7617
7663
|
__decorate([
|
|
7618
7664
|
effectType()
|
|
7619
|
-
], UI.prototype, "
|
|
7665
|
+
], UI.prototype, "grayscale", void 0);
|
|
7620
7666
|
__decorate([
|
|
7621
7667
|
effectType()
|
|
7622
|
-
], UI.prototype, "
|
|
7668
|
+
], UI.prototype, "filter", void 0);
|
|
7623
7669
|
__decorate([
|
|
7624
7670
|
dataType({})
|
|
7625
|
-
], UI.prototype, "data",
|
|
7671
|
+
], UI.prototype, "data", void 0);
|
|
7626
7672
|
__decorate([
|
|
7627
7673
|
rewrite(Leaf.prototype.reset)
|
|
7628
7674
|
], UI.prototype, "reset", null);
|
|
@@ -7683,7 +7729,7 @@ let Group = class Group extends UI {
|
|
|
7683
7729
|
};
|
|
7684
7730
|
__decorate([
|
|
7685
7731
|
dataProcessor(GroupData)
|
|
7686
|
-
], Group.prototype, "__",
|
|
7732
|
+
], Group.prototype, "__", void 0);
|
|
7687
7733
|
Group = __decorate([
|
|
7688
7734
|
useModule(Branch),
|
|
7689
7735
|
registerUI()
|
|
@@ -7696,7 +7742,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7696
7742
|
get isApp() { return false; }
|
|
7697
7743
|
get app() { return this.parent || this; }
|
|
7698
7744
|
get isLeafer() { return true; }
|
|
7699
|
-
get imageReady() { return this.viewReady &&
|
|
7745
|
+
get imageReady() { return this.viewReady && Resource.isComplete; }
|
|
7700
7746
|
get layoutLocked() { return !this.layouter.running; }
|
|
7701
7747
|
get FPS() { return this.renderer ? this.renderer.FPS : 60; }
|
|
7702
7748
|
get cursorPoint() { return (this.interaction && this.interaction.hoverData) || { x: this.width / 2, y: this.height / 2 }; }
|
|
@@ -7907,13 +7953,13 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7907
7953
|
WaitHelper.run(this.__viewReadyWait);
|
|
7908
7954
|
}
|
|
7909
7955
|
__onLayoutEnd() {
|
|
7910
|
-
const { grow,
|
|
7956
|
+
const { grow, width: fixedWidth, height: fixedHeight } = this.config;
|
|
7911
7957
|
if (grow) {
|
|
7912
7958
|
let { width, height, pixelRatio } = this;
|
|
7913
7959
|
const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
|
|
7914
|
-
if (
|
|
7960
|
+
if (!fixedWidth)
|
|
7915
7961
|
width = Math.max(1, bounds.x + bounds.width);
|
|
7916
|
-
if (
|
|
7962
|
+
if (!fixedHeight)
|
|
7917
7963
|
height = Math.max(1, bounds.y + bounds.height);
|
|
7918
7964
|
this.__doResize({ width, height, pixelRatio });
|
|
7919
7965
|
}
|
|
@@ -7991,7 +8037,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7991
8037
|
list.push(item);
|
|
7992
8038
|
this.requestRender();
|
|
7993
8039
|
}
|
|
7994
|
-
zoom(_zoomType, _padding, _fixedScale) {
|
|
8040
|
+
zoom(_zoomType, _padding, _fixedScale, _transition) {
|
|
7995
8041
|
return Plugin.need('view');
|
|
7996
8042
|
}
|
|
7997
8043
|
getValidMove(moveX, moveY) { return { x: moveX, y: moveY }; }
|
|
@@ -8056,10 +8102,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8056
8102
|
Leafer.list = new LeafList();
|
|
8057
8103
|
__decorate([
|
|
8058
8104
|
dataProcessor(LeaferData)
|
|
8059
|
-
], Leafer.prototype, "__",
|
|
8105
|
+
], Leafer.prototype, "__", void 0);
|
|
8060
8106
|
__decorate([
|
|
8061
8107
|
boundsType()
|
|
8062
|
-
], Leafer.prototype, "pixelRatio",
|
|
8108
|
+
], Leafer.prototype, "pixelRatio", void 0);
|
|
8063
8109
|
Leafer = Leafer_1 = __decorate([
|
|
8064
8110
|
registerUI()
|
|
8065
8111
|
], Leafer);
|
|
@@ -8072,7 +8118,7 @@ let Rect = class Rect extends UI {
|
|
|
8072
8118
|
};
|
|
8073
8119
|
__decorate([
|
|
8074
8120
|
dataProcessor(RectData)
|
|
8075
|
-
], Rect.prototype, "__",
|
|
8121
|
+
], Rect.prototype, "__", void 0);
|
|
8076
8122
|
Rect = __decorate([
|
|
8077
8123
|
useModule(RectRender),
|
|
8078
8124
|
rewriteAble(),
|
|
@@ -8163,13 +8209,13 @@ let Box = class Box extends Group {
|
|
|
8163
8209
|
};
|
|
8164
8210
|
__decorate([
|
|
8165
8211
|
dataProcessor(BoxData)
|
|
8166
|
-
], Box.prototype, "__",
|
|
8212
|
+
], Box.prototype, "__", void 0);
|
|
8167
8213
|
__decorate([
|
|
8168
8214
|
dataType(false)
|
|
8169
|
-
], Box.prototype, "resizeChildren",
|
|
8215
|
+
], Box.prototype, "resizeChildren", void 0);
|
|
8170
8216
|
__decorate([
|
|
8171
8217
|
affectRenderBoundsType('show')
|
|
8172
|
-
], Box.prototype, "overflow",
|
|
8218
|
+
], Box.prototype, "overflow", void 0);
|
|
8173
8219
|
__decorate([
|
|
8174
8220
|
rewrite(rect$1.__updateStrokeSpread)
|
|
8175
8221
|
], Box.prototype, "__updateStrokeSpread", null);
|
|
@@ -8208,13 +8254,13 @@ let Frame = class Frame extends Box {
|
|
|
8208
8254
|
};
|
|
8209
8255
|
__decorate([
|
|
8210
8256
|
dataProcessor(FrameData)
|
|
8211
|
-
], Frame.prototype, "__",
|
|
8257
|
+
], Frame.prototype, "__", void 0);
|
|
8212
8258
|
__decorate([
|
|
8213
8259
|
surfaceType('#FFFFFF')
|
|
8214
|
-
], Frame.prototype, "fill",
|
|
8260
|
+
], Frame.prototype, "fill", void 0);
|
|
8215
8261
|
__decorate([
|
|
8216
8262
|
affectRenderBoundsType('hide')
|
|
8217
|
-
], Frame.prototype, "overflow",
|
|
8263
|
+
], Frame.prototype, "overflow", void 0);
|
|
8218
8264
|
Frame = __decorate([
|
|
8219
8265
|
registerUI()
|
|
8220
8266
|
], Frame);
|
|
@@ -8261,16 +8307,16 @@ let Ellipse = class Ellipse extends UI {
|
|
|
8261
8307
|
};
|
|
8262
8308
|
__decorate([
|
|
8263
8309
|
dataProcessor(EllipseData)
|
|
8264
|
-
], Ellipse.prototype, "__",
|
|
8310
|
+
], Ellipse.prototype, "__", void 0);
|
|
8265
8311
|
__decorate([
|
|
8266
8312
|
pathType(0)
|
|
8267
|
-
], Ellipse.prototype, "innerRadius",
|
|
8313
|
+
], Ellipse.prototype, "innerRadius", void 0);
|
|
8268
8314
|
__decorate([
|
|
8269
8315
|
pathType(0)
|
|
8270
|
-
], Ellipse.prototype, "startAngle",
|
|
8316
|
+
], Ellipse.prototype, "startAngle", void 0);
|
|
8271
8317
|
__decorate([
|
|
8272
8318
|
pathType(0)
|
|
8273
|
-
], Ellipse.prototype, "endAngle",
|
|
8319
|
+
], Ellipse.prototype, "endAngle", void 0);
|
|
8274
8320
|
Ellipse = __decorate([
|
|
8275
8321
|
registerUI()
|
|
8276
8322
|
], Ellipse);
|
|
@@ -8329,22 +8375,22 @@ let Line = class Line extends UI {
|
|
|
8329
8375
|
};
|
|
8330
8376
|
__decorate([
|
|
8331
8377
|
dataProcessor(LineData)
|
|
8332
|
-
], Line.prototype, "__",
|
|
8378
|
+
], Line.prototype, "__", void 0);
|
|
8333
8379
|
__decorate([
|
|
8334
8380
|
affectStrokeBoundsType('center')
|
|
8335
|
-
], Line.prototype, "strokeAlign",
|
|
8381
|
+
], Line.prototype, "strokeAlign", void 0);
|
|
8336
8382
|
__decorate([
|
|
8337
8383
|
boundsType(0)
|
|
8338
|
-
], Line.prototype, "height",
|
|
8384
|
+
], Line.prototype, "height", void 0);
|
|
8339
8385
|
__decorate([
|
|
8340
8386
|
pathType()
|
|
8341
|
-
], Line.prototype, "points",
|
|
8387
|
+
], Line.prototype, "points", void 0);
|
|
8342
8388
|
__decorate([
|
|
8343
8389
|
pathType(0)
|
|
8344
|
-
], Line.prototype, "curve",
|
|
8390
|
+
], Line.prototype, "curve", void 0);
|
|
8345
8391
|
__decorate([
|
|
8346
8392
|
pathType(false)
|
|
8347
|
-
], Line.prototype, "closed",
|
|
8393
|
+
], Line.prototype, "closed", void 0);
|
|
8348
8394
|
Line = __decorate([
|
|
8349
8395
|
registerUI()
|
|
8350
8396
|
], Line);
|
|
@@ -8377,16 +8423,16 @@ let Polygon = class Polygon extends UI {
|
|
|
8377
8423
|
};
|
|
8378
8424
|
__decorate([
|
|
8379
8425
|
dataProcessor(PolygonData)
|
|
8380
|
-
], Polygon.prototype, "__",
|
|
8426
|
+
], Polygon.prototype, "__", void 0);
|
|
8381
8427
|
__decorate([
|
|
8382
8428
|
pathType(3)
|
|
8383
|
-
], Polygon.prototype, "sides",
|
|
8429
|
+
], Polygon.prototype, "sides", void 0);
|
|
8384
8430
|
__decorate([
|
|
8385
8431
|
pathType()
|
|
8386
|
-
], Polygon.prototype, "points",
|
|
8432
|
+
], Polygon.prototype, "points", void 0);
|
|
8387
8433
|
__decorate([
|
|
8388
8434
|
pathType(0)
|
|
8389
|
-
], Polygon.prototype, "curve",
|
|
8435
|
+
], Polygon.prototype, "curve", void 0);
|
|
8390
8436
|
__decorate([
|
|
8391
8437
|
rewrite(line.__updateRenderPath)
|
|
8392
8438
|
], Polygon.prototype, "__updateRenderPath", null);
|
|
@@ -8418,13 +8464,13 @@ let Star = class Star extends UI {
|
|
|
8418
8464
|
};
|
|
8419
8465
|
__decorate([
|
|
8420
8466
|
dataProcessor(StarData)
|
|
8421
|
-
], Star.prototype, "__",
|
|
8467
|
+
], Star.prototype, "__", void 0);
|
|
8422
8468
|
__decorate([
|
|
8423
8469
|
pathType(5)
|
|
8424
|
-
], Star.prototype, "corners",
|
|
8470
|
+
], Star.prototype, "corners", void 0);
|
|
8425
8471
|
__decorate([
|
|
8426
8472
|
pathType(0.382)
|
|
8427
|
-
], Star.prototype, "innerRadius",
|
|
8473
|
+
], Star.prototype, "innerRadius", void 0);
|
|
8428
8474
|
Star = __decorate([
|
|
8429
8475
|
registerUI()
|
|
8430
8476
|
], Star);
|
|
@@ -8446,10 +8492,10 @@ let Image = class Image extends Rect {
|
|
|
8446
8492
|
};
|
|
8447
8493
|
__decorate([
|
|
8448
8494
|
dataProcessor(ImageData)
|
|
8449
|
-
], Image.prototype, "__",
|
|
8495
|
+
], Image.prototype, "__", void 0);
|
|
8450
8496
|
__decorate([
|
|
8451
8497
|
boundsType('')
|
|
8452
|
-
], Image.prototype, "url",
|
|
8498
|
+
], Image.prototype, "url", void 0);
|
|
8453
8499
|
Image = __decorate([
|
|
8454
8500
|
registerUI()
|
|
8455
8501
|
], Image);
|
|
@@ -8512,25 +8558,25 @@ let Canvas = class Canvas extends Rect {
|
|
|
8512
8558
|
};
|
|
8513
8559
|
__decorate([
|
|
8514
8560
|
dataProcessor(CanvasData)
|
|
8515
|
-
], Canvas.prototype, "__",
|
|
8561
|
+
], Canvas.prototype, "__", void 0);
|
|
8516
8562
|
__decorate([
|
|
8517
8563
|
resizeType(100)
|
|
8518
|
-
], Canvas.prototype, "width",
|
|
8564
|
+
], Canvas.prototype, "width", void 0);
|
|
8519
8565
|
__decorate([
|
|
8520
8566
|
resizeType(100)
|
|
8521
|
-
], Canvas.prototype, "height",
|
|
8567
|
+
], Canvas.prototype, "height", void 0);
|
|
8522
8568
|
__decorate([
|
|
8523
8569
|
resizeType(1)
|
|
8524
|
-
], Canvas.prototype, "pixelRatio",
|
|
8570
|
+
], Canvas.prototype, "pixelRatio", void 0);
|
|
8525
8571
|
__decorate([
|
|
8526
8572
|
resizeType(true)
|
|
8527
|
-
], Canvas.prototype, "smooth",
|
|
8573
|
+
], Canvas.prototype, "smooth", void 0);
|
|
8528
8574
|
__decorate([
|
|
8529
8575
|
dataType(false)
|
|
8530
|
-
], Canvas.prototype, "safeResize",
|
|
8576
|
+
], Canvas.prototype, "safeResize", void 0);
|
|
8531
8577
|
__decorate([
|
|
8532
8578
|
resizeType()
|
|
8533
|
-
], Canvas.prototype, "contextSettings",
|
|
8579
|
+
], Canvas.prototype, "contextSettings", void 0);
|
|
8534
8580
|
Canvas = __decorate([
|
|
8535
8581
|
registerUI()
|
|
8536
8582
|
], Canvas);
|
|
@@ -8621,76 +8667,76 @@ let Text = class Text extends UI {
|
|
|
8621
8667
|
};
|
|
8622
8668
|
__decorate([
|
|
8623
8669
|
dataProcessor(TextData)
|
|
8624
|
-
], Text.prototype, "__",
|
|
8670
|
+
], Text.prototype, "__", void 0);
|
|
8625
8671
|
__decorate([
|
|
8626
8672
|
boundsType(0)
|
|
8627
|
-
], Text.prototype, "width",
|
|
8673
|
+
], Text.prototype, "width", void 0);
|
|
8628
8674
|
__decorate([
|
|
8629
8675
|
boundsType(0)
|
|
8630
|
-
], Text.prototype, "height",
|
|
8676
|
+
], Text.prototype, "height", void 0);
|
|
8631
8677
|
__decorate([
|
|
8632
8678
|
dataType(false)
|
|
8633
|
-
], Text.prototype, "resizeFontSize",
|
|
8679
|
+
], Text.prototype, "resizeFontSize", void 0);
|
|
8634
8680
|
__decorate([
|
|
8635
8681
|
surfaceType('#000000')
|
|
8636
|
-
], Text.prototype, "fill",
|
|
8682
|
+
], Text.prototype, "fill", void 0);
|
|
8637
8683
|
__decorate([
|
|
8638
8684
|
affectStrokeBoundsType('outside')
|
|
8639
|
-
], Text.prototype, "strokeAlign",
|
|
8685
|
+
], Text.prototype, "strokeAlign", void 0);
|
|
8640
8686
|
__decorate([
|
|
8641
8687
|
hitType('all')
|
|
8642
|
-
], Text.prototype, "hitFill",
|
|
8688
|
+
], Text.prototype, "hitFill", void 0);
|
|
8643
8689
|
__decorate([
|
|
8644
8690
|
boundsType('')
|
|
8645
|
-
], Text.prototype, "text",
|
|
8691
|
+
], Text.prototype, "text", void 0);
|
|
8646
8692
|
__decorate([
|
|
8647
8693
|
boundsType('caption')
|
|
8648
|
-
], Text.prototype, "fontFamily",
|
|
8694
|
+
], Text.prototype, "fontFamily", void 0);
|
|
8649
8695
|
__decorate([
|
|
8650
8696
|
boundsType(12)
|
|
8651
|
-
], Text.prototype, "fontSize",
|
|
8697
|
+
], Text.prototype, "fontSize", void 0);
|
|
8652
8698
|
__decorate([
|
|
8653
8699
|
boundsType('normal')
|
|
8654
|
-
], Text.prototype, "fontWeight",
|
|
8700
|
+
], Text.prototype, "fontWeight", void 0);
|
|
8655
8701
|
__decorate([
|
|
8656
8702
|
boundsType(false)
|
|
8657
|
-
], Text.prototype, "italic",
|
|
8703
|
+
], Text.prototype, "italic", void 0);
|
|
8658
8704
|
__decorate([
|
|
8659
8705
|
boundsType('none')
|
|
8660
|
-
], Text.prototype, "textCase",
|
|
8706
|
+
], Text.prototype, "textCase", void 0);
|
|
8661
8707
|
__decorate([
|
|
8662
8708
|
boundsType('none')
|
|
8663
|
-
], Text.prototype, "textDecoration",
|
|
8709
|
+
], Text.prototype, "textDecoration", void 0);
|
|
8664
8710
|
__decorate([
|
|
8665
8711
|
boundsType(0)
|
|
8666
|
-
], Text.prototype, "letterSpacing",
|
|
8712
|
+
], Text.prototype, "letterSpacing", void 0);
|
|
8667
8713
|
__decorate([
|
|
8668
8714
|
boundsType({ type: 'percent', value: 1.5 })
|
|
8669
|
-
], Text.prototype, "lineHeight",
|
|
8715
|
+
], Text.prototype, "lineHeight", void 0);
|
|
8670
8716
|
__decorate([
|
|
8671
8717
|
boundsType(0)
|
|
8672
|
-
], Text.prototype, "paraIndent",
|
|
8718
|
+
], Text.prototype, "paraIndent", void 0);
|
|
8673
8719
|
__decorate([
|
|
8674
8720
|
boundsType(0)
|
|
8675
|
-
], Text.prototype, "paraSpacing",
|
|
8721
|
+
], Text.prototype, "paraSpacing", void 0);
|
|
8676
8722
|
__decorate([
|
|
8677
8723
|
boundsType('x')
|
|
8678
|
-
], Text.prototype, "writingMode",
|
|
8724
|
+
], Text.prototype, "writingMode", void 0);
|
|
8679
8725
|
__decorate([
|
|
8680
8726
|
boundsType('left')
|
|
8681
|
-
], Text.prototype, "textAlign",
|
|
8727
|
+
], Text.prototype, "textAlign", void 0);
|
|
8682
8728
|
__decorate([
|
|
8683
8729
|
boundsType('top')
|
|
8684
|
-
], Text.prototype, "verticalAlign",
|
|
8730
|
+
], Text.prototype, "verticalAlign", void 0);
|
|
8685
8731
|
__decorate([
|
|
8686
8732
|
boundsType(true)
|
|
8687
|
-
], Text.prototype, "autoSizeAlign",
|
|
8733
|
+
], Text.prototype, "autoSizeAlign", void 0);
|
|
8688
8734
|
__decorate([
|
|
8689
8735
|
boundsType('normal')
|
|
8690
|
-
], Text.prototype, "textWrap",
|
|
8736
|
+
], Text.prototype, "textWrap", void 0);
|
|
8691
8737
|
__decorate([
|
|
8692
8738
|
boundsType('show')
|
|
8693
|
-
], Text.prototype, "textOverflow",
|
|
8739
|
+
], Text.prototype, "textOverflow", void 0);
|
|
8694
8740
|
Text = __decorate([
|
|
8695
8741
|
registerUI()
|
|
8696
8742
|
], Text);
|
|
@@ -8703,10 +8749,10 @@ let Path = class Path extends UI {
|
|
|
8703
8749
|
};
|
|
8704
8750
|
__decorate([
|
|
8705
8751
|
dataProcessor(PathData)
|
|
8706
|
-
], Path.prototype, "__",
|
|
8752
|
+
], Path.prototype, "__", void 0);
|
|
8707
8753
|
__decorate([
|
|
8708
8754
|
affectStrokeBoundsType('center')
|
|
8709
|
-
], Path.prototype, "strokeAlign",
|
|
8755
|
+
], Path.prototype, "strokeAlign", void 0);
|
|
8710
8756
|
Path = __decorate([
|
|
8711
8757
|
registerUI()
|
|
8712
8758
|
], Path);
|
|
@@ -8745,10 +8791,10 @@ let Pen = class Pen extends Group {
|
|
|
8745
8791
|
};
|
|
8746
8792
|
__decorate([
|
|
8747
8793
|
dataProcessor(PenData)
|
|
8748
|
-
], Pen.prototype, "__",
|
|
8794
|
+
], Pen.prototype, "__", void 0);
|
|
8749
8795
|
__decorate([
|
|
8750
8796
|
penPathType()
|
|
8751
|
-
], Pen.prototype, "path",
|
|
8797
|
+
], Pen.prototype, "path", void 0);
|
|
8752
8798
|
Pen = __decorate([
|
|
8753
8799
|
useModule(PathCreator, ['set', 'path', 'paint']),
|
|
8754
8800
|
registerUI()
|
|
@@ -8984,7 +9030,7 @@ let DragEvent = class DragEvent extends PointerEvent {
|
|
|
8984
9030
|
const { draggable, dragBounds } = leaf, move = leaf.getLocalPoint(total, null, true);
|
|
8985
9031
|
PointHelper.move(move, start.x - leaf.x, start.y - leaf.y);
|
|
8986
9032
|
if (dragBounds)
|
|
8987
|
-
this.getMoveInDragBounds(leaf.
|
|
9033
|
+
this.getMoveInDragBounds(leaf.__localBoxBounds, dragBounds === 'parent' ? leaf.parent.boxBounds : dragBounds, move, true);
|
|
8988
9034
|
if (draggable === 'x')
|
|
8989
9035
|
move.y = 0;
|
|
8990
9036
|
if (draggable === 'y')
|
|
@@ -9515,10 +9561,9 @@ class InteractionBase {
|
|
|
9515
9561
|
}
|
|
9516
9562
|
}
|
|
9517
9563
|
pointerMoveReal(data) {
|
|
9518
|
-
const { dragHover, dragDistance } = this.p;
|
|
9519
9564
|
this.emit(PointerEvent.BEFORE_MOVE, data, this.defaultPath);
|
|
9520
9565
|
if (this.downData) {
|
|
9521
|
-
const canDrag = PointHelper.getDistance(this.downData, data) > dragDistance;
|
|
9566
|
+
const canDrag = PointHelper.getDistance(this.downData, data) > this.p.dragDistance;
|
|
9522
9567
|
if (canDrag) {
|
|
9523
9568
|
if (this.waitTap)
|
|
9524
9569
|
this.pointerWaitCancel();
|
|
@@ -9530,9 +9575,8 @@ class InteractionBase {
|
|
|
9530
9575
|
this.updateHoverData(data);
|
|
9531
9576
|
this.checkPath(data);
|
|
9532
9577
|
this.emit(PointerEvent.MOVE, data);
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
if (this.dragger.dragging) {
|
|
9578
|
+
this.pointerHover(data);
|
|
9579
|
+
if (this.dragging) {
|
|
9536
9580
|
this.dragger.dragOverOrOut(data);
|
|
9537
9581
|
this.dragger.dragEnterOrLeave(data);
|
|
9538
9582
|
}
|
|
@@ -9613,7 +9657,8 @@ class InteractionBase {
|
|
|
9613
9657
|
this.updateCursor();
|
|
9614
9658
|
}
|
|
9615
9659
|
pointerHover(data) {
|
|
9616
|
-
if (this.canHover) {
|
|
9660
|
+
if (this.canHover && !(this.dragging && !this.p.dragHover)) {
|
|
9661
|
+
data.path || (data.path = new LeafList());
|
|
9617
9662
|
this.pointerOverOrOut(data);
|
|
9618
9663
|
this.pointerEnterOrLeave(data);
|
|
9619
9664
|
}
|
|
@@ -9688,7 +9733,9 @@ class InteractionBase {
|
|
|
9688
9733
|
}
|
|
9689
9734
|
findPath(data, options) {
|
|
9690
9735
|
const { hitRadius, through } = this.p;
|
|
9691
|
-
const { bottomList } = this;
|
|
9736
|
+
const { bottomList, target } = this;
|
|
9737
|
+
if (!Platform.backgrounder && !data.origin)
|
|
9738
|
+
target && target.updateLayout();
|
|
9692
9739
|
const find = this.selector.getByPoint(data, hitRadius, Object.assign({ bottomList, name: data.type }, (options || { through })));
|
|
9693
9740
|
if (find.throughPath)
|
|
9694
9741
|
data.throughPath = find.throughPath;
|
|
@@ -9933,9 +9980,9 @@ leaf$1.__hitWorld = function (point) {
|
|
|
9933
9980
|
}
|
|
9934
9981
|
return this.__hit(inner);
|
|
9935
9982
|
};
|
|
9936
|
-
leaf$1.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a ===
|
|
9937
|
-
leaf$1.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a ===
|
|
9938
|
-
leaf$1.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a ===
|
|
9983
|
+
leaf$1.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitFill(inner, this.__.windingRule); };
|
|
9984
|
+
leaf$1.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitStroke(inner, strokeWidth); };
|
|
9985
|
+
leaf$1.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitPixel(inner, this.__layout.renderBounds, this.__hitCanvas.hitScale); };
|
|
9939
9986
|
leaf$1.__drawHitPath = function (canvas) { if (canvas)
|
|
9940
9987
|
this.__drawRenderPath(canvas); };
|
|
9941
9988
|
|
|
@@ -10023,8 +10070,8 @@ function getSelector$1(ui) {
|
|
|
10023
10070
|
return ui.leafer ? ui.leafer.selector : (Platform.selector || (Platform.selector = Creator.selector()));
|
|
10024
10071
|
}
|
|
10025
10072
|
Group.prototype.pick = function (hitPoint, options) {
|
|
10026
|
-
this.leafer || this.updateLayout();
|
|
10027
10073
|
options || (options = emptyData);
|
|
10074
|
+
this.updateLayout();
|
|
10028
10075
|
return getSelector$1(this).getByPoint(hitPoint, options.hitRadius || 0, Object.assign(Object.assign({}, options), { target: this }));
|
|
10029
10076
|
};
|
|
10030
10077
|
|
|
@@ -10408,7 +10455,7 @@ function getPatternData(paint, box, image) {
|
|
|
10408
10455
|
box = tempBox.set(box).shrink(paint.padding);
|
|
10409
10456
|
if (paint.mode === 'strench')
|
|
10410
10457
|
paint.mode = 'stretch';
|
|
10411
|
-
const { opacity, mode, align, offset, scale, size, rotation, repeat } = paint;
|
|
10458
|
+
const { opacity, mode, align, offset, scale, size, rotation, repeat, filters } = paint;
|
|
10412
10459
|
const sameBox = box.width === width && box.height === height;
|
|
10413
10460
|
const data = { mode };
|
|
10414
10461
|
const swapSize = align !== 'center' && (rotation || 0) % 180 === 90;
|
|
@@ -10471,6 +10518,8 @@ function getPatternData(paint, box, image) {
|
|
|
10471
10518
|
data.height = height;
|
|
10472
10519
|
if (opacity)
|
|
10473
10520
|
data.opacity = opacity;
|
|
10521
|
+
if (filters)
|
|
10522
|
+
data.filters = filters;
|
|
10474
10523
|
if (repeat)
|
|
10475
10524
|
data.repeat = typeof repeat === 'string' ? (repeat === 'x' ? 'repeat-x' : 'repeat-y') : 'repeat';
|
|
10476
10525
|
return data;
|
|
@@ -10573,7 +10622,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
10573
10622
|
scaleX = abs$3(scaleX);
|
|
10574
10623
|
scaleY = abs$3(scaleY);
|
|
10575
10624
|
const { image, data } = paint;
|
|
10576
|
-
let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy,
|
|
10625
|
+
let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, transform, repeat } = data;
|
|
10577
10626
|
if (sx) {
|
|
10578
10627
|
imageMatrix = get$1();
|
|
10579
10628
|
copy$4(imageMatrix, transform);
|
|
@@ -10616,7 +10665,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
10616
10665
|
}
|
|
10617
10666
|
scale$2(imageMatrix, 1 / scaleX, 1 / scaleY);
|
|
10618
10667
|
}
|
|
10619
|
-
const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, opacity);
|
|
10668
|
+
const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, data.opacity, data.filters);
|
|
10620
10669
|
const pattern = image.getPattern(canvas, repeat || (Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint);
|
|
10621
10670
|
paint.style = pattern;
|
|
10622
10671
|
paint.patternId = id;
|
|
@@ -10660,7 +10709,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
10660
10709
|
canvas.opacity *= data.opacity;
|
|
10661
10710
|
if (data.transform)
|
|
10662
10711
|
canvas.transform(data.transform);
|
|
10663
|
-
canvas.drawImage(paint.image.
|
|
10712
|
+
canvas.drawImage(paint.image.getFull(data.filters), 0, 0, data.width, data.height);
|
|
10664
10713
|
canvas.restore();
|
|
10665
10714
|
return true;
|
|
10666
10715
|
}
|
|
@@ -10670,7 +10719,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
10670
10719
|
}
|
|
10671
10720
|
else {
|
|
10672
10721
|
if (!paint.patternTask) {
|
|
10673
|
-
paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this,
|
|
10722
|
+
paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
|
|
10674
10723
|
paint.patternTask = null;
|
|
10675
10724
|
if (canvas.bounds.hit(ui.__nowWorld))
|
|
10676
10725
|
createPattern(ui, paint, pixelRatio);
|
|
@@ -11260,11 +11309,11 @@ const TextMode = 2;
|
|
|
11260
11309
|
function layoutChar(drawData, style, width, _height) {
|
|
11261
11310
|
const { rows } = drawData;
|
|
11262
11311
|
const { textAlign, paraIndent, letterSpacing } = style;
|
|
11263
|
-
let charX, addWordWidth, indentWidth, mode, wordChar;
|
|
11312
|
+
let charX, addWordWidth, indentWidth, mode, wordChar, wordsLength;
|
|
11264
11313
|
rows.forEach(row => {
|
|
11265
11314
|
if (row.words) {
|
|
11266
|
-
indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
|
|
11267
|
-
addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') &&
|
|
11315
|
+
indentWidth = paraIndent && row.paraStart ? paraIndent : 0, wordsLength = row.words.length;
|
|
11316
|
+
addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && wordsLength > 1) ? (width - row.width - indentWidth) / (wordsLength - 1) : 0;
|
|
11268
11317
|
mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
|
|
11269
11318
|
if (row.isOverflow && !letterSpacing)
|
|
11270
11319
|
row.textMode = true;
|
|
@@ -11276,7 +11325,7 @@ function layoutChar(drawData, style, width, _height) {
|
|
|
11276
11325
|
row.x += indentWidth;
|
|
11277
11326
|
charX = row.x;
|
|
11278
11327
|
row.data = [];
|
|
11279
|
-
row.words.forEach(word => {
|
|
11328
|
+
row.words.forEach((word, index) => {
|
|
11280
11329
|
if (mode === WordMode) {
|
|
11281
11330
|
wordChar = { char: '', x: charX };
|
|
11282
11331
|
charX = toWordChar(word.data, charX, wordChar);
|
|
@@ -11286,7 +11335,7 @@ function layoutChar(drawData, style, width, _height) {
|
|
|
11286
11335
|
else {
|
|
11287
11336
|
charX = toChar(word.data, charX, row.data, row.isOverflow);
|
|
11288
11337
|
}
|
|
11289
|
-
if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
|
|
11338
|
+
if (addWordWidth && (!row.paraEnd || textAlign === 'both') && (index !== wordsLength - 1)) {
|
|
11290
11339
|
charX += addWordWidth;
|
|
11291
11340
|
row.width += addWordWidth;
|
|
11292
11341
|
}
|
|
@@ -11671,7 +11720,7 @@ class Stroker extends UI {
|
|
|
11671
11720
|
}
|
|
11672
11721
|
__decorate([
|
|
11673
11722
|
targetAttr(onTarget$1)
|
|
11674
|
-
], Stroker.prototype, "target",
|
|
11723
|
+
], Stroker.prototype, "target", void 0);
|
|
11675
11724
|
function onTarget$1(stroker) {
|
|
11676
11725
|
const value = stroker.target;
|
|
11677
11726
|
stroker.list = value ? (value instanceof Array ? value : [value]) : [];
|
|
@@ -11950,7 +11999,7 @@ const { within } = MathHelper;
|
|
|
11950
11999
|
const EditDataHelper = {
|
|
11951
12000
|
getScaleData(element, startBounds, direction, totalMove, lockRatio, around, flipable, scaleMode) {
|
|
11952
12001
|
let align, origin = {}, scaleX = 1, scaleY = 1;
|
|
11953
|
-
const { boxBounds, widthRange, heightRange } = element;
|
|
12002
|
+
const { boxBounds, widthRange, heightRange, dragBounds } = element;
|
|
11954
12003
|
const { width, height } = startBounds;
|
|
11955
12004
|
if (around) {
|
|
11956
12005
|
totalMove.x *= 2;
|
|
@@ -12038,6 +12087,17 @@ const EditDataHelper = {
|
|
|
12038
12087
|
if (scaleY < 0)
|
|
12039
12088
|
scaleY = 1 / boxBounds.height / worldTransform.scaleY;
|
|
12040
12089
|
}
|
|
12090
|
+
toPoint(around || align, boxBounds, origin, true);
|
|
12091
|
+
if (dragBounds) {
|
|
12092
|
+
const allowBounds = dragBounds === 'parent' ? element.parent.boxBounds : dragBounds;
|
|
12093
|
+
const localBounds = new Bounds(element.__localBoxBounds);
|
|
12094
|
+
localBounds.scaleOf(element.getLocalPointByInner(origin), scaleX, scaleY);
|
|
12095
|
+
if (!BoundsHelper.includes(allowBounds, localBounds)) {
|
|
12096
|
+
const realBounds = localBounds.getIntersect(allowBounds);
|
|
12097
|
+
scaleX *= realBounds.width / localBounds.width;
|
|
12098
|
+
scaleY *= realBounds.height / localBounds.height;
|
|
12099
|
+
}
|
|
12100
|
+
}
|
|
12041
12101
|
if (widthRange) {
|
|
12042
12102
|
const nowWidth = boxBounds.width * element.scaleX;
|
|
12043
12103
|
scaleX = within(nowWidth * scaleX, widthRange) / nowWidth;
|
|
@@ -12046,7 +12106,6 @@ const EditDataHelper = {
|
|
|
12046
12106
|
const nowHeight = boxBounds.height * element.scaleY;
|
|
12047
12107
|
scaleY = within(nowHeight * scaleY, heightRange) / nowHeight;
|
|
12048
12108
|
}
|
|
12049
|
-
toPoint(around || align, boxBounds, origin, true);
|
|
12050
12109
|
return { origin, scaleX, scaleY, direction, lockRatio, around };
|
|
12051
12110
|
},
|
|
12052
12111
|
getRotateData(bounds, direction, current, last, around) {
|
|
@@ -12950,9 +13009,9 @@ class Editor extends Group {
|
|
|
12950
13009
|
this.skewOf(origin, skewX, skewY);
|
|
12951
13010
|
}
|
|
12952
13011
|
move(x, y = 0) {
|
|
13012
|
+
const { element } = this;
|
|
12953
13013
|
if (!this.checkTransform('moveable'))
|
|
12954
13014
|
return;
|
|
12955
|
-
const { element } = this;
|
|
12956
13015
|
const world = element.getWorldPointByLocal(typeof x === 'object' ? Object.assign({}, x) : { x, y }, null, true);
|
|
12957
13016
|
if (this.multiple)
|
|
12958
13017
|
element.safeChange(() => element.move(x, y));
|
|
@@ -13160,10 +13219,10 @@ class Editor extends Group {
|
|
|
13160
13219
|
}
|
|
13161
13220
|
__decorate([
|
|
13162
13221
|
targetAttr(onHover)
|
|
13163
|
-
], Editor.prototype, "hoverTarget",
|
|
13222
|
+
], Editor.prototype, "hoverTarget", void 0);
|
|
13164
13223
|
__decorate([
|
|
13165
13224
|
targetAttr(onTarget)
|
|
13166
|
-
], Editor.prototype, "target",
|
|
13225
|
+
], Editor.prototype, "target", void 0);
|
|
13167
13226
|
|
|
13168
13227
|
class InnerEditor {
|
|
13169
13228
|
static registerInnerEditor() {
|
|
@@ -14017,7 +14076,8 @@ function getFixBounds(bounds, scaleBounds) {
|
|
|
14017
14076
|
}
|
|
14018
14077
|
|
|
14019
14078
|
Plugin.add('view');
|
|
14020
|
-
Leafer.prototype.zoom = function (zoomType, padding, fixed) {
|
|
14079
|
+
Leafer.prototype.zoom = function (zoomType, padding, fixed, transition) {
|
|
14080
|
+
this.killAnimate();
|
|
14021
14081
|
const { zoomLayer } = this;
|
|
14022
14082
|
const limitBounds = this.canvas.bounds.clone().shrink(padding !== undefined ? padding : 30), bounds = new Bounds();
|
|
14023
14083
|
const center = { x: limitBounds.x + limitBounds.width / 2, y: limitBounds.y + limitBounds.height / 2 };
|
|
@@ -14048,10 +14108,12 @@ Leafer.prototype.zoom = function (zoomType, padding, fixed) {
|
|
|
14048
14108
|
changeScale = zoomType / scaleX;
|
|
14049
14109
|
}
|
|
14050
14110
|
if (changeScale) {
|
|
14051
|
-
|
|
14052
|
-
|
|
14111
|
+
changeScale = this.getValidScale(changeScale);
|
|
14112
|
+
zoomLayer.scaleOfWorld(center, changeScale, changeScale, false, transition);
|
|
14053
14113
|
}
|
|
14054
14114
|
else if (typeof zoomType === 'object') {
|
|
14115
|
+
const { x, y, scaleX, scaleY } = zoomLayer;
|
|
14116
|
+
const data = { x, y, scaleX, scaleY };
|
|
14055
14117
|
const isArray = zoomType instanceof Array;
|
|
14056
14118
|
if (isArray || zoomType.tag) {
|
|
14057
14119
|
const list = isArray ? zoomType : [zoomType];
|
|
@@ -14061,21 +14123,25 @@ Leafer.prototype.zoom = function (zoomType, padding, fixed) {
|
|
|
14061
14123
|
const innerBounds = getFixBounds(zoomType, limitBounds);
|
|
14062
14124
|
bounds.set(zoomLayer.getWorldBounds(innerBounds));
|
|
14063
14125
|
}
|
|
14064
|
-
const {
|
|
14065
|
-
let moveX = limitBounds.x - x, moveY = limitBounds.y - y;
|
|
14126
|
+
const { width, height } = bounds;
|
|
14127
|
+
let moveX = limitBounds.x - bounds.x, moveY = limitBounds.y - bounds.y;
|
|
14066
14128
|
if (fixed) {
|
|
14067
14129
|
moveX += Math.max((limitBounds.width - width) / 2, 0);
|
|
14068
14130
|
moveY += Math.max((limitBounds.height - height) / 2, 0);
|
|
14069
14131
|
}
|
|
14070
14132
|
else {
|
|
14071
|
-
|
|
14072
|
-
moveX += (limitBounds.width - width *
|
|
14073
|
-
moveY += (limitBounds.height - height *
|
|
14074
|
-
|
|
14075
|
-
bounds.scaleOf(bounds,
|
|
14076
|
-
|
|
14077
|
-
|
|
14078
|
-
|
|
14133
|
+
changeScale = this.getValidScale(Math.min(limitBounds.width / width, limitBounds.height / height));
|
|
14134
|
+
moveX += (limitBounds.width - width * changeScale) / 2;
|
|
14135
|
+
moveY += (limitBounds.height - height * changeScale) / 2;
|
|
14136
|
+
PointHelper.scaleOf(data, bounds, changeScale);
|
|
14137
|
+
bounds.scaleOf(bounds, changeScale);
|
|
14138
|
+
data.scaleX *= changeScale;
|
|
14139
|
+
data.scaleY *= changeScale;
|
|
14140
|
+
}
|
|
14141
|
+
PointHelper.move(data, moveX, moveY);
|
|
14142
|
+
bounds.move(moveX, moveY);
|
|
14143
|
+
zoomLayer.set(data, transition);
|
|
14144
|
+
return bounds;
|
|
14079
14145
|
}
|
|
14080
14146
|
return zoomLayer.worldBoxBounds;
|
|
14081
14147
|
};
|
|
@@ -14203,10 +14269,10 @@ let Arrow = class Arrow extends Line {
|
|
|
14203
14269
|
};
|
|
14204
14270
|
__decorate([
|
|
14205
14271
|
dataProcessor(ArrowData)
|
|
14206
|
-
], Arrow.prototype, "__",
|
|
14272
|
+
], Arrow.prototype, "__", void 0);
|
|
14207
14273
|
__decorate([
|
|
14208
14274
|
strokeType('angle')
|
|
14209
|
-
], Arrow.prototype, "endArrow",
|
|
14275
|
+
], Arrow.prototype, "endArrow", void 0);
|
|
14210
14276
|
Arrow = __decorate([
|
|
14211
14277
|
registerUI()
|
|
14212
14278
|
], Arrow);
|
|
@@ -14645,7 +14711,7 @@ const ExportModule = {
|
|
|
14645
14711
|
const { leafer } = leaf;
|
|
14646
14712
|
if (leafer) {
|
|
14647
14713
|
checkLazy(leaf);
|
|
14648
|
-
leafer.waitViewCompleted(() => __awaiter(this,
|
|
14714
|
+
leafer.waitViewCompleted(() => __awaiter(this, void 0, void 0, function* () {
|
|
14649
14715
|
let renderBounds, trimBounds, scaleX = 1, scaleY = 1;
|
|
14650
14716
|
const { worldTransform, isLeafer, isFrame } = leaf;
|
|
14651
14717
|
const { slice, trim, padding, onCanvas } = options;
|
|
@@ -14747,7 +14813,7 @@ function addTask(task) {
|
|
|
14747
14813
|
if (!tasker)
|
|
14748
14814
|
tasker = new TaskProcessor();
|
|
14749
14815
|
return new Promise((resolve) => {
|
|
14750
|
-
tasker.add(() => __awaiter(this,
|
|
14816
|
+
tasker.add(() => __awaiter(this, void 0, void 0, function* () { return yield task(resolve); }), { parallel: false });
|
|
14751
14817
|
});
|
|
14752
14818
|
}
|
|
14753
14819
|
function checkLazy(leaf) {
|
|
@@ -15052,14 +15118,15 @@ let HTMLText = class HTMLText extends Image {
|
|
|
15052
15118
|
};
|
|
15053
15119
|
__decorate([
|
|
15054
15120
|
dataProcessor(HTMLTextData)
|
|
15055
|
-
], HTMLText.prototype, "__",
|
|
15121
|
+
], HTMLText.prototype, "__", void 0);
|
|
15056
15122
|
__decorate([
|
|
15057
15123
|
boundsType('')
|
|
15058
|
-
], HTMLText.prototype, "text",
|
|
15124
|
+
], HTMLText.prototype, "text", void 0);
|
|
15059
15125
|
HTMLText = __decorate([
|
|
15060
15126
|
registerUI()
|
|
15061
15127
|
], HTMLText);
|
|
15062
15128
|
|
|
15063
15129
|
Plugin.add('html');
|
|
15064
15130
|
|
|
15065
|
-
export { AlignHelper, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Finder, Frame, FrameData, Group, GroupData, HTMLText, HTMLTextData, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, LeaferTypeCreator, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, RotateEvent, Run, ScrollBar, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TextEditor, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|
|
15131
|
+
export { AlignHelper, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Frame, FrameData, Group, GroupData, HTMLText, HTMLTextData, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, LeaferTypeCreator, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, RotateEvent, Run, ScrollBar, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TextEditor, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|
|
15132
|
+
//# sourceMappingURL=worker.module.js.map
|