@leafer-draw/miniapp 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/miniapp.cjs +8 -6
- package/dist/miniapp.cjs.map +1 -1
- package/dist/miniapp.esm.js +9 -7
- package/dist/miniapp.esm.js.map +1 -1
- package/dist/miniapp.esm.min.js +1 -1
- package/dist/miniapp.esm.min.js.map +1 -1
- package/dist/miniapp.min.cjs +1 -1
- package/dist/miniapp.min.cjs.map +1 -1
- package/dist/miniapp.module.js +310 -264
- package/dist/miniapp.module.js.map +1 -1
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +8 -8
package/dist/miniapp.module.js
CHANGED
|
@@ -1374,7 +1374,7 @@ function getNameList(name) {
|
|
|
1374
1374
|
}
|
|
1375
1375
|
const D$4 = Debug;
|
|
1376
1376
|
|
|
1377
|
-
const debug$
|
|
1377
|
+
const debug$e = 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$e.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$d = 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$1[tag])
|
|
1430
|
-
debug$
|
|
1430
|
+
debug$d.repeat(tag);
|
|
1431
1431
|
list$1[tag] = UI;
|
|
1432
1432
|
},
|
|
1433
1433
|
get(tag, data, x, y, width, height) {
|
|
1434
1434
|
if (!list$1[tag])
|
|
1435
|
-
debug$
|
|
1435
|
+
debug$d.error('not register ' + tag);
|
|
1436
1436
|
const ui = new list$1[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$1 } = UICreator;
|
|
1450
1450
|
|
|
1451
|
-
const debug$
|
|
1451
|
+
const debug$c = 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$c.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$4, m, L: L$5, l, H, h, V, v, C: C$4, c, S, s, Q: Q$3, q, T, t, A, a, Z: Z$4, z, N: N$3, D: D$3, X: X$3, G: G$3, F: F$4, O: O$3, P: P$3, U: U$3 } = PathCommandMap;
|
|
2613
2613
|
const { rect: rect$2, 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$b = 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$b.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$2, 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$2(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
|
|
2970
2967
|
}
|
|
2968
|
+
data.push(U$2, 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$2, L: L$3, C: C$2, Q: Q$1, Z: Z$2, N: N$1, D: D$1, X: X$1, G: G$1, F: F$2, O: O$1, P: P$1, U: U$1 } = PathCommandMap;
|
|
3081
|
-
const debug$
|
|
3079
|
+
const debug$a = 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$a.error(`command: ${command} [index:${i}]`, data);
|
|
3145
3143
|
return;
|
|
3146
3144
|
}
|
|
3147
3145
|
}
|
|
@@ -3151,7 +3149,7 @@ const PathDrawer = {
|
|
|
3151
3149
|
const { M: M$1, L: L$2, C: C$1, Q, Z: Z$1, N, D, X, G, F: F$1, O, P, U } = PathCommandMap;
|
|
3152
3150
|
const { toTwoPointBounds, toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc, ellipse: ellipse$1 } = BezierHelper;
|
|
3153
3151
|
const { addPointBounds, copy: copy$7, addPoint, setPoint, addBounds, toBounds: toBounds$2 } = TwoPointBoundsHelper;
|
|
3154
|
-
const debug$
|
|
3152
|
+
const debug$9 = 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$9.error(`command: ${command} [index:${i}]`, data);
|
|
3263
3261
|
return;
|
|
3264
3262
|
}
|
|
3265
3263
|
}
|
|
@@ -3375,7 +3373,7 @@ const FileHelper = {
|
|
|
3375
3373
|
const F = FileHelper;
|
|
3376
3374
|
F.opacityTypes.forEach(type => F.upperCaseTypeMap[type] = type.toUpperCase());
|
|
3377
3375
|
|
|
3378
|
-
const debug$
|
|
3376
|
+
const debug$8 = 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$8.error(error);
|
|
3394
3392
|
}
|
|
3395
3393
|
});
|
|
3396
3394
|
}
|
|
@@ -3623,18 +3621,58 @@ class TaskProcessor {
|
|
|
3623
3621
|
}
|
|
3624
3622
|
}
|
|
3625
3623
|
|
|
3626
|
-
const
|
|
3624
|
+
const debug$7 = 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$7.repeat(key);
|
|
3632
|
+
R.map[key] = value;
|
|
3633
|
+
},
|
|
3634
|
+
get(key) {
|
|
3635
|
+
return R.map[key];
|
|
3636
|
+
},
|
|
3637
|
+
remove(key) {
|
|
3638
|
+
const r = R.map[key];
|
|
3639
|
+
if (r) {
|
|
3640
|
+
if (r.destroy)
|
|
3641
|
+
r.destroy();
|
|
3642
|
+
delete R.map[key];
|
|
3643
|
+
}
|
|
3644
|
+
},
|
|
3645
|
+
loadImage(key, format) {
|
|
3646
|
+
return new Promise((resolve, reject) => {
|
|
3647
|
+
const image = this.setImage(key, key, format);
|
|
3648
|
+
image.load(() => resolve(image), (e) => reject(e));
|
|
3649
|
+
});
|
|
3650
|
+
},
|
|
3651
|
+
setImage(key, value, format) {
|
|
3652
|
+
let config;
|
|
3653
|
+
if (typeof value === 'string')
|
|
3654
|
+
config = { url: value };
|
|
3655
|
+
else if (!value.url)
|
|
3656
|
+
config = { url: key, view: value };
|
|
3657
|
+
if (config)
|
|
3658
|
+
format && (config.format = format), value = Creator.image(config);
|
|
3659
|
+
R.set(key, value);
|
|
3660
|
+
return value;
|
|
3661
|
+
},
|
|
3662
|
+
destroy() {
|
|
3663
|
+
R.map = {};
|
|
3664
|
+
}
|
|
3665
|
+
};
|
|
3666
|
+
const R = Resource;
|
|
3667
|
+
|
|
3668
|
+
const ImageManager = {
|
|
3669
|
+
maxRecycled: 100,
|
|
3628
3670
|
recycledList: [],
|
|
3629
|
-
tasker: new TaskProcessor(),
|
|
3630
3671
|
patternTasker: new TaskProcessor(),
|
|
3631
|
-
get isComplete() { return I.tasker.isComplete; },
|
|
3632
3672
|
get(config) {
|
|
3633
|
-
let image =
|
|
3634
|
-
if (!image)
|
|
3635
|
-
image = Creator.image(config);
|
|
3636
|
-
I.map[config.url] = image;
|
|
3637
|
-
}
|
|
3673
|
+
let image = Resource.get(config.url);
|
|
3674
|
+
if (!image)
|
|
3675
|
+
Resource.set(config.url, image = Creator.image(config));
|
|
3638
3676
|
image.use++;
|
|
3639
3677
|
return image;
|
|
3640
3678
|
},
|
|
@@ -3645,13 +3683,8 @@ const ImageManager = {
|
|
|
3645
3683
|
},
|
|
3646
3684
|
clearRecycled() {
|
|
3647
3685
|
const list = I.recycledList;
|
|
3648
|
-
if (list.length >
|
|
3649
|
-
list.forEach(image =>
|
|
3650
|
-
if (!image.use && image.url) {
|
|
3651
|
-
delete I.map[image.url];
|
|
3652
|
-
image.destroy();
|
|
3653
|
-
}
|
|
3654
|
-
});
|
|
3686
|
+
if (list.length > I.maxRecycled) {
|
|
3687
|
+
list.forEach(image => (!image.use && image.url) && Resource.remove(image.url));
|
|
3655
3688
|
list.length = 0;
|
|
3656
3689
|
}
|
|
3657
3690
|
},
|
|
@@ -3675,7 +3708,6 @@ const ImageManager = {
|
|
|
3675
3708
|
return false;
|
|
3676
3709
|
},
|
|
3677
3710
|
destroy() {
|
|
3678
|
-
I.map = {};
|
|
3679
3711
|
I.recycledList = [];
|
|
3680
3712
|
}
|
|
3681
3713
|
};
|
|
@@ -3689,21 +3721,19 @@ class LeaferImage {
|
|
|
3689
3721
|
this.use = 0;
|
|
3690
3722
|
this.waitComplete = [];
|
|
3691
3723
|
this.innerId = create$1(IMAGE);
|
|
3692
|
-
this.config = config || { url: '' };
|
|
3693
|
-
|
|
3694
|
-
|
|
3724
|
+
this.config = config || (config = { url: '' });
|
|
3725
|
+
if (config.view) {
|
|
3726
|
+
const { view } = config;
|
|
3727
|
+
this.setView(view.config ? view.view : view);
|
|
3728
|
+
}
|
|
3729
|
+
ImageManager.isFormat('svg', config) && (this.isSVG = true);
|
|
3730
|
+
ImageManager.hasOpacityPixel(config) && (this.hasOpacityPixel = true);
|
|
3695
3731
|
}
|
|
3696
3732
|
load(onSuccess, onError) {
|
|
3697
3733
|
if (!this.loading) {
|
|
3698
3734
|
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) => {
|
|
3735
|
+
Resource.tasker.add(() => __awaiter(this, void 0, void 0, function* () {
|
|
3736
|
+
return yield Platform.origin.loadImage(this.url).then(img => this.setView(img)).catch((e) => {
|
|
3707
3737
|
this.error = e;
|
|
3708
3738
|
this.onComplete(false);
|
|
3709
3739
|
});
|
|
@@ -3721,6 +3751,13 @@ class LeaferImage {
|
|
|
3721
3751
|
}
|
|
3722
3752
|
l[index] = l[index + 1] = undefined;
|
|
3723
3753
|
}
|
|
3754
|
+
setView(img) {
|
|
3755
|
+
this.ready = true;
|
|
3756
|
+
this.width = img.naturalWidth || img.width;
|
|
3757
|
+
this.height = img.naturalHeight || img.height;
|
|
3758
|
+
this.view = img;
|
|
3759
|
+
this.onComplete(true);
|
|
3760
|
+
}
|
|
3724
3761
|
onComplete(isSuccess) {
|
|
3725
3762
|
let odd;
|
|
3726
3763
|
this.waitComplete.forEach((item, index) => {
|
|
@@ -3739,6 +3776,9 @@ class LeaferImage {
|
|
|
3739
3776
|
this.waitComplete.length = 0;
|
|
3740
3777
|
this.loading = false;
|
|
3741
3778
|
}
|
|
3779
|
+
getFull(_filters) {
|
|
3780
|
+
return this.view;
|
|
3781
|
+
}
|
|
3742
3782
|
getCanvas(width, height, opacity, _filters) {
|
|
3743
3783
|
width || (width = this.width);
|
|
3744
3784
|
height || (height = this.height);
|
|
@@ -5219,7 +5259,7 @@ const LeafRender = {
|
|
|
5219
5259
|
if (this.__.eraser === 'path')
|
|
5220
5260
|
return this.__renderEraser(canvas, options);
|
|
5221
5261
|
const tempCanvas = canvas.getSameCanvas(true, true);
|
|
5222
|
-
this.__draw(tempCanvas, options);
|
|
5262
|
+
this.__draw(tempCanvas, options, canvas);
|
|
5223
5263
|
if (this.__worldFlipped) {
|
|
5224
5264
|
canvas.copyWorldByReset(tempCanvas, this.__nowWorld, null, this.__.__blendMode, true);
|
|
5225
5265
|
}
|
|
@@ -6012,7 +6052,7 @@ class LeafLevelList {
|
|
|
6012
6052
|
}
|
|
6013
6053
|
}
|
|
6014
6054
|
|
|
6015
|
-
const version = "1.4.
|
|
6055
|
+
const version = "1.4.2";
|
|
6016
6056
|
|
|
6017
6057
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6018
6058
|
get allowBackgroundColor() { return false; }
|
|
@@ -6496,7 +6536,7 @@ class Layouter {
|
|
|
6496
6536
|
}
|
|
6497
6537
|
partLayout() {
|
|
6498
6538
|
var _a;
|
|
6499
|
-
if (!((_a = this.__updatedList) === null || _a ===
|
|
6539
|
+
if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
|
|
6500
6540
|
return;
|
|
6501
6541
|
const t = Run.start('PartLayout');
|
|
6502
6542
|
const { target, __updatedList: updateList } = this;
|
|
@@ -6865,9 +6905,7 @@ const TextConvert = {};
|
|
|
6865
6905
|
const ColorConvert = {};
|
|
6866
6906
|
const UnitConvert = {
|
|
6867
6907
|
number(value, percentRefer) {
|
|
6868
|
-
|
|
6869
|
-
return value.type === 'percent' ? value.value * percentRefer : value.value;
|
|
6870
|
-
return value;
|
|
6908
|
+
return typeof value === 'object' ? (value.type === 'percent' ? value.value * percentRefer : value.value) : value;
|
|
6871
6909
|
}
|
|
6872
6910
|
};
|
|
6873
6911
|
const PathArrow = {};
|
|
@@ -6875,16 +6913,15 @@ const Paint = {};
|
|
|
6875
6913
|
const PaintImage = {};
|
|
6876
6914
|
const PaintGradient = {};
|
|
6877
6915
|
const Effect = {};
|
|
6916
|
+
const Filter = {
|
|
6917
|
+
apply() { Plugin.need('filter'); }
|
|
6918
|
+
};
|
|
6878
6919
|
const Export = {};
|
|
6879
6920
|
const State = {
|
|
6880
|
-
setStyleName(
|
|
6881
|
-
set(
|
|
6882
|
-
};
|
|
6883
|
-
const Transition = {
|
|
6884
|
-
list: {},
|
|
6885
|
-
register(attrName, fn) { Transition.list[attrName] = fn; },
|
|
6886
|
-
get(attrName) { return Transition.list[attrName]; }
|
|
6921
|
+
setStyleName() { return Plugin.need('state'); },
|
|
6922
|
+
set() { return Plugin.need('state'); }
|
|
6887
6923
|
};
|
|
6924
|
+
const Transition = {};
|
|
6888
6925
|
|
|
6889
6926
|
const { parse, objectToCanvasData } = PathConvert;
|
|
6890
6927
|
const emptyPaint = {};
|
|
@@ -6991,24 +7028,13 @@ class UIData extends LeafData {
|
|
|
6991
7028
|
}
|
|
6992
7029
|
}
|
|
6993
7030
|
setShadow(value) {
|
|
6994
|
-
this
|
|
6995
|
-
if (value instanceof Array) {
|
|
6996
|
-
if (value.some((item) => item.visible === false))
|
|
6997
|
-
value = value.filter((item) => item.visible !== false);
|
|
6998
|
-
this._shadow = value.length ? value : null;
|
|
6999
|
-
}
|
|
7000
|
-
else
|
|
7001
|
-
this._shadow = value && value.visible !== false ? [value] : null;
|
|
7031
|
+
setArray(this, 'shadow', value);
|
|
7002
7032
|
}
|
|
7003
7033
|
setInnerShadow(value) {
|
|
7004
|
-
this
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
this._innerShadow = value.length ? value : null;
|
|
7009
|
-
}
|
|
7010
|
-
else
|
|
7011
|
-
this._innerShadow = value && value.visible !== false ? [value] : null;
|
|
7034
|
+
setArray(this, 'innerShadow', value);
|
|
7035
|
+
}
|
|
7036
|
+
setFilter(value) {
|
|
7037
|
+
setArray(this, 'filter', value);
|
|
7012
7038
|
}
|
|
7013
7039
|
__computePaint() {
|
|
7014
7040
|
const { fill, stroke } = this.__input;
|
|
@@ -7019,6 +7045,17 @@ class UIData extends LeafData {
|
|
|
7019
7045
|
this.__needComputePaint = false;
|
|
7020
7046
|
}
|
|
7021
7047
|
}
|
|
7048
|
+
function setArray(data, key, value) {
|
|
7049
|
+
data.__setInput(key, value);
|
|
7050
|
+
if (value instanceof Array) {
|
|
7051
|
+
if (value.some((item) => item.visible === false))
|
|
7052
|
+
value = value.filter((item) => item.visible !== false);
|
|
7053
|
+
value.length || (value = null);
|
|
7054
|
+
}
|
|
7055
|
+
else
|
|
7056
|
+
value = value && value.visible !== false ? [value] : null;
|
|
7057
|
+
data['_' + key] = value;
|
|
7058
|
+
}
|
|
7022
7059
|
|
|
7023
7060
|
class GroupData extends UIData {
|
|
7024
7061
|
}
|
|
@@ -7141,11 +7178,13 @@ const UIBounds = {
|
|
|
7141
7178
|
},
|
|
7142
7179
|
__updateRenderSpread() {
|
|
7143
7180
|
let width = 0;
|
|
7144
|
-
const { shadow, innerShadow, blur, backgroundBlur } = this.__;
|
|
7181
|
+
const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
|
|
7145
7182
|
if (shadow)
|
|
7146
7183
|
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));
|
|
7147
7184
|
if (blur)
|
|
7148
7185
|
width = Math.max(width, blur);
|
|
7186
|
+
if (filter)
|
|
7187
|
+
width += Filter.getSpread(filter);
|
|
7149
7188
|
let shapeWidth = width = Math.ceil(width);
|
|
7150
7189
|
if (innerShadow)
|
|
7151
7190
|
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));
|
|
@@ -7160,8 +7199,8 @@ const UIRender = {
|
|
|
7160
7199
|
__updateChange() {
|
|
7161
7200
|
const data = this.__;
|
|
7162
7201
|
if (data.__useEffect) {
|
|
7163
|
-
const { shadow, innerShadow, blur, backgroundBlur } = this.__;
|
|
7164
|
-
data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur);
|
|
7202
|
+
const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
|
|
7203
|
+
data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur || filter);
|
|
7165
7204
|
}
|
|
7166
7205
|
data.__checkSingle();
|
|
7167
7206
|
const complex = data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect;
|
|
@@ -7175,7 +7214,7 @@ const UIRender = {
|
|
|
7175
7214
|
__drawFast(canvas, options) {
|
|
7176
7215
|
drawFast(this, canvas, options);
|
|
7177
7216
|
},
|
|
7178
|
-
__draw(canvas, options) {
|
|
7217
|
+
__draw(canvas, options, originCanvas) {
|
|
7179
7218
|
const data = this.__;
|
|
7180
7219
|
if (data.__complex) {
|
|
7181
7220
|
if (data.__needComputePaint)
|
|
@@ -7185,7 +7224,7 @@ const UIRender = {
|
|
|
7185
7224
|
if (data.__useEffect) {
|
|
7186
7225
|
const shape = Paint.shape(this, canvas, options);
|
|
7187
7226
|
this.__nowWorld = this.__getNowWorld(options);
|
|
7188
|
-
const { shadow, innerShadow } = data;
|
|
7227
|
+
const { shadow, innerShadow, filter } = data;
|
|
7189
7228
|
if (shadow)
|
|
7190
7229
|
Effect.shadow(this, canvas, shape);
|
|
7191
7230
|
if (fill)
|
|
@@ -7196,6 +7235,8 @@ const UIRender = {
|
|
|
7196
7235
|
Effect.innerShadow(this, canvas, shape);
|
|
7197
7236
|
if (stroke)
|
|
7198
7237
|
data.__isStrokes ? Paint.strokes(stroke, this, canvas) : Paint.stroke(stroke, this, canvas);
|
|
7238
|
+
if (filter)
|
|
7239
|
+
Filter.apply(filter, this, this.__nowWorld, canvas, originCanvas, shape);
|
|
7199
7240
|
if (shape.worldCanvas)
|
|
7200
7241
|
shape.worldCanvas.recycle();
|
|
7201
7242
|
shape.canvas.recycle();
|
|
@@ -7415,199 +7456,202 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7415
7456
|
};
|
|
7416
7457
|
__decorate([
|
|
7417
7458
|
dataProcessor(UIData)
|
|
7418
|
-
], UI.prototype, "__",
|
|
7459
|
+
], UI.prototype, "__", void 0);
|
|
7419
7460
|
__decorate([
|
|
7420
7461
|
zoomLayerType()
|
|
7421
|
-
], UI.prototype, "zoomLayer",
|
|
7462
|
+
], UI.prototype, "zoomLayer", void 0);
|
|
7422
7463
|
__decorate([
|
|
7423
7464
|
dataType('')
|
|
7424
|
-
], UI.prototype, "id",
|
|
7465
|
+
], UI.prototype, "id", void 0);
|
|
7425
7466
|
__decorate([
|
|
7426
7467
|
dataType('')
|
|
7427
|
-
], UI.prototype, "name",
|
|
7468
|
+
], UI.prototype, "name", void 0);
|
|
7428
7469
|
__decorate([
|
|
7429
7470
|
dataType('')
|
|
7430
|
-
], UI.prototype, "className",
|
|
7471
|
+
], UI.prototype, "className", void 0);
|
|
7431
7472
|
__decorate([
|
|
7432
7473
|
surfaceType('pass-through')
|
|
7433
|
-
], UI.prototype, "blendMode",
|
|
7474
|
+
], UI.prototype, "blendMode", void 0);
|
|
7434
7475
|
__decorate([
|
|
7435
7476
|
opacityType(1)
|
|
7436
|
-
], UI.prototype, "opacity",
|
|
7477
|
+
], UI.prototype, "opacity", void 0);
|
|
7437
7478
|
__decorate([
|
|
7438
7479
|
visibleType(true)
|
|
7439
|
-
], UI.prototype, "visible",
|
|
7480
|
+
], UI.prototype, "visible", void 0);
|
|
7440
7481
|
__decorate([
|
|
7441
7482
|
surfaceType(false)
|
|
7442
|
-
], UI.prototype, "locked",
|
|
7483
|
+
], UI.prototype, "locked", void 0);
|
|
7443
7484
|
__decorate([
|
|
7444
7485
|
sortType(0)
|
|
7445
|
-
], UI.prototype, "zIndex",
|
|
7486
|
+
], UI.prototype, "zIndex", void 0);
|
|
7446
7487
|
__decorate([
|
|
7447
7488
|
maskType(false)
|
|
7448
|
-
], UI.prototype, "mask",
|
|
7489
|
+
], UI.prototype, "mask", void 0);
|
|
7449
7490
|
__decorate([
|
|
7450
7491
|
eraserType(false)
|
|
7451
|
-
], UI.prototype, "eraser",
|
|
7492
|
+
], UI.prototype, "eraser", void 0);
|
|
7452
7493
|
__decorate([
|
|
7453
7494
|
positionType(0, true)
|
|
7454
|
-
], UI.prototype, "x",
|
|
7495
|
+
], UI.prototype, "x", void 0);
|
|
7455
7496
|
__decorate([
|
|
7456
7497
|
positionType(0, true)
|
|
7457
|
-
], UI.prototype, "y",
|
|
7498
|
+
], UI.prototype, "y", void 0);
|
|
7458
7499
|
__decorate([
|
|
7459
7500
|
boundsType(100, true)
|
|
7460
|
-
], UI.prototype, "width",
|
|
7501
|
+
], UI.prototype, "width", void 0);
|
|
7461
7502
|
__decorate([
|
|
7462
7503
|
boundsType(100, true)
|
|
7463
|
-
], UI.prototype, "height",
|
|
7504
|
+
], UI.prototype, "height", void 0);
|
|
7464
7505
|
__decorate([
|
|
7465
7506
|
scaleType(1, true)
|
|
7466
|
-
], UI.prototype, "scaleX",
|
|
7507
|
+
], UI.prototype, "scaleX", void 0);
|
|
7467
7508
|
__decorate([
|
|
7468
7509
|
scaleType(1, true)
|
|
7469
|
-
], UI.prototype, "scaleY",
|
|
7510
|
+
], UI.prototype, "scaleY", void 0);
|
|
7470
7511
|
__decorate([
|
|
7471
7512
|
rotationType(0, true)
|
|
7472
|
-
], UI.prototype, "rotation",
|
|
7513
|
+
], UI.prototype, "rotation", void 0);
|
|
7473
7514
|
__decorate([
|
|
7474
7515
|
rotationType(0, true)
|
|
7475
|
-
], UI.prototype, "skewX",
|
|
7516
|
+
], UI.prototype, "skewX", void 0);
|
|
7476
7517
|
__decorate([
|
|
7477
7518
|
rotationType(0, true)
|
|
7478
|
-
], UI.prototype, "skewY",
|
|
7519
|
+
], UI.prototype, "skewY", void 0);
|
|
7479
7520
|
__decorate([
|
|
7480
7521
|
positionType(0, true)
|
|
7481
|
-
], UI.prototype, "offsetX",
|
|
7522
|
+
], UI.prototype, "offsetX", void 0);
|
|
7482
7523
|
__decorate([
|
|
7483
7524
|
positionType(0, true)
|
|
7484
|
-
], UI.prototype, "offsetY",
|
|
7525
|
+
], UI.prototype, "offsetY", void 0);
|
|
7485
7526
|
__decorate([
|
|
7486
7527
|
positionType(0, true)
|
|
7487
|
-
], UI.prototype, "scrollX",
|
|
7528
|
+
], UI.prototype, "scrollX", void 0);
|
|
7488
7529
|
__decorate([
|
|
7489
7530
|
positionType(0, true)
|
|
7490
|
-
], UI.prototype, "scrollY",
|
|
7531
|
+
], UI.prototype, "scrollY", void 0);
|
|
7491
7532
|
__decorate([
|
|
7492
7533
|
autoLayoutType()
|
|
7493
|
-
], UI.prototype, "origin",
|
|
7534
|
+
], UI.prototype, "origin", void 0);
|
|
7494
7535
|
__decorate([
|
|
7495
7536
|
autoLayoutType()
|
|
7496
|
-
], UI.prototype, "around",
|
|
7537
|
+
], UI.prototype, "around", void 0);
|
|
7497
7538
|
__decorate([
|
|
7498
7539
|
dataType(false)
|
|
7499
|
-
], UI.prototype, "lazy",
|
|
7540
|
+
], UI.prototype, "lazy", void 0);
|
|
7500
7541
|
__decorate([
|
|
7501
7542
|
naturalBoundsType(1)
|
|
7502
|
-
], UI.prototype, "pixelRatio",
|
|
7543
|
+
], UI.prototype, "pixelRatio", void 0);
|
|
7503
7544
|
__decorate([
|
|
7504
7545
|
pathInputType()
|
|
7505
|
-
], UI.prototype, "path",
|
|
7546
|
+
], UI.prototype, "path", void 0);
|
|
7506
7547
|
__decorate([
|
|
7507
7548
|
pathType()
|
|
7508
|
-
], UI.prototype, "windingRule",
|
|
7549
|
+
], UI.prototype, "windingRule", void 0);
|
|
7509
7550
|
__decorate([
|
|
7510
7551
|
pathType(true)
|
|
7511
|
-
], UI.prototype, "closed",
|
|
7552
|
+
], UI.prototype, "closed", void 0);
|
|
7512
7553
|
__decorate([
|
|
7513
7554
|
boundsType(0)
|
|
7514
|
-
], UI.prototype, "padding",
|
|
7555
|
+
], UI.prototype, "padding", void 0);
|
|
7515
7556
|
__decorate([
|
|
7516
7557
|
boundsType(false)
|
|
7517
|
-
], UI.prototype, "lockRatio",
|
|
7558
|
+
], UI.prototype, "lockRatio", void 0);
|
|
7518
7559
|
__decorate([
|
|
7519
7560
|
boundsType()
|
|
7520
|
-
], UI.prototype, "widthRange",
|
|
7561
|
+
], UI.prototype, "widthRange", void 0);
|
|
7521
7562
|
__decorate([
|
|
7522
7563
|
boundsType()
|
|
7523
|
-
], UI.prototype, "heightRange",
|
|
7564
|
+
], UI.prototype, "heightRange", void 0);
|
|
7524
7565
|
__decorate([
|
|
7525
7566
|
dataType(false)
|
|
7526
|
-
], UI.prototype, "draggable",
|
|
7567
|
+
], UI.prototype, "draggable", void 0);
|
|
7527
7568
|
__decorate([
|
|
7528
7569
|
dataType()
|
|
7529
|
-
], UI.prototype, "dragBounds",
|
|
7570
|
+
], UI.prototype, "dragBounds", void 0);
|
|
7530
7571
|
__decorate([
|
|
7531
7572
|
dataType(false)
|
|
7532
|
-
], UI.prototype, "editable",
|
|
7573
|
+
], UI.prototype, "editable", void 0);
|
|
7533
7574
|
__decorate([
|
|
7534
7575
|
hitType(true)
|
|
7535
|
-
], UI.prototype, "hittable",
|
|
7576
|
+
], UI.prototype, "hittable", void 0);
|
|
7536
7577
|
__decorate([
|
|
7537
7578
|
hitType('path')
|
|
7538
|
-
], UI.prototype, "hitFill",
|
|
7579
|
+
], UI.prototype, "hitFill", void 0);
|
|
7539
7580
|
__decorate([
|
|
7540
7581
|
strokeType('path')
|
|
7541
|
-
], UI.prototype, "hitStroke",
|
|
7582
|
+
], UI.prototype, "hitStroke", void 0);
|
|
7542
7583
|
__decorate([
|
|
7543
7584
|
hitType(false)
|
|
7544
|
-
], UI.prototype, "hitBox",
|
|
7585
|
+
], UI.prototype, "hitBox", void 0);
|
|
7545
7586
|
__decorate([
|
|
7546
7587
|
hitType(true)
|
|
7547
|
-
], UI.prototype, "hitChildren",
|
|
7588
|
+
], UI.prototype, "hitChildren", void 0);
|
|
7548
7589
|
__decorate([
|
|
7549
7590
|
hitType(true)
|
|
7550
|
-
], UI.prototype, "hitSelf",
|
|
7591
|
+
], UI.prototype, "hitSelf", void 0);
|
|
7551
7592
|
__decorate([
|
|
7552
7593
|
hitType()
|
|
7553
|
-
], UI.prototype, "hitRadius",
|
|
7594
|
+
], UI.prototype, "hitRadius", void 0);
|
|
7554
7595
|
__decorate([
|
|
7555
7596
|
cursorType('')
|
|
7556
|
-
], UI.prototype, "cursor",
|
|
7597
|
+
], UI.prototype, "cursor", void 0);
|
|
7557
7598
|
__decorate([
|
|
7558
7599
|
surfaceType()
|
|
7559
|
-
], UI.prototype, "fill",
|
|
7600
|
+
], UI.prototype, "fill", void 0);
|
|
7560
7601
|
__decorate([
|
|
7561
7602
|
strokeType()
|
|
7562
|
-
], UI.prototype, "stroke",
|
|
7603
|
+
], UI.prototype, "stroke", void 0);
|
|
7563
7604
|
__decorate([
|
|
7564
7605
|
strokeType('inside')
|
|
7565
|
-
], UI.prototype, "strokeAlign",
|
|
7606
|
+
], UI.prototype, "strokeAlign", void 0);
|
|
7566
7607
|
__decorate([
|
|
7567
7608
|
strokeType(1)
|
|
7568
|
-
], UI.prototype, "strokeWidth",
|
|
7609
|
+
], UI.prototype, "strokeWidth", void 0);
|
|
7569
7610
|
__decorate([
|
|
7570
7611
|
strokeType(false)
|
|
7571
|
-
], UI.prototype, "strokeWidthFixed",
|
|
7612
|
+
], UI.prototype, "strokeWidthFixed", void 0);
|
|
7572
7613
|
__decorate([
|
|
7573
7614
|
strokeType('none')
|
|
7574
|
-
], UI.prototype, "strokeCap",
|
|
7615
|
+
], UI.prototype, "strokeCap", void 0);
|
|
7575
7616
|
__decorate([
|
|
7576
7617
|
strokeType('miter')
|
|
7577
|
-
], UI.prototype, "strokeJoin",
|
|
7618
|
+
], UI.prototype, "strokeJoin", void 0);
|
|
7578
7619
|
__decorate([
|
|
7579
7620
|
strokeType()
|
|
7580
|
-
], UI.prototype, "dashPattern",
|
|
7621
|
+
], UI.prototype, "dashPattern", void 0);
|
|
7581
7622
|
__decorate([
|
|
7582
7623
|
strokeType()
|
|
7583
|
-
], UI.prototype, "dashOffset",
|
|
7624
|
+
], UI.prototype, "dashOffset", void 0);
|
|
7584
7625
|
__decorate([
|
|
7585
7626
|
strokeType(10)
|
|
7586
|
-
], UI.prototype, "miterLimit",
|
|
7627
|
+
], UI.prototype, "miterLimit", void 0);
|
|
7587
7628
|
__decorate([
|
|
7588
7629
|
pathType(0)
|
|
7589
|
-
], UI.prototype, "cornerRadius",
|
|
7630
|
+
], UI.prototype, "cornerRadius", void 0);
|
|
7590
7631
|
__decorate([
|
|
7591
7632
|
pathType()
|
|
7592
|
-
], UI.prototype, "cornerSmoothing",
|
|
7633
|
+
], UI.prototype, "cornerSmoothing", void 0);
|
|
7634
|
+
__decorate([
|
|
7635
|
+
effectType()
|
|
7636
|
+
], UI.prototype, "shadow", void 0);
|
|
7593
7637
|
__decorate([
|
|
7594
7638
|
effectType()
|
|
7595
|
-
], UI.prototype, "
|
|
7639
|
+
], UI.prototype, "innerShadow", void 0);
|
|
7596
7640
|
__decorate([
|
|
7597
7641
|
effectType()
|
|
7598
|
-
], UI.prototype, "
|
|
7642
|
+
], UI.prototype, "blur", void 0);
|
|
7599
7643
|
__decorate([
|
|
7600
7644
|
effectType()
|
|
7601
|
-
], UI.prototype, "
|
|
7645
|
+
], UI.prototype, "backgroundBlur", void 0);
|
|
7602
7646
|
__decorate([
|
|
7603
7647
|
effectType()
|
|
7604
|
-
], UI.prototype, "
|
|
7648
|
+
], UI.prototype, "grayscale", void 0);
|
|
7605
7649
|
__decorate([
|
|
7606
7650
|
effectType()
|
|
7607
|
-
], UI.prototype, "
|
|
7651
|
+
], UI.prototype, "filter", void 0);
|
|
7608
7652
|
__decorate([
|
|
7609
7653
|
dataType({})
|
|
7610
|
-
], UI.prototype, "data",
|
|
7654
|
+
], UI.prototype, "data", void 0);
|
|
7611
7655
|
__decorate([
|
|
7612
7656
|
rewrite(Leaf.prototype.reset)
|
|
7613
7657
|
], UI.prototype, "reset", null);
|
|
@@ -7668,7 +7712,7 @@ let Group = class Group extends UI {
|
|
|
7668
7712
|
};
|
|
7669
7713
|
__decorate([
|
|
7670
7714
|
dataProcessor(GroupData)
|
|
7671
|
-
], Group.prototype, "__",
|
|
7715
|
+
], Group.prototype, "__", void 0);
|
|
7672
7716
|
Group = __decorate([
|
|
7673
7717
|
useModule(Branch),
|
|
7674
7718
|
registerUI()
|
|
@@ -7681,7 +7725,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7681
7725
|
get isApp() { return false; }
|
|
7682
7726
|
get app() { return this.parent || this; }
|
|
7683
7727
|
get isLeafer() { return true; }
|
|
7684
|
-
get imageReady() { return this.viewReady &&
|
|
7728
|
+
get imageReady() { return this.viewReady && Resource.isComplete; }
|
|
7685
7729
|
get layoutLocked() { return !this.layouter.running; }
|
|
7686
7730
|
get FPS() { return this.renderer ? this.renderer.FPS : 60; }
|
|
7687
7731
|
get cursorPoint() { return (this.interaction && this.interaction.hoverData) || { x: this.width / 2, y: this.height / 2 }; }
|
|
@@ -7892,13 +7936,13 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7892
7936
|
WaitHelper.run(this.__viewReadyWait);
|
|
7893
7937
|
}
|
|
7894
7938
|
__onLayoutEnd() {
|
|
7895
|
-
const { grow,
|
|
7939
|
+
const { grow, width: fixedWidth, height: fixedHeight } = this.config;
|
|
7896
7940
|
if (grow) {
|
|
7897
7941
|
let { width, height, pixelRatio } = this;
|
|
7898
7942
|
const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
|
|
7899
|
-
if (
|
|
7943
|
+
if (!fixedWidth)
|
|
7900
7944
|
width = Math.max(1, bounds.x + bounds.width);
|
|
7901
|
-
if (
|
|
7945
|
+
if (!fixedHeight)
|
|
7902
7946
|
height = Math.max(1, bounds.y + bounds.height);
|
|
7903
7947
|
this.__doResize({ width, height, pixelRatio });
|
|
7904
7948
|
}
|
|
@@ -7976,7 +8020,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7976
8020
|
list.push(item);
|
|
7977
8021
|
this.requestRender();
|
|
7978
8022
|
}
|
|
7979
|
-
zoom(_zoomType, _padding, _fixedScale) {
|
|
8023
|
+
zoom(_zoomType, _padding, _fixedScale, _transition) {
|
|
7980
8024
|
return Plugin.need('view');
|
|
7981
8025
|
}
|
|
7982
8026
|
getValidMove(moveX, moveY) { return { x: moveX, y: moveY }; }
|
|
@@ -8041,10 +8085,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8041
8085
|
Leafer.list = new LeafList();
|
|
8042
8086
|
__decorate([
|
|
8043
8087
|
dataProcessor(LeaferData)
|
|
8044
|
-
], Leafer.prototype, "__",
|
|
8088
|
+
], Leafer.prototype, "__", void 0);
|
|
8045
8089
|
__decorate([
|
|
8046
8090
|
boundsType()
|
|
8047
|
-
], Leafer.prototype, "pixelRatio",
|
|
8091
|
+
], Leafer.prototype, "pixelRatio", void 0);
|
|
8048
8092
|
Leafer = Leafer_1 = __decorate([
|
|
8049
8093
|
registerUI()
|
|
8050
8094
|
], Leafer);
|
|
@@ -8057,7 +8101,7 @@ let Rect = class Rect extends UI {
|
|
|
8057
8101
|
};
|
|
8058
8102
|
__decorate([
|
|
8059
8103
|
dataProcessor(RectData)
|
|
8060
|
-
], Rect.prototype, "__",
|
|
8104
|
+
], Rect.prototype, "__", void 0);
|
|
8061
8105
|
Rect = __decorate([
|
|
8062
8106
|
useModule(RectRender),
|
|
8063
8107
|
rewriteAble(),
|
|
@@ -8148,13 +8192,13 @@ let Box = class Box extends Group {
|
|
|
8148
8192
|
};
|
|
8149
8193
|
__decorate([
|
|
8150
8194
|
dataProcessor(BoxData)
|
|
8151
|
-
], Box.prototype, "__",
|
|
8195
|
+
], Box.prototype, "__", void 0);
|
|
8152
8196
|
__decorate([
|
|
8153
8197
|
dataType(false)
|
|
8154
|
-
], Box.prototype, "resizeChildren",
|
|
8198
|
+
], Box.prototype, "resizeChildren", void 0);
|
|
8155
8199
|
__decorate([
|
|
8156
8200
|
affectRenderBoundsType('show')
|
|
8157
|
-
], Box.prototype, "overflow",
|
|
8201
|
+
], Box.prototype, "overflow", void 0);
|
|
8158
8202
|
__decorate([
|
|
8159
8203
|
rewrite(rect.__updateStrokeSpread)
|
|
8160
8204
|
], Box.prototype, "__updateStrokeSpread", null);
|
|
@@ -8193,13 +8237,13 @@ let Frame = class Frame extends Box {
|
|
|
8193
8237
|
};
|
|
8194
8238
|
__decorate([
|
|
8195
8239
|
dataProcessor(FrameData)
|
|
8196
|
-
], Frame.prototype, "__",
|
|
8240
|
+
], Frame.prototype, "__", void 0);
|
|
8197
8241
|
__decorate([
|
|
8198
8242
|
surfaceType('#FFFFFF')
|
|
8199
|
-
], Frame.prototype, "fill",
|
|
8243
|
+
], Frame.prototype, "fill", void 0);
|
|
8200
8244
|
__decorate([
|
|
8201
8245
|
affectRenderBoundsType('hide')
|
|
8202
|
-
], Frame.prototype, "overflow",
|
|
8246
|
+
], Frame.prototype, "overflow", void 0);
|
|
8203
8247
|
Frame = __decorate([
|
|
8204
8248
|
registerUI()
|
|
8205
8249
|
], Frame);
|
|
@@ -8246,16 +8290,16 @@ let Ellipse = class Ellipse extends UI {
|
|
|
8246
8290
|
};
|
|
8247
8291
|
__decorate([
|
|
8248
8292
|
dataProcessor(EllipseData)
|
|
8249
|
-
], Ellipse.prototype, "__",
|
|
8293
|
+
], Ellipse.prototype, "__", void 0);
|
|
8250
8294
|
__decorate([
|
|
8251
8295
|
pathType(0)
|
|
8252
|
-
], Ellipse.prototype, "innerRadius",
|
|
8296
|
+
], Ellipse.prototype, "innerRadius", void 0);
|
|
8253
8297
|
__decorate([
|
|
8254
8298
|
pathType(0)
|
|
8255
|
-
], Ellipse.prototype, "startAngle",
|
|
8299
|
+
], Ellipse.prototype, "startAngle", void 0);
|
|
8256
8300
|
__decorate([
|
|
8257
8301
|
pathType(0)
|
|
8258
|
-
], Ellipse.prototype, "endAngle",
|
|
8302
|
+
], Ellipse.prototype, "endAngle", void 0);
|
|
8259
8303
|
Ellipse = __decorate([
|
|
8260
8304
|
registerUI()
|
|
8261
8305
|
], Ellipse);
|
|
@@ -8314,22 +8358,22 @@ let Line = class Line extends UI {
|
|
|
8314
8358
|
};
|
|
8315
8359
|
__decorate([
|
|
8316
8360
|
dataProcessor(LineData)
|
|
8317
|
-
], Line.prototype, "__",
|
|
8361
|
+
], Line.prototype, "__", void 0);
|
|
8318
8362
|
__decorate([
|
|
8319
8363
|
affectStrokeBoundsType('center')
|
|
8320
|
-
], Line.prototype, "strokeAlign",
|
|
8364
|
+
], Line.prototype, "strokeAlign", void 0);
|
|
8321
8365
|
__decorate([
|
|
8322
8366
|
boundsType(0)
|
|
8323
|
-
], Line.prototype, "height",
|
|
8367
|
+
], Line.prototype, "height", void 0);
|
|
8324
8368
|
__decorate([
|
|
8325
8369
|
pathType()
|
|
8326
|
-
], Line.prototype, "points",
|
|
8370
|
+
], Line.prototype, "points", void 0);
|
|
8327
8371
|
__decorate([
|
|
8328
8372
|
pathType(0)
|
|
8329
|
-
], Line.prototype, "curve",
|
|
8373
|
+
], Line.prototype, "curve", void 0);
|
|
8330
8374
|
__decorate([
|
|
8331
8375
|
pathType(false)
|
|
8332
|
-
], Line.prototype, "closed",
|
|
8376
|
+
], Line.prototype, "closed", void 0);
|
|
8333
8377
|
Line = __decorate([
|
|
8334
8378
|
registerUI()
|
|
8335
8379
|
], Line);
|
|
@@ -8362,16 +8406,16 @@ let Polygon = class Polygon extends UI {
|
|
|
8362
8406
|
};
|
|
8363
8407
|
__decorate([
|
|
8364
8408
|
dataProcessor(PolygonData)
|
|
8365
|
-
], Polygon.prototype, "__",
|
|
8409
|
+
], Polygon.prototype, "__", void 0);
|
|
8366
8410
|
__decorate([
|
|
8367
8411
|
pathType(3)
|
|
8368
|
-
], Polygon.prototype, "sides",
|
|
8412
|
+
], Polygon.prototype, "sides", void 0);
|
|
8369
8413
|
__decorate([
|
|
8370
8414
|
pathType()
|
|
8371
|
-
], Polygon.prototype, "points",
|
|
8415
|
+
], Polygon.prototype, "points", void 0);
|
|
8372
8416
|
__decorate([
|
|
8373
8417
|
pathType(0)
|
|
8374
|
-
], Polygon.prototype, "curve",
|
|
8418
|
+
], Polygon.prototype, "curve", void 0);
|
|
8375
8419
|
__decorate([
|
|
8376
8420
|
rewrite(line.__updateRenderPath)
|
|
8377
8421
|
], Polygon.prototype, "__updateRenderPath", null);
|
|
@@ -8403,13 +8447,13 @@ let Star = class Star extends UI {
|
|
|
8403
8447
|
};
|
|
8404
8448
|
__decorate([
|
|
8405
8449
|
dataProcessor(StarData)
|
|
8406
|
-
], Star.prototype, "__",
|
|
8450
|
+
], Star.prototype, "__", void 0);
|
|
8407
8451
|
__decorate([
|
|
8408
8452
|
pathType(5)
|
|
8409
|
-
], Star.prototype, "corners",
|
|
8453
|
+
], Star.prototype, "corners", void 0);
|
|
8410
8454
|
__decorate([
|
|
8411
8455
|
pathType(0.382)
|
|
8412
|
-
], Star.prototype, "innerRadius",
|
|
8456
|
+
], Star.prototype, "innerRadius", void 0);
|
|
8413
8457
|
Star = __decorate([
|
|
8414
8458
|
registerUI()
|
|
8415
8459
|
], Star);
|
|
@@ -8431,10 +8475,10 @@ let Image = class Image extends Rect {
|
|
|
8431
8475
|
};
|
|
8432
8476
|
__decorate([
|
|
8433
8477
|
dataProcessor(ImageData)
|
|
8434
|
-
], Image.prototype, "__",
|
|
8478
|
+
], Image.prototype, "__", void 0);
|
|
8435
8479
|
__decorate([
|
|
8436
8480
|
boundsType('')
|
|
8437
|
-
], Image.prototype, "url",
|
|
8481
|
+
], Image.prototype, "url", void 0);
|
|
8438
8482
|
Image = __decorate([
|
|
8439
8483
|
registerUI()
|
|
8440
8484
|
], Image);
|
|
@@ -8497,25 +8541,25 @@ let Canvas = class Canvas extends Rect {
|
|
|
8497
8541
|
};
|
|
8498
8542
|
__decorate([
|
|
8499
8543
|
dataProcessor(CanvasData)
|
|
8500
|
-
], Canvas.prototype, "__",
|
|
8544
|
+
], Canvas.prototype, "__", void 0);
|
|
8501
8545
|
__decorate([
|
|
8502
8546
|
resizeType(100)
|
|
8503
|
-
], Canvas.prototype, "width",
|
|
8547
|
+
], Canvas.prototype, "width", void 0);
|
|
8504
8548
|
__decorate([
|
|
8505
8549
|
resizeType(100)
|
|
8506
|
-
], Canvas.prototype, "height",
|
|
8550
|
+
], Canvas.prototype, "height", void 0);
|
|
8507
8551
|
__decorate([
|
|
8508
8552
|
resizeType(1)
|
|
8509
|
-
], Canvas.prototype, "pixelRatio",
|
|
8553
|
+
], Canvas.prototype, "pixelRatio", void 0);
|
|
8510
8554
|
__decorate([
|
|
8511
8555
|
resizeType(true)
|
|
8512
|
-
], Canvas.prototype, "smooth",
|
|
8556
|
+
], Canvas.prototype, "smooth", void 0);
|
|
8513
8557
|
__decorate([
|
|
8514
8558
|
dataType(false)
|
|
8515
|
-
], Canvas.prototype, "safeResize",
|
|
8559
|
+
], Canvas.prototype, "safeResize", void 0);
|
|
8516
8560
|
__decorate([
|
|
8517
8561
|
resizeType()
|
|
8518
|
-
], Canvas.prototype, "contextSettings",
|
|
8562
|
+
], Canvas.prototype, "contextSettings", void 0);
|
|
8519
8563
|
Canvas = __decorate([
|
|
8520
8564
|
registerUI()
|
|
8521
8565
|
], Canvas);
|
|
@@ -8606,76 +8650,76 @@ let Text = class Text extends UI {
|
|
|
8606
8650
|
};
|
|
8607
8651
|
__decorate([
|
|
8608
8652
|
dataProcessor(TextData)
|
|
8609
|
-
], Text.prototype, "__",
|
|
8653
|
+
], Text.prototype, "__", void 0);
|
|
8610
8654
|
__decorate([
|
|
8611
8655
|
boundsType(0)
|
|
8612
|
-
], Text.prototype, "width",
|
|
8656
|
+
], Text.prototype, "width", void 0);
|
|
8613
8657
|
__decorate([
|
|
8614
8658
|
boundsType(0)
|
|
8615
|
-
], Text.prototype, "height",
|
|
8659
|
+
], Text.prototype, "height", void 0);
|
|
8616
8660
|
__decorate([
|
|
8617
8661
|
dataType(false)
|
|
8618
|
-
], Text.prototype, "resizeFontSize",
|
|
8662
|
+
], Text.prototype, "resizeFontSize", void 0);
|
|
8619
8663
|
__decorate([
|
|
8620
8664
|
surfaceType('#000000')
|
|
8621
|
-
], Text.prototype, "fill",
|
|
8665
|
+
], Text.prototype, "fill", void 0);
|
|
8622
8666
|
__decorate([
|
|
8623
8667
|
affectStrokeBoundsType('outside')
|
|
8624
|
-
], Text.prototype, "strokeAlign",
|
|
8668
|
+
], Text.prototype, "strokeAlign", void 0);
|
|
8625
8669
|
__decorate([
|
|
8626
8670
|
hitType('all')
|
|
8627
|
-
], Text.prototype, "hitFill",
|
|
8671
|
+
], Text.prototype, "hitFill", void 0);
|
|
8628
8672
|
__decorate([
|
|
8629
8673
|
boundsType('')
|
|
8630
|
-
], Text.prototype, "text",
|
|
8674
|
+
], Text.prototype, "text", void 0);
|
|
8631
8675
|
__decorate([
|
|
8632
8676
|
boundsType('caption')
|
|
8633
|
-
], Text.prototype, "fontFamily",
|
|
8677
|
+
], Text.prototype, "fontFamily", void 0);
|
|
8634
8678
|
__decorate([
|
|
8635
8679
|
boundsType(12)
|
|
8636
|
-
], Text.prototype, "fontSize",
|
|
8680
|
+
], Text.prototype, "fontSize", void 0);
|
|
8637
8681
|
__decorate([
|
|
8638
8682
|
boundsType('normal')
|
|
8639
|
-
], Text.prototype, "fontWeight",
|
|
8683
|
+
], Text.prototype, "fontWeight", void 0);
|
|
8640
8684
|
__decorate([
|
|
8641
8685
|
boundsType(false)
|
|
8642
|
-
], Text.prototype, "italic",
|
|
8686
|
+
], Text.prototype, "italic", void 0);
|
|
8643
8687
|
__decorate([
|
|
8644
8688
|
boundsType('none')
|
|
8645
|
-
], Text.prototype, "textCase",
|
|
8689
|
+
], Text.prototype, "textCase", void 0);
|
|
8646
8690
|
__decorate([
|
|
8647
8691
|
boundsType('none')
|
|
8648
|
-
], Text.prototype, "textDecoration",
|
|
8692
|
+
], Text.prototype, "textDecoration", void 0);
|
|
8649
8693
|
__decorate([
|
|
8650
8694
|
boundsType(0)
|
|
8651
|
-
], Text.prototype, "letterSpacing",
|
|
8695
|
+
], Text.prototype, "letterSpacing", void 0);
|
|
8652
8696
|
__decorate([
|
|
8653
8697
|
boundsType({ type: 'percent', value: 1.5 })
|
|
8654
|
-
], Text.prototype, "lineHeight",
|
|
8698
|
+
], Text.prototype, "lineHeight", void 0);
|
|
8655
8699
|
__decorate([
|
|
8656
8700
|
boundsType(0)
|
|
8657
|
-
], Text.prototype, "paraIndent",
|
|
8701
|
+
], Text.prototype, "paraIndent", void 0);
|
|
8658
8702
|
__decorate([
|
|
8659
8703
|
boundsType(0)
|
|
8660
|
-
], Text.prototype, "paraSpacing",
|
|
8704
|
+
], Text.prototype, "paraSpacing", void 0);
|
|
8661
8705
|
__decorate([
|
|
8662
8706
|
boundsType('x')
|
|
8663
|
-
], Text.prototype, "writingMode",
|
|
8707
|
+
], Text.prototype, "writingMode", void 0);
|
|
8664
8708
|
__decorate([
|
|
8665
8709
|
boundsType('left')
|
|
8666
|
-
], Text.prototype, "textAlign",
|
|
8710
|
+
], Text.prototype, "textAlign", void 0);
|
|
8667
8711
|
__decorate([
|
|
8668
8712
|
boundsType('top')
|
|
8669
|
-
], Text.prototype, "verticalAlign",
|
|
8713
|
+
], Text.prototype, "verticalAlign", void 0);
|
|
8670
8714
|
__decorate([
|
|
8671
8715
|
boundsType(true)
|
|
8672
|
-
], Text.prototype, "autoSizeAlign",
|
|
8716
|
+
], Text.prototype, "autoSizeAlign", void 0);
|
|
8673
8717
|
__decorate([
|
|
8674
8718
|
boundsType('normal')
|
|
8675
|
-
], Text.prototype, "textWrap",
|
|
8719
|
+
], Text.prototype, "textWrap", void 0);
|
|
8676
8720
|
__decorate([
|
|
8677
8721
|
boundsType('show')
|
|
8678
|
-
], Text.prototype, "textOverflow",
|
|
8722
|
+
], Text.prototype, "textOverflow", void 0);
|
|
8679
8723
|
Text = __decorate([
|
|
8680
8724
|
registerUI()
|
|
8681
8725
|
], Text);
|
|
@@ -8688,10 +8732,10 @@ let Path = class Path extends UI {
|
|
|
8688
8732
|
};
|
|
8689
8733
|
__decorate([
|
|
8690
8734
|
dataProcessor(PathData)
|
|
8691
|
-
], Path.prototype, "__",
|
|
8735
|
+
], Path.prototype, "__", void 0);
|
|
8692
8736
|
__decorate([
|
|
8693
8737
|
affectStrokeBoundsType('center')
|
|
8694
|
-
], Path.prototype, "strokeAlign",
|
|
8738
|
+
], Path.prototype, "strokeAlign", void 0);
|
|
8695
8739
|
Path = __decorate([
|
|
8696
8740
|
registerUI()
|
|
8697
8741
|
], Path);
|
|
@@ -8730,10 +8774,10 @@ let Pen = class Pen extends Group {
|
|
|
8730
8774
|
};
|
|
8731
8775
|
__decorate([
|
|
8732
8776
|
dataProcessor(PenData)
|
|
8733
|
-
], Pen.prototype, "__",
|
|
8777
|
+
], Pen.prototype, "__", void 0);
|
|
8734
8778
|
__decorate([
|
|
8735
8779
|
penPathType()
|
|
8736
|
-
], Pen.prototype, "path",
|
|
8780
|
+
], Pen.prototype, "path", void 0);
|
|
8737
8781
|
Pen = __decorate([
|
|
8738
8782
|
useModule(PathCreator, ['set', 'path', 'paint']),
|
|
8739
8783
|
registerUI()
|
|
@@ -9105,7 +9149,7 @@ function getPatternData(paint, box, image) {
|
|
|
9105
9149
|
box = tempBox.set(box).shrink(paint.padding);
|
|
9106
9150
|
if (paint.mode === 'strench')
|
|
9107
9151
|
paint.mode = 'stretch';
|
|
9108
|
-
const { opacity, mode, align, offset, scale, size, rotation, repeat } = paint;
|
|
9152
|
+
const { opacity, mode, align, offset, scale, size, rotation, repeat, filters } = paint;
|
|
9109
9153
|
const sameBox = box.width === width && box.height === height;
|
|
9110
9154
|
const data = { mode };
|
|
9111
9155
|
const swapSize = align !== 'center' && (rotation || 0) % 180 === 90;
|
|
@@ -9168,6 +9212,8 @@ function getPatternData(paint, box, image) {
|
|
|
9168
9212
|
data.height = height;
|
|
9169
9213
|
if (opacity)
|
|
9170
9214
|
data.opacity = opacity;
|
|
9215
|
+
if (filters)
|
|
9216
|
+
data.filters = filters;
|
|
9171
9217
|
if (repeat)
|
|
9172
9218
|
data.repeat = typeof repeat === 'string' ? (repeat === 'x' ? 'repeat-x' : 'repeat-y') : 'repeat';
|
|
9173
9219
|
return data;
|
|
@@ -9270,7 +9316,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
9270
9316
|
scaleX = abs$1(scaleX);
|
|
9271
9317
|
scaleY = abs$1(scaleY);
|
|
9272
9318
|
const { image, data } = paint;
|
|
9273
|
-
let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy,
|
|
9319
|
+
let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, transform, repeat } = data;
|
|
9274
9320
|
if (sx) {
|
|
9275
9321
|
imageMatrix = get$1();
|
|
9276
9322
|
copy$1(imageMatrix, transform);
|
|
@@ -9313,7 +9359,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
9313
9359
|
}
|
|
9314
9360
|
scale(imageMatrix, 1 / scaleX, 1 / scaleY);
|
|
9315
9361
|
}
|
|
9316
|
-
const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, opacity);
|
|
9362
|
+
const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, data.opacity, data.filters);
|
|
9317
9363
|
const pattern = image.getPattern(canvas, repeat || (Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint);
|
|
9318
9364
|
paint.style = pattern;
|
|
9319
9365
|
paint.patternId = id;
|
|
@@ -9357,7 +9403,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
9357
9403
|
canvas.opacity *= data.opacity;
|
|
9358
9404
|
if (data.transform)
|
|
9359
9405
|
canvas.transform(data.transform);
|
|
9360
|
-
canvas.drawImage(paint.image.
|
|
9406
|
+
canvas.drawImage(paint.image.getFull(data.filters), 0, 0, data.width, data.height);
|
|
9361
9407
|
canvas.restore();
|
|
9362
9408
|
return true;
|
|
9363
9409
|
}
|
|
@@ -9367,7 +9413,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
9367
9413
|
}
|
|
9368
9414
|
else {
|
|
9369
9415
|
if (!paint.patternTask) {
|
|
9370
|
-
paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this,
|
|
9416
|
+
paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
|
|
9371
9417
|
paint.patternTask = null;
|
|
9372
9418
|
if (canvas.bounds.hit(ui.__nowWorld))
|
|
9373
9419
|
createPattern(ui, paint, pixelRatio);
|
|
@@ -10238,5 +10284,5 @@ try {
|
|
|
10238
10284
|
}
|
|
10239
10285
|
catch (_a) { }
|
|
10240
10286
|
|
|
10241
|
-
export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, DataHelper, Debug, Direction4, Direction9, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Frame, FrameData, Group, GroupData, Image, ImageData, ImageEvent, ImageManager, IncrementId, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MyImage, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Platform, Plugin, Point, PointHelper, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Run, Star, StarData, State, StringNumberMap, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, affectRenderBoundsType, affectStrokeBoundsType, 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, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|
|
10287
|
+
export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, DataHelper, Debug, Direction4, Direction9, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Frame, FrameData, Group, GroupData, Image, ImageData, ImageEvent, ImageManager, IncrementId, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MyImage, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Platform, Plugin, Point, PointHelper, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Run, Star, StarData, State, StringNumberMap, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, affectRenderBoundsType, affectStrokeBoundsType, 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, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|
|
10242
10288
|
//# sourceMappingURL=miniapp.module.js.map
|