@leafer-ui/miniapp 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/miniapp.cjs +18 -14
- package/dist/miniapp.cjs.map +1 -0
- package/dist/miniapp.esm.js +19 -15
- package/dist/miniapp.esm.js.map +1 -0
- package/dist/miniapp.esm.min.js +2 -1
- package/dist/miniapp.esm.min.js.map +1 -0
- package/dist/miniapp.min.cjs +2 -1
- package/dist/miniapp.min.cjs.map +1 -0
- package/dist/miniapp.module.js +380 -330
- package/dist/miniapp.module.js.map +1 -0
- package/dist/miniapp.module.min.js +2 -1
- package/dist/miniapp.module.min.js.map +1 -0
- package/package.json +16 -16
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$f = 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$f.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$e = 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$e.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$e.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$d = 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$d.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$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$c = 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$c.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$b = 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$b.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$8, addPoint, setPoint, addBounds, toBounds: toBounds$2 } = TwoPointBoundsHelper;
|
|
3154
|
-
const debug$
|
|
3152
|
+
const debug$a = 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$a.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$9 = 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$9.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$8 = 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$8.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.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize);
|
|
4249
|
+
zoomOfWorld(t, origin, scaleX, scaleY, resize, transition) {
|
|
4250
|
+
L.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$7(matrix$1, o);
|
|
4215
4260
|
scaleOfOuter$2(matrix$1, origin, scaleX, scaleY);
|
|
4216
4261
|
if (t.origin || t.around) {
|
|
4217
|
-
L.setTransform(t, matrix$1, resize);
|
|
4262
|
+
L.setTransform(t, matrix$1, resize, transition);
|
|
4218
4263
|
}
|
|
4219
4264
|
else {
|
|
4220
|
-
|
|
4221
|
-
|
|
4265
|
+
const x = t.x + matrix$1.e - o.e, y = t.y + matrix$1.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.rotateOfLocal(t, getTempLocal(t, origin), angle);
|
|
4272
|
+
rotateOfWorld(t, origin, angle, transition) {
|
|
4273
|
+
L.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$7(matrix$1, o);
|
|
4229
4278
|
rotateOfOuter$2(matrix$1, origin, angle);
|
|
4230
|
-
if (t.origin || t.around)
|
|
4231
|
-
L.setTransform(t, matrix$1);
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
moveByMatrix(t, matrix$1);
|
|
4235
|
-
t.rotation = MathHelper.formatRotation(t.rotation + angle);
|
|
4236
|
-
}
|
|
4279
|
+
if (t.origin || t.around)
|
|
4280
|
+
L.setTransform(t, matrix$1, false, transition);
|
|
4281
|
+
else
|
|
4282
|
+
t.set({ x: t.x + matrix$1.e - o.e, y: t.y + matrix$1.f - o.f, rotation: MathHelper.formatRotation(t.rotation + angle) }, transition);
|
|
4237
4283
|
},
|
|
4238
|
-
skewOfWorld(t, origin, skewX, skewY, resize) {
|
|
4239
|
-
L.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize);
|
|
4284
|
+
skewOfWorld(t, origin, skewX, skewY, resize, transition) {
|
|
4285
|
+
L.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$7(matrix$1, t.__localMatrix);
|
|
4243
4289
|
skewOfOuter(matrix$1, origin, skewX, skewY);
|
|
4244
|
-
L.setTransform(t, matrix$1, resize);
|
|
4290
|
+
L.setTransform(t, matrix$1, resize, transition);
|
|
4245
4291
|
},
|
|
4246
|
-
transformWorld(t, transform, resize) {
|
|
4292
|
+
transformWorld(t, transform, resize, transition) {
|
|
4247
4293
|
copy$7(matrix$1, t.worldTransform);
|
|
4248
4294
|
multiplyParent$2(matrix$1, transform);
|
|
4249
4295
|
if (t.parent)
|
|
4250
4296
|
divideParent(matrix$1, t.parent.worldTransform);
|
|
4251
|
-
L.setTransform(t, matrix$1, resize);
|
|
4297
|
+
L.setTransform(t, matrix$1, resize, transition);
|
|
4252
4298
|
},
|
|
4253
|
-
transform(t, transform, resize) {
|
|
4299
|
+
transform(t, transform, resize, transition) {
|
|
4254
4300
|
copy$7(matrix$1, t.localTransform);
|
|
4255
4301
|
multiplyParent$2(matrix$1, transform);
|
|
4256
|
-
L.setTransform(t, matrix$1, resize);
|
|
4302
|
+
L.setTransform(t, matrix$1, resize, transition);
|
|
4257
4303
|
},
|
|
4258
|
-
setTransform(t, transform, resize) {
|
|
4304
|
+
setTransform(t, transform, resize, transition) {
|
|
4259
4305
|
const data = t.__, originPoint = data.origin && L.getInnerOrigin(t, data.origin);
|
|
4260
4306
|
const layout = getLayout(transform, originPoint, data.around && L.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 = LeafHelper;
|
|
4309
4355
|
const { updateAllMatrix: updateAllMatrix$3, updateMatrix: updateMatrix$2, updateAllWorldOpacity: updateAllWorldOpacity$1, updateAllChange: updateAllChange$1 } = L;
|
|
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 false; }
|
|
@@ -6494,7 +6535,7 @@ class Layouter {
|
|
|
6494
6535
|
}
|
|
6495
6536
|
partLayout() {
|
|
6496
6537
|
var _a;
|
|
6497
|
-
if (!((_a = this.__updatedList) === null || _a ===
|
|
6538
|
+
if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
|
|
6498
6539
|
return;
|
|
6499
6540
|
const t = Run.start('PartLayout');
|
|
6500
6541
|
const { target, __updatedList: updateList } = this;
|
|
@@ -6959,9 +7000,10 @@ class Selector {
|
|
|
6959
7000
|
this.finder = Creator.finder && Creator.finder();
|
|
6960
7001
|
}
|
|
6961
7002
|
getByPoint(hitPoint, hitRadius, options) {
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
7003
|
+
const { target, picker } = this;
|
|
7004
|
+
if (Platform.backgrounder)
|
|
7005
|
+
target && target.updateLayout();
|
|
7006
|
+
return picker.getByPoint(hitPoint, hitRadius, options);
|
|
6965
7007
|
}
|
|
6966
7008
|
getBy(condition, branch, one, options) {
|
|
6967
7009
|
return this.finder ? this.finder.getBy(condition, branch, one, options) : Plugin.need('find');
|
|
@@ -7019,9 +7061,7 @@ const TextConvert = {};
|
|
|
7019
7061
|
const ColorConvert = {};
|
|
7020
7062
|
const UnitConvert = {
|
|
7021
7063
|
number(value, percentRefer) {
|
|
7022
|
-
|
|
7023
|
-
return value.type === 'percent' ? value.value * percentRefer : value.value;
|
|
7024
|
-
return value;
|
|
7064
|
+
return typeof value === 'object' ? (value.type === 'percent' ? value.value * percentRefer : value.value) : value;
|
|
7025
7065
|
}
|
|
7026
7066
|
};
|
|
7027
7067
|
const PathArrow = {};
|
|
@@ -7029,16 +7069,15 @@ const Paint = {};
|
|
|
7029
7069
|
const PaintImage = {};
|
|
7030
7070
|
const PaintGradient = {};
|
|
7031
7071
|
const Effect = {};
|
|
7072
|
+
const Filter = {
|
|
7073
|
+
apply() { Plugin.need('filter'); }
|
|
7074
|
+
};
|
|
7032
7075
|
const Export = {};
|
|
7033
7076
|
const State = {
|
|
7034
|
-
setStyleName(
|
|
7035
|
-
set(
|
|
7036
|
-
};
|
|
7037
|
-
const Transition = {
|
|
7038
|
-
list: {},
|
|
7039
|
-
register(attrName, fn) { Transition.list[attrName] = fn; },
|
|
7040
|
-
get(attrName) { return Transition.list[attrName]; }
|
|
7077
|
+
setStyleName() { return Plugin.need('state'); },
|
|
7078
|
+
set() { return Plugin.need('state'); }
|
|
7041
7079
|
};
|
|
7080
|
+
const Transition = {};
|
|
7042
7081
|
|
|
7043
7082
|
const { parse, objectToCanvasData } = PathConvert;
|
|
7044
7083
|
const emptyPaint = {};
|
|
@@ -7145,24 +7184,13 @@ class UIData extends LeafData {
|
|
|
7145
7184
|
}
|
|
7146
7185
|
}
|
|
7147
7186
|
setShadow(value) {
|
|
7148
|
-
this
|
|
7149
|
-
if (value instanceof Array) {
|
|
7150
|
-
if (value.some((item) => item.visible === false))
|
|
7151
|
-
value = value.filter((item) => item.visible !== false);
|
|
7152
|
-
this._shadow = value.length ? value : null;
|
|
7153
|
-
}
|
|
7154
|
-
else
|
|
7155
|
-
this._shadow = value && value.visible !== false ? [value] : null;
|
|
7187
|
+
setArray(this, 'shadow', value);
|
|
7156
7188
|
}
|
|
7157
7189
|
setInnerShadow(value) {
|
|
7158
|
-
this
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
this._innerShadow = value.length ? value : null;
|
|
7163
|
-
}
|
|
7164
|
-
else
|
|
7165
|
-
this._innerShadow = value && value.visible !== false ? [value] : null;
|
|
7190
|
+
setArray(this, 'innerShadow', value);
|
|
7191
|
+
}
|
|
7192
|
+
setFilter(value) {
|
|
7193
|
+
setArray(this, 'filter', value);
|
|
7166
7194
|
}
|
|
7167
7195
|
__computePaint() {
|
|
7168
7196
|
const { fill, stroke } = this.__input;
|
|
@@ -7173,6 +7201,17 @@ class UIData extends LeafData {
|
|
|
7173
7201
|
this.__needComputePaint = false;
|
|
7174
7202
|
}
|
|
7175
7203
|
}
|
|
7204
|
+
function setArray(data, key, value) {
|
|
7205
|
+
data.__setInput(key, value);
|
|
7206
|
+
if (value instanceof Array) {
|
|
7207
|
+
if (value.some((item) => item.visible === false))
|
|
7208
|
+
value = value.filter((item) => item.visible !== false);
|
|
7209
|
+
value.length || (value = null);
|
|
7210
|
+
}
|
|
7211
|
+
else
|
|
7212
|
+
value = value && value.visible !== false ? [value] : null;
|
|
7213
|
+
data['_' + key] = value;
|
|
7214
|
+
}
|
|
7176
7215
|
|
|
7177
7216
|
class GroupData extends UIData {
|
|
7178
7217
|
}
|
|
@@ -7295,11 +7334,13 @@ const UIBounds = {
|
|
|
7295
7334
|
},
|
|
7296
7335
|
__updateRenderSpread() {
|
|
7297
7336
|
let width = 0;
|
|
7298
|
-
const { shadow, innerShadow, blur, backgroundBlur } = this.__;
|
|
7337
|
+
const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
|
|
7299
7338
|
if (shadow)
|
|
7300
7339
|
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));
|
|
7301
7340
|
if (blur)
|
|
7302
7341
|
width = Math.max(width, blur);
|
|
7342
|
+
if (filter)
|
|
7343
|
+
width += Filter.getSpread(filter);
|
|
7303
7344
|
let shapeWidth = width = Math.ceil(width);
|
|
7304
7345
|
if (innerShadow)
|
|
7305
7346
|
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));
|
|
@@ -7314,8 +7355,8 @@ const UIRender = {
|
|
|
7314
7355
|
__updateChange() {
|
|
7315
7356
|
const data = this.__;
|
|
7316
7357
|
if (data.__useEffect) {
|
|
7317
|
-
const { shadow, innerShadow, blur, backgroundBlur } = this.__;
|
|
7318
|
-
data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur);
|
|
7358
|
+
const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
|
|
7359
|
+
data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur || filter);
|
|
7319
7360
|
}
|
|
7320
7361
|
data.__checkSingle();
|
|
7321
7362
|
const complex = data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect;
|
|
@@ -7329,7 +7370,7 @@ const UIRender = {
|
|
|
7329
7370
|
__drawFast(canvas, options) {
|
|
7330
7371
|
drawFast(this, canvas, options);
|
|
7331
7372
|
},
|
|
7332
|
-
__draw(canvas, options) {
|
|
7373
|
+
__draw(canvas, options, originCanvas) {
|
|
7333
7374
|
const data = this.__;
|
|
7334
7375
|
if (data.__complex) {
|
|
7335
7376
|
if (data.__needComputePaint)
|
|
@@ -7339,7 +7380,7 @@ const UIRender = {
|
|
|
7339
7380
|
if (data.__useEffect) {
|
|
7340
7381
|
const shape = Paint.shape(this, canvas, options);
|
|
7341
7382
|
this.__nowWorld = this.__getNowWorld(options);
|
|
7342
|
-
const { shadow, innerShadow } = data;
|
|
7383
|
+
const { shadow, innerShadow, filter } = data;
|
|
7343
7384
|
if (shadow)
|
|
7344
7385
|
Effect.shadow(this, canvas, shape);
|
|
7345
7386
|
if (fill)
|
|
@@ -7350,6 +7391,8 @@ const UIRender = {
|
|
|
7350
7391
|
Effect.innerShadow(this, canvas, shape);
|
|
7351
7392
|
if (stroke)
|
|
7352
7393
|
data.__isStrokes ? Paint.strokes(stroke, this, canvas) : Paint.stroke(stroke, this, canvas);
|
|
7394
|
+
if (filter)
|
|
7395
|
+
Filter.apply(filter, this, this.__nowWorld, canvas, originCanvas, shape);
|
|
7353
7396
|
if (shape.worldCanvas)
|
|
7354
7397
|
shape.worldCanvas.recycle();
|
|
7355
7398
|
shape.canvas.recycle();
|
|
@@ -7569,199 +7612,202 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7569
7612
|
};
|
|
7570
7613
|
__decorate([
|
|
7571
7614
|
dataProcessor(UIData)
|
|
7572
|
-
], UI.prototype, "__",
|
|
7615
|
+
], UI.prototype, "__", void 0);
|
|
7573
7616
|
__decorate([
|
|
7574
7617
|
zoomLayerType()
|
|
7575
|
-
], UI.prototype, "zoomLayer",
|
|
7618
|
+
], UI.prototype, "zoomLayer", void 0);
|
|
7576
7619
|
__decorate([
|
|
7577
7620
|
dataType('')
|
|
7578
|
-
], UI.prototype, "id",
|
|
7621
|
+
], UI.prototype, "id", void 0);
|
|
7579
7622
|
__decorate([
|
|
7580
7623
|
dataType('')
|
|
7581
|
-
], UI.prototype, "name",
|
|
7624
|
+
], UI.prototype, "name", void 0);
|
|
7582
7625
|
__decorate([
|
|
7583
7626
|
dataType('')
|
|
7584
|
-
], UI.prototype, "className",
|
|
7627
|
+
], UI.prototype, "className", void 0);
|
|
7585
7628
|
__decorate([
|
|
7586
7629
|
surfaceType('pass-through')
|
|
7587
|
-
], UI.prototype, "blendMode",
|
|
7630
|
+
], UI.prototype, "blendMode", void 0);
|
|
7588
7631
|
__decorate([
|
|
7589
7632
|
opacityType(1)
|
|
7590
|
-
], UI.prototype, "opacity",
|
|
7633
|
+
], UI.prototype, "opacity", void 0);
|
|
7591
7634
|
__decorate([
|
|
7592
7635
|
visibleType(true)
|
|
7593
|
-
], UI.prototype, "visible",
|
|
7636
|
+
], UI.prototype, "visible", void 0);
|
|
7594
7637
|
__decorate([
|
|
7595
7638
|
surfaceType(false)
|
|
7596
|
-
], UI.prototype, "locked",
|
|
7639
|
+
], UI.prototype, "locked", void 0);
|
|
7597
7640
|
__decorate([
|
|
7598
7641
|
sortType(0)
|
|
7599
|
-
], UI.prototype, "zIndex",
|
|
7642
|
+
], UI.prototype, "zIndex", void 0);
|
|
7600
7643
|
__decorate([
|
|
7601
7644
|
maskType(false)
|
|
7602
|
-
], UI.prototype, "mask",
|
|
7645
|
+
], UI.prototype, "mask", void 0);
|
|
7603
7646
|
__decorate([
|
|
7604
7647
|
eraserType(false)
|
|
7605
|
-
], UI.prototype, "eraser",
|
|
7648
|
+
], UI.prototype, "eraser", void 0);
|
|
7606
7649
|
__decorate([
|
|
7607
7650
|
positionType(0, true)
|
|
7608
|
-
], UI.prototype, "x",
|
|
7651
|
+
], UI.prototype, "x", void 0);
|
|
7609
7652
|
__decorate([
|
|
7610
7653
|
positionType(0, true)
|
|
7611
|
-
], UI.prototype, "y",
|
|
7654
|
+
], UI.prototype, "y", void 0);
|
|
7612
7655
|
__decorate([
|
|
7613
7656
|
boundsType(100, true)
|
|
7614
|
-
], UI.prototype, "width",
|
|
7657
|
+
], UI.prototype, "width", void 0);
|
|
7615
7658
|
__decorate([
|
|
7616
7659
|
boundsType(100, true)
|
|
7617
|
-
], UI.prototype, "height",
|
|
7660
|
+
], UI.prototype, "height", void 0);
|
|
7618
7661
|
__decorate([
|
|
7619
7662
|
scaleType(1, true)
|
|
7620
|
-
], UI.prototype, "scaleX",
|
|
7663
|
+
], UI.prototype, "scaleX", void 0);
|
|
7621
7664
|
__decorate([
|
|
7622
7665
|
scaleType(1, true)
|
|
7623
|
-
], UI.prototype, "scaleY",
|
|
7666
|
+
], UI.prototype, "scaleY", void 0);
|
|
7624
7667
|
__decorate([
|
|
7625
7668
|
rotationType(0, true)
|
|
7626
|
-
], UI.prototype, "rotation",
|
|
7669
|
+
], UI.prototype, "rotation", void 0);
|
|
7627
7670
|
__decorate([
|
|
7628
7671
|
rotationType(0, true)
|
|
7629
|
-
], UI.prototype, "skewX",
|
|
7672
|
+
], UI.prototype, "skewX", void 0);
|
|
7630
7673
|
__decorate([
|
|
7631
7674
|
rotationType(0, true)
|
|
7632
|
-
], UI.prototype, "skewY",
|
|
7675
|
+
], UI.prototype, "skewY", void 0);
|
|
7633
7676
|
__decorate([
|
|
7634
7677
|
positionType(0, true)
|
|
7635
|
-
], UI.prototype, "offsetX",
|
|
7678
|
+
], UI.prototype, "offsetX", void 0);
|
|
7636
7679
|
__decorate([
|
|
7637
7680
|
positionType(0, true)
|
|
7638
|
-
], UI.prototype, "offsetY",
|
|
7681
|
+
], UI.prototype, "offsetY", void 0);
|
|
7639
7682
|
__decorate([
|
|
7640
7683
|
positionType(0, true)
|
|
7641
|
-
], UI.prototype, "scrollX",
|
|
7684
|
+
], UI.prototype, "scrollX", void 0);
|
|
7642
7685
|
__decorate([
|
|
7643
7686
|
positionType(0, true)
|
|
7644
|
-
], UI.prototype, "scrollY",
|
|
7687
|
+
], UI.prototype, "scrollY", void 0);
|
|
7645
7688
|
__decorate([
|
|
7646
7689
|
autoLayoutType()
|
|
7647
|
-
], UI.prototype, "origin",
|
|
7690
|
+
], UI.prototype, "origin", void 0);
|
|
7648
7691
|
__decorate([
|
|
7649
7692
|
autoLayoutType()
|
|
7650
|
-
], UI.prototype, "around",
|
|
7693
|
+
], UI.prototype, "around", void 0);
|
|
7651
7694
|
__decorate([
|
|
7652
7695
|
dataType(false)
|
|
7653
|
-
], UI.prototype, "lazy",
|
|
7696
|
+
], UI.prototype, "lazy", void 0);
|
|
7654
7697
|
__decorate([
|
|
7655
7698
|
naturalBoundsType(1)
|
|
7656
|
-
], UI.prototype, "pixelRatio",
|
|
7699
|
+
], UI.prototype, "pixelRatio", void 0);
|
|
7657
7700
|
__decorate([
|
|
7658
7701
|
pathInputType()
|
|
7659
|
-
], UI.prototype, "path",
|
|
7702
|
+
], UI.prototype, "path", void 0);
|
|
7660
7703
|
__decorate([
|
|
7661
7704
|
pathType()
|
|
7662
|
-
], UI.prototype, "windingRule",
|
|
7705
|
+
], UI.prototype, "windingRule", void 0);
|
|
7663
7706
|
__decorate([
|
|
7664
7707
|
pathType(true)
|
|
7665
|
-
], UI.prototype, "closed",
|
|
7708
|
+
], UI.prototype, "closed", void 0);
|
|
7666
7709
|
__decorate([
|
|
7667
7710
|
boundsType(0)
|
|
7668
|
-
], UI.prototype, "padding",
|
|
7711
|
+
], UI.prototype, "padding", void 0);
|
|
7669
7712
|
__decorate([
|
|
7670
7713
|
boundsType(false)
|
|
7671
|
-
], UI.prototype, "lockRatio",
|
|
7714
|
+
], UI.prototype, "lockRatio", void 0);
|
|
7672
7715
|
__decorate([
|
|
7673
7716
|
boundsType()
|
|
7674
|
-
], UI.prototype, "widthRange",
|
|
7717
|
+
], UI.prototype, "widthRange", void 0);
|
|
7675
7718
|
__decorate([
|
|
7676
7719
|
boundsType()
|
|
7677
|
-
], UI.prototype, "heightRange",
|
|
7720
|
+
], UI.prototype, "heightRange", void 0);
|
|
7678
7721
|
__decorate([
|
|
7679
7722
|
dataType(false)
|
|
7680
|
-
], UI.prototype, "draggable",
|
|
7723
|
+
], UI.prototype, "draggable", void 0);
|
|
7681
7724
|
__decorate([
|
|
7682
7725
|
dataType()
|
|
7683
|
-
], UI.prototype, "dragBounds",
|
|
7726
|
+
], UI.prototype, "dragBounds", void 0);
|
|
7684
7727
|
__decorate([
|
|
7685
7728
|
dataType(false)
|
|
7686
|
-
], UI.prototype, "editable",
|
|
7729
|
+
], UI.prototype, "editable", void 0);
|
|
7687
7730
|
__decorate([
|
|
7688
7731
|
hitType(true)
|
|
7689
|
-
], UI.prototype, "hittable",
|
|
7732
|
+
], UI.prototype, "hittable", void 0);
|
|
7690
7733
|
__decorate([
|
|
7691
7734
|
hitType('path')
|
|
7692
|
-
], UI.prototype, "hitFill",
|
|
7735
|
+
], UI.prototype, "hitFill", void 0);
|
|
7693
7736
|
__decorate([
|
|
7694
7737
|
strokeType('path')
|
|
7695
|
-
], UI.prototype, "hitStroke",
|
|
7738
|
+
], UI.prototype, "hitStroke", void 0);
|
|
7696
7739
|
__decorate([
|
|
7697
7740
|
hitType(false)
|
|
7698
|
-
], UI.prototype, "hitBox",
|
|
7741
|
+
], UI.prototype, "hitBox", void 0);
|
|
7699
7742
|
__decorate([
|
|
7700
7743
|
hitType(true)
|
|
7701
|
-
], UI.prototype, "hitChildren",
|
|
7744
|
+
], UI.prototype, "hitChildren", void 0);
|
|
7702
7745
|
__decorate([
|
|
7703
7746
|
hitType(true)
|
|
7704
|
-
], UI.prototype, "hitSelf",
|
|
7747
|
+
], UI.prototype, "hitSelf", void 0);
|
|
7705
7748
|
__decorate([
|
|
7706
7749
|
hitType()
|
|
7707
|
-
], UI.prototype, "hitRadius",
|
|
7750
|
+
], UI.prototype, "hitRadius", void 0);
|
|
7708
7751
|
__decorate([
|
|
7709
7752
|
cursorType('')
|
|
7710
|
-
], UI.prototype, "cursor",
|
|
7753
|
+
], UI.prototype, "cursor", void 0);
|
|
7711
7754
|
__decorate([
|
|
7712
7755
|
surfaceType()
|
|
7713
|
-
], UI.prototype, "fill",
|
|
7756
|
+
], UI.prototype, "fill", void 0);
|
|
7714
7757
|
__decorate([
|
|
7715
7758
|
strokeType()
|
|
7716
|
-
], UI.prototype, "stroke",
|
|
7759
|
+
], UI.prototype, "stroke", void 0);
|
|
7717
7760
|
__decorate([
|
|
7718
7761
|
strokeType('inside')
|
|
7719
|
-
], UI.prototype, "strokeAlign",
|
|
7762
|
+
], UI.prototype, "strokeAlign", void 0);
|
|
7720
7763
|
__decorate([
|
|
7721
7764
|
strokeType(1)
|
|
7722
|
-
], UI.prototype, "strokeWidth",
|
|
7765
|
+
], UI.prototype, "strokeWidth", void 0);
|
|
7723
7766
|
__decorate([
|
|
7724
7767
|
strokeType(false)
|
|
7725
|
-
], UI.prototype, "strokeWidthFixed",
|
|
7768
|
+
], UI.prototype, "strokeWidthFixed", void 0);
|
|
7726
7769
|
__decorate([
|
|
7727
7770
|
strokeType('none')
|
|
7728
|
-
], UI.prototype, "strokeCap",
|
|
7771
|
+
], UI.prototype, "strokeCap", void 0);
|
|
7729
7772
|
__decorate([
|
|
7730
7773
|
strokeType('miter')
|
|
7731
|
-
], UI.prototype, "strokeJoin",
|
|
7774
|
+
], UI.prototype, "strokeJoin", void 0);
|
|
7732
7775
|
__decorate([
|
|
7733
7776
|
strokeType()
|
|
7734
|
-
], UI.prototype, "dashPattern",
|
|
7777
|
+
], UI.prototype, "dashPattern", void 0);
|
|
7735
7778
|
__decorate([
|
|
7736
7779
|
strokeType()
|
|
7737
|
-
], UI.prototype, "dashOffset",
|
|
7780
|
+
], UI.prototype, "dashOffset", void 0);
|
|
7738
7781
|
__decorate([
|
|
7739
7782
|
strokeType(10)
|
|
7740
|
-
], UI.prototype, "miterLimit",
|
|
7783
|
+
], UI.prototype, "miterLimit", void 0);
|
|
7741
7784
|
__decorate([
|
|
7742
7785
|
pathType(0)
|
|
7743
|
-
], UI.prototype, "cornerRadius",
|
|
7786
|
+
], UI.prototype, "cornerRadius", void 0);
|
|
7744
7787
|
__decorate([
|
|
7745
7788
|
pathType()
|
|
7746
|
-
], UI.prototype, "cornerSmoothing",
|
|
7789
|
+
], UI.prototype, "cornerSmoothing", void 0);
|
|
7747
7790
|
__decorate([
|
|
7748
7791
|
effectType()
|
|
7749
|
-
], UI.prototype, "shadow",
|
|
7792
|
+
], UI.prototype, "shadow", void 0);
|
|
7750
7793
|
__decorate([
|
|
7751
7794
|
effectType()
|
|
7752
|
-
], UI.prototype, "innerShadow",
|
|
7795
|
+
], UI.prototype, "innerShadow", void 0);
|
|
7753
7796
|
__decorate([
|
|
7754
7797
|
effectType()
|
|
7755
|
-
], UI.prototype, "blur",
|
|
7798
|
+
], UI.prototype, "blur", void 0);
|
|
7756
7799
|
__decorate([
|
|
7757
7800
|
effectType()
|
|
7758
|
-
], UI.prototype, "backgroundBlur",
|
|
7801
|
+
], UI.prototype, "backgroundBlur", void 0);
|
|
7759
7802
|
__decorate([
|
|
7760
7803
|
effectType()
|
|
7761
|
-
], UI.prototype, "grayscale",
|
|
7804
|
+
], UI.prototype, "grayscale", void 0);
|
|
7805
|
+
__decorate([
|
|
7806
|
+
effectType()
|
|
7807
|
+
], UI.prototype, "filter", void 0);
|
|
7762
7808
|
__decorate([
|
|
7763
7809
|
dataType({})
|
|
7764
|
-
], UI.prototype, "data",
|
|
7810
|
+
], UI.prototype, "data", void 0);
|
|
7765
7811
|
__decorate([
|
|
7766
7812
|
rewrite(Leaf.prototype.reset)
|
|
7767
7813
|
], UI.prototype, "reset", null);
|
|
@@ -7822,7 +7868,7 @@ let Group = class Group extends UI {
|
|
|
7822
7868
|
};
|
|
7823
7869
|
__decorate([
|
|
7824
7870
|
dataProcessor(GroupData)
|
|
7825
|
-
], Group.prototype, "__",
|
|
7871
|
+
], Group.prototype, "__", void 0);
|
|
7826
7872
|
Group = __decorate([
|
|
7827
7873
|
useModule(Branch),
|
|
7828
7874
|
registerUI()
|
|
@@ -7835,7 +7881,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7835
7881
|
get isApp() { return false; }
|
|
7836
7882
|
get app() { return this.parent || this; }
|
|
7837
7883
|
get isLeafer() { return true; }
|
|
7838
|
-
get imageReady() { return this.viewReady &&
|
|
7884
|
+
get imageReady() { return this.viewReady && Resource.isComplete; }
|
|
7839
7885
|
get layoutLocked() { return !this.layouter.running; }
|
|
7840
7886
|
get FPS() { return this.renderer ? this.renderer.FPS : 60; }
|
|
7841
7887
|
get cursorPoint() { return (this.interaction && this.interaction.hoverData) || { x: this.width / 2, y: this.height / 2 }; }
|
|
@@ -8046,13 +8092,13 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8046
8092
|
WaitHelper.run(this.__viewReadyWait);
|
|
8047
8093
|
}
|
|
8048
8094
|
__onLayoutEnd() {
|
|
8049
|
-
const { grow,
|
|
8095
|
+
const { grow, width: fixedWidth, height: fixedHeight } = this.config;
|
|
8050
8096
|
if (grow) {
|
|
8051
8097
|
let { width, height, pixelRatio } = this;
|
|
8052
8098
|
const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
|
|
8053
|
-
if (
|
|
8099
|
+
if (!fixedWidth)
|
|
8054
8100
|
width = Math.max(1, bounds.x + bounds.width);
|
|
8055
|
-
if (
|
|
8101
|
+
if (!fixedHeight)
|
|
8056
8102
|
height = Math.max(1, bounds.y + bounds.height);
|
|
8057
8103
|
this.__doResize({ width, height, pixelRatio });
|
|
8058
8104
|
}
|
|
@@ -8130,7 +8176,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8130
8176
|
list.push(item);
|
|
8131
8177
|
this.requestRender();
|
|
8132
8178
|
}
|
|
8133
|
-
zoom(_zoomType, _padding, _fixedScale) {
|
|
8179
|
+
zoom(_zoomType, _padding, _fixedScale, _transition) {
|
|
8134
8180
|
return Plugin.need('view');
|
|
8135
8181
|
}
|
|
8136
8182
|
getValidMove(moveX, moveY) { return { x: moveX, y: moveY }; }
|
|
@@ -8195,10 +8241,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8195
8241
|
Leafer.list = new LeafList();
|
|
8196
8242
|
__decorate([
|
|
8197
8243
|
dataProcessor(LeaferData)
|
|
8198
|
-
], Leafer.prototype, "__",
|
|
8244
|
+
], Leafer.prototype, "__", void 0);
|
|
8199
8245
|
__decorate([
|
|
8200
8246
|
boundsType()
|
|
8201
|
-
], Leafer.prototype, "pixelRatio",
|
|
8247
|
+
], Leafer.prototype, "pixelRatio", void 0);
|
|
8202
8248
|
Leafer = Leafer_1 = __decorate([
|
|
8203
8249
|
registerUI()
|
|
8204
8250
|
], Leafer);
|
|
@@ -8211,7 +8257,7 @@ let Rect = class Rect extends UI {
|
|
|
8211
8257
|
};
|
|
8212
8258
|
__decorate([
|
|
8213
8259
|
dataProcessor(RectData)
|
|
8214
|
-
], Rect.prototype, "__",
|
|
8260
|
+
], Rect.prototype, "__", void 0);
|
|
8215
8261
|
Rect = __decorate([
|
|
8216
8262
|
useModule(RectRender),
|
|
8217
8263
|
rewriteAble(),
|
|
@@ -8302,13 +8348,13 @@ let Box = class Box extends Group {
|
|
|
8302
8348
|
};
|
|
8303
8349
|
__decorate([
|
|
8304
8350
|
dataProcessor(BoxData)
|
|
8305
|
-
], Box.prototype, "__",
|
|
8351
|
+
], Box.prototype, "__", void 0);
|
|
8306
8352
|
__decorate([
|
|
8307
8353
|
dataType(false)
|
|
8308
|
-
], Box.prototype, "resizeChildren",
|
|
8354
|
+
], Box.prototype, "resizeChildren", void 0);
|
|
8309
8355
|
__decorate([
|
|
8310
8356
|
affectRenderBoundsType('show')
|
|
8311
|
-
], Box.prototype, "overflow",
|
|
8357
|
+
], Box.prototype, "overflow", void 0);
|
|
8312
8358
|
__decorate([
|
|
8313
8359
|
rewrite(rect$1.__updateStrokeSpread)
|
|
8314
8360
|
], Box.prototype, "__updateStrokeSpread", null);
|
|
@@ -8347,13 +8393,13 @@ let Frame = class Frame extends Box {
|
|
|
8347
8393
|
};
|
|
8348
8394
|
__decorate([
|
|
8349
8395
|
dataProcessor(FrameData)
|
|
8350
|
-
], Frame.prototype, "__",
|
|
8396
|
+
], Frame.prototype, "__", void 0);
|
|
8351
8397
|
__decorate([
|
|
8352
8398
|
surfaceType('#FFFFFF')
|
|
8353
|
-
], Frame.prototype, "fill",
|
|
8399
|
+
], Frame.prototype, "fill", void 0);
|
|
8354
8400
|
__decorate([
|
|
8355
8401
|
affectRenderBoundsType('hide')
|
|
8356
|
-
], Frame.prototype, "overflow",
|
|
8402
|
+
], Frame.prototype, "overflow", void 0);
|
|
8357
8403
|
Frame = __decorate([
|
|
8358
8404
|
registerUI()
|
|
8359
8405
|
], Frame);
|
|
@@ -8400,16 +8446,16 @@ let Ellipse = class Ellipse extends UI {
|
|
|
8400
8446
|
};
|
|
8401
8447
|
__decorate([
|
|
8402
8448
|
dataProcessor(EllipseData)
|
|
8403
|
-
], Ellipse.prototype, "__",
|
|
8449
|
+
], Ellipse.prototype, "__", void 0);
|
|
8404
8450
|
__decorate([
|
|
8405
8451
|
pathType(0)
|
|
8406
|
-
], Ellipse.prototype, "innerRadius",
|
|
8452
|
+
], Ellipse.prototype, "innerRadius", void 0);
|
|
8407
8453
|
__decorate([
|
|
8408
8454
|
pathType(0)
|
|
8409
|
-
], Ellipse.prototype, "startAngle",
|
|
8455
|
+
], Ellipse.prototype, "startAngle", void 0);
|
|
8410
8456
|
__decorate([
|
|
8411
8457
|
pathType(0)
|
|
8412
|
-
], Ellipse.prototype, "endAngle",
|
|
8458
|
+
], Ellipse.prototype, "endAngle", void 0);
|
|
8413
8459
|
Ellipse = __decorate([
|
|
8414
8460
|
registerUI()
|
|
8415
8461
|
], Ellipse);
|
|
@@ -8468,22 +8514,22 @@ let Line = class Line extends UI {
|
|
|
8468
8514
|
};
|
|
8469
8515
|
__decorate([
|
|
8470
8516
|
dataProcessor(LineData)
|
|
8471
|
-
], Line.prototype, "__",
|
|
8517
|
+
], Line.prototype, "__", void 0);
|
|
8472
8518
|
__decorate([
|
|
8473
8519
|
affectStrokeBoundsType('center')
|
|
8474
|
-
], Line.prototype, "strokeAlign",
|
|
8520
|
+
], Line.prototype, "strokeAlign", void 0);
|
|
8475
8521
|
__decorate([
|
|
8476
8522
|
boundsType(0)
|
|
8477
|
-
], Line.prototype, "height",
|
|
8523
|
+
], Line.prototype, "height", void 0);
|
|
8478
8524
|
__decorate([
|
|
8479
8525
|
pathType()
|
|
8480
|
-
], Line.prototype, "points",
|
|
8526
|
+
], Line.prototype, "points", void 0);
|
|
8481
8527
|
__decorate([
|
|
8482
8528
|
pathType(0)
|
|
8483
|
-
], Line.prototype, "curve",
|
|
8529
|
+
], Line.prototype, "curve", void 0);
|
|
8484
8530
|
__decorate([
|
|
8485
8531
|
pathType(false)
|
|
8486
|
-
], Line.prototype, "closed",
|
|
8532
|
+
], Line.prototype, "closed", void 0);
|
|
8487
8533
|
Line = __decorate([
|
|
8488
8534
|
registerUI()
|
|
8489
8535
|
], Line);
|
|
@@ -8516,16 +8562,16 @@ let Polygon = class Polygon extends UI {
|
|
|
8516
8562
|
};
|
|
8517
8563
|
__decorate([
|
|
8518
8564
|
dataProcessor(PolygonData)
|
|
8519
|
-
], Polygon.prototype, "__",
|
|
8565
|
+
], Polygon.prototype, "__", void 0);
|
|
8520
8566
|
__decorate([
|
|
8521
8567
|
pathType(3)
|
|
8522
|
-
], Polygon.prototype, "sides",
|
|
8568
|
+
], Polygon.prototype, "sides", void 0);
|
|
8523
8569
|
__decorate([
|
|
8524
8570
|
pathType()
|
|
8525
|
-
], Polygon.prototype, "points",
|
|
8571
|
+
], Polygon.prototype, "points", void 0);
|
|
8526
8572
|
__decorate([
|
|
8527
8573
|
pathType(0)
|
|
8528
|
-
], Polygon.prototype, "curve",
|
|
8574
|
+
], Polygon.prototype, "curve", void 0);
|
|
8529
8575
|
__decorate([
|
|
8530
8576
|
rewrite(line.__updateRenderPath)
|
|
8531
8577
|
], Polygon.prototype, "__updateRenderPath", null);
|
|
@@ -8557,13 +8603,13 @@ let Star = class Star extends UI {
|
|
|
8557
8603
|
};
|
|
8558
8604
|
__decorate([
|
|
8559
8605
|
dataProcessor(StarData)
|
|
8560
|
-
], Star.prototype, "__",
|
|
8606
|
+
], Star.prototype, "__", void 0);
|
|
8561
8607
|
__decorate([
|
|
8562
8608
|
pathType(5)
|
|
8563
|
-
], Star.prototype, "corners",
|
|
8609
|
+
], Star.prototype, "corners", void 0);
|
|
8564
8610
|
__decorate([
|
|
8565
8611
|
pathType(0.382)
|
|
8566
|
-
], Star.prototype, "innerRadius",
|
|
8612
|
+
], Star.prototype, "innerRadius", void 0);
|
|
8567
8613
|
Star = __decorate([
|
|
8568
8614
|
registerUI()
|
|
8569
8615
|
], Star);
|
|
@@ -8585,10 +8631,10 @@ let Image = class Image extends Rect {
|
|
|
8585
8631
|
};
|
|
8586
8632
|
__decorate([
|
|
8587
8633
|
dataProcessor(ImageData)
|
|
8588
|
-
], Image.prototype, "__",
|
|
8634
|
+
], Image.prototype, "__", void 0);
|
|
8589
8635
|
__decorate([
|
|
8590
8636
|
boundsType('')
|
|
8591
|
-
], Image.prototype, "url",
|
|
8637
|
+
], Image.prototype, "url", void 0);
|
|
8592
8638
|
Image = __decorate([
|
|
8593
8639
|
registerUI()
|
|
8594
8640
|
], Image);
|
|
@@ -8651,25 +8697,25 @@ let Canvas = class Canvas extends Rect {
|
|
|
8651
8697
|
};
|
|
8652
8698
|
__decorate([
|
|
8653
8699
|
dataProcessor(CanvasData)
|
|
8654
|
-
], Canvas.prototype, "__",
|
|
8700
|
+
], Canvas.prototype, "__", void 0);
|
|
8655
8701
|
__decorate([
|
|
8656
8702
|
resizeType(100)
|
|
8657
|
-
], Canvas.prototype, "width",
|
|
8703
|
+
], Canvas.prototype, "width", void 0);
|
|
8658
8704
|
__decorate([
|
|
8659
8705
|
resizeType(100)
|
|
8660
|
-
], Canvas.prototype, "height",
|
|
8706
|
+
], Canvas.prototype, "height", void 0);
|
|
8661
8707
|
__decorate([
|
|
8662
8708
|
resizeType(1)
|
|
8663
|
-
], Canvas.prototype, "pixelRatio",
|
|
8709
|
+
], Canvas.prototype, "pixelRatio", void 0);
|
|
8664
8710
|
__decorate([
|
|
8665
8711
|
resizeType(true)
|
|
8666
|
-
], Canvas.prototype, "smooth",
|
|
8712
|
+
], Canvas.prototype, "smooth", void 0);
|
|
8667
8713
|
__decorate([
|
|
8668
8714
|
dataType(false)
|
|
8669
|
-
], Canvas.prototype, "safeResize",
|
|
8715
|
+
], Canvas.prototype, "safeResize", void 0);
|
|
8670
8716
|
__decorate([
|
|
8671
8717
|
resizeType()
|
|
8672
|
-
], Canvas.prototype, "contextSettings",
|
|
8718
|
+
], Canvas.prototype, "contextSettings", void 0);
|
|
8673
8719
|
Canvas = __decorate([
|
|
8674
8720
|
registerUI()
|
|
8675
8721
|
], Canvas);
|
|
@@ -8760,76 +8806,76 @@ let Text = class Text extends UI {
|
|
|
8760
8806
|
};
|
|
8761
8807
|
__decorate([
|
|
8762
8808
|
dataProcessor(TextData)
|
|
8763
|
-
], Text.prototype, "__",
|
|
8809
|
+
], Text.prototype, "__", void 0);
|
|
8764
8810
|
__decorate([
|
|
8765
8811
|
boundsType(0)
|
|
8766
|
-
], Text.prototype, "width",
|
|
8812
|
+
], Text.prototype, "width", void 0);
|
|
8767
8813
|
__decorate([
|
|
8768
8814
|
boundsType(0)
|
|
8769
|
-
], Text.prototype, "height",
|
|
8815
|
+
], Text.prototype, "height", void 0);
|
|
8770
8816
|
__decorate([
|
|
8771
8817
|
dataType(false)
|
|
8772
|
-
], Text.prototype, "resizeFontSize",
|
|
8818
|
+
], Text.prototype, "resizeFontSize", void 0);
|
|
8773
8819
|
__decorate([
|
|
8774
8820
|
surfaceType('#000000')
|
|
8775
|
-
], Text.prototype, "fill",
|
|
8821
|
+
], Text.prototype, "fill", void 0);
|
|
8776
8822
|
__decorate([
|
|
8777
8823
|
affectStrokeBoundsType('outside')
|
|
8778
|
-
], Text.prototype, "strokeAlign",
|
|
8824
|
+
], Text.prototype, "strokeAlign", void 0);
|
|
8779
8825
|
__decorate([
|
|
8780
8826
|
hitType('all')
|
|
8781
|
-
], Text.prototype, "hitFill",
|
|
8827
|
+
], Text.prototype, "hitFill", void 0);
|
|
8782
8828
|
__decorate([
|
|
8783
8829
|
boundsType('')
|
|
8784
|
-
], Text.prototype, "text",
|
|
8830
|
+
], Text.prototype, "text", void 0);
|
|
8785
8831
|
__decorate([
|
|
8786
8832
|
boundsType('caption')
|
|
8787
|
-
], Text.prototype, "fontFamily",
|
|
8833
|
+
], Text.prototype, "fontFamily", void 0);
|
|
8788
8834
|
__decorate([
|
|
8789
8835
|
boundsType(12)
|
|
8790
|
-
], Text.prototype, "fontSize",
|
|
8836
|
+
], Text.prototype, "fontSize", void 0);
|
|
8791
8837
|
__decorate([
|
|
8792
8838
|
boundsType('normal')
|
|
8793
|
-
], Text.prototype, "fontWeight",
|
|
8839
|
+
], Text.prototype, "fontWeight", void 0);
|
|
8794
8840
|
__decorate([
|
|
8795
8841
|
boundsType(false)
|
|
8796
|
-
], Text.prototype, "italic",
|
|
8842
|
+
], Text.prototype, "italic", void 0);
|
|
8797
8843
|
__decorate([
|
|
8798
8844
|
boundsType('none')
|
|
8799
|
-
], Text.prototype, "textCase",
|
|
8845
|
+
], Text.prototype, "textCase", void 0);
|
|
8800
8846
|
__decorate([
|
|
8801
8847
|
boundsType('none')
|
|
8802
|
-
], Text.prototype, "textDecoration",
|
|
8848
|
+
], Text.prototype, "textDecoration", void 0);
|
|
8803
8849
|
__decorate([
|
|
8804
8850
|
boundsType(0)
|
|
8805
|
-
], Text.prototype, "letterSpacing",
|
|
8851
|
+
], Text.prototype, "letterSpacing", void 0);
|
|
8806
8852
|
__decorate([
|
|
8807
8853
|
boundsType({ type: 'percent', value: 1.5 })
|
|
8808
|
-
], Text.prototype, "lineHeight",
|
|
8854
|
+
], Text.prototype, "lineHeight", void 0);
|
|
8809
8855
|
__decorate([
|
|
8810
8856
|
boundsType(0)
|
|
8811
|
-
], Text.prototype, "paraIndent",
|
|
8857
|
+
], Text.prototype, "paraIndent", void 0);
|
|
8812
8858
|
__decorate([
|
|
8813
8859
|
boundsType(0)
|
|
8814
|
-
], Text.prototype, "paraSpacing",
|
|
8860
|
+
], Text.prototype, "paraSpacing", void 0);
|
|
8815
8861
|
__decorate([
|
|
8816
8862
|
boundsType('x')
|
|
8817
|
-
], Text.prototype, "writingMode",
|
|
8863
|
+
], Text.prototype, "writingMode", void 0);
|
|
8818
8864
|
__decorate([
|
|
8819
8865
|
boundsType('left')
|
|
8820
|
-
], Text.prototype, "textAlign",
|
|
8866
|
+
], Text.prototype, "textAlign", void 0);
|
|
8821
8867
|
__decorate([
|
|
8822
8868
|
boundsType('top')
|
|
8823
|
-
], Text.prototype, "verticalAlign",
|
|
8869
|
+
], Text.prototype, "verticalAlign", void 0);
|
|
8824
8870
|
__decorate([
|
|
8825
8871
|
boundsType(true)
|
|
8826
|
-
], Text.prototype, "autoSizeAlign",
|
|
8872
|
+
], Text.prototype, "autoSizeAlign", void 0);
|
|
8827
8873
|
__decorate([
|
|
8828
8874
|
boundsType('normal')
|
|
8829
|
-
], Text.prototype, "textWrap",
|
|
8875
|
+
], Text.prototype, "textWrap", void 0);
|
|
8830
8876
|
__decorate([
|
|
8831
8877
|
boundsType('show')
|
|
8832
|
-
], Text.prototype, "textOverflow",
|
|
8878
|
+
], Text.prototype, "textOverflow", void 0);
|
|
8833
8879
|
Text = __decorate([
|
|
8834
8880
|
registerUI()
|
|
8835
8881
|
], Text);
|
|
@@ -8842,10 +8888,10 @@ let Path = class Path extends UI {
|
|
|
8842
8888
|
};
|
|
8843
8889
|
__decorate([
|
|
8844
8890
|
dataProcessor(PathData)
|
|
8845
|
-
], Path.prototype, "__",
|
|
8891
|
+
], Path.prototype, "__", void 0);
|
|
8846
8892
|
__decorate([
|
|
8847
8893
|
affectStrokeBoundsType('center')
|
|
8848
|
-
], Path.prototype, "strokeAlign",
|
|
8894
|
+
], Path.prototype, "strokeAlign", void 0);
|
|
8849
8895
|
Path = __decorate([
|
|
8850
8896
|
registerUI()
|
|
8851
8897
|
], Path);
|
|
@@ -8884,10 +8930,10 @@ let Pen = class Pen extends Group {
|
|
|
8884
8930
|
};
|
|
8885
8931
|
__decorate([
|
|
8886
8932
|
dataProcessor(PenData)
|
|
8887
|
-
], Pen.prototype, "__",
|
|
8933
|
+
], Pen.prototype, "__", void 0);
|
|
8888
8934
|
__decorate([
|
|
8889
8935
|
penPathType()
|
|
8890
|
-
], Pen.prototype, "path",
|
|
8936
|
+
], Pen.prototype, "path", void 0);
|
|
8891
8937
|
Pen = __decorate([
|
|
8892
8938
|
useModule(PathCreator, ['set', 'path', 'paint']),
|
|
8893
8939
|
registerUI()
|
|
@@ -9123,7 +9169,7 @@ let DragEvent = class DragEvent extends PointerEvent {
|
|
|
9123
9169
|
const { draggable, dragBounds } = leaf, move = leaf.getLocalPoint(total, null, true);
|
|
9124
9170
|
PointHelper.move(move, start.x - leaf.x, start.y - leaf.y);
|
|
9125
9171
|
if (dragBounds)
|
|
9126
|
-
this.getMoveInDragBounds(leaf.
|
|
9172
|
+
this.getMoveInDragBounds(leaf.__localBoxBounds, dragBounds === 'parent' ? leaf.parent.boxBounds : dragBounds, move, true);
|
|
9127
9173
|
if (draggable === 'x')
|
|
9128
9174
|
move.y = 0;
|
|
9129
9175
|
if (draggable === 'y')
|
|
@@ -9654,10 +9700,9 @@ class InteractionBase {
|
|
|
9654
9700
|
}
|
|
9655
9701
|
}
|
|
9656
9702
|
pointerMoveReal(data) {
|
|
9657
|
-
const { dragHover, dragDistance } = this.p;
|
|
9658
9703
|
this.emit(PointerEvent.BEFORE_MOVE, data, this.defaultPath);
|
|
9659
9704
|
if (this.downData) {
|
|
9660
|
-
const canDrag = PointHelper.getDistance(this.downData, data) > dragDistance;
|
|
9705
|
+
const canDrag = PointHelper.getDistance(this.downData, data) > this.p.dragDistance;
|
|
9661
9706
|
if (canDrag) {
|
|
9662
9707
|
if (this.waitTap)
|
|
9663
9708
|
this.pointerWaitCancel();
|
|
@@ -9669,9 +9714,8 @@ class InteractionBase {
|
|
|
9669
9714
|
this.updateHoverData(data);
|
|
9670
9715
|
this.checkPath(data);
|
|
9671
9716
|
this.emit(PointerEvent.MOVE, data);
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
if (this.dragger.dragging) {
|
|
9717
|
+
this.pointerHover(data);
|
|
9718
|
+
if (this.dragging) {
|
|
9675
9719
|
this.dragger.dragOverOrOut(data);
|
|
9676
9720
|
this.dragger.dragEnterOrLeave(data);
|
|
9677
9721
|
}
|
|
@@ -9752,7 +9796,8 @@ class InteractionBase {
|
|
|
9752
9796
|
this.updateCursor();
|
|
9753
9797
|
}
|
|
9754
9798
|
pointerHover(data) {
|
|
9755
|
-
if (this.canHover) {
|
|
9799
|
+
if (this.canHover && !(this.dragging && !this.p.dragHover)) {
|
|
9800
|
+
data.path || (data.path = new LeafList());
|
|
9756
9801
|
this.pointerOverOrOut(data);
|
|
9757
9802
|
this.pointerEnterOrLeave(data);
|
|
9758
9803
|
}
|
|
@@ -9827,7 +9872,9 @@ class InteractionBase {
|
|
|
9827
9872
|
}
|
|
9828
9873
|
findPath(data, options) {
|
|
9829
9874
|
const { hitRadius, through } = this.p;
|
|
9830
|
-
const { bottomList } = this;
|
|
9875
|
+
const { bottomList, target } = this;
|
|
9876
|
+
if (!Platform.backgrounder && !data.origin)
|
|
9877
|
+
target && target.updateLayout();
|
|
9831
9878
|
const find = this.selector.getByPoint(data, hitRadius, Object.assign({ bottomList, name: data.type }, (options || { through })));
|
|
9832
9879
|
if (find.throughPath)
|
|
9833
9880
|
data.throughPath = find.throughPath;
|
|
@@ -10072,9 +10119,9 @@ leaf.__hitWorld = function (point) {
|
|
|
10072
10119
|
}
|
|
10073
10120
|
return this.__hit(inner);
|
|
10074
10121
|
};
|
|
10075
|
-
leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a ===
|
|
10076
|
-
leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a ===
|
|
10077
|
-
leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a ===
|
|
10122
|
+
leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitFill(inner, this.__.windingRule); };
|
|
10123
|
+
leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitStroke(inner, strokeWidth); };
|
|
10124
|
+
leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitPixel(inner, this.__layout.renderBounds, this.__hitCanvas.hitScale); };
|
|
10078
10125
|
leaf.__drawHitPath = function (canvas) { if (canvas)
|
|
10079
10126
|
this.__drawRenderPath(canvas); };
|
|
10080
10127
|
|
|
@@ -10162,8 +10209,8 @@ function getSelector(ui) {
|
|
|
10162
10209
|
return ui.leafer ? ui.leafer.selector : (Platform.selector || (Platform.selector = Creator.selector()));
|
|
10163
10210
|
}
|
|
10164
10211
|
Group.prototype.pick = function (hitPoint, options) {
|
|
10165
|
-
this.leafer || this.updateLayout();
|
|
10166
10212
|
options || (options = emptyData);
|
|
10213
|
+
this.updateLayout();
|
|
10167
10214
|
return getSelector(this).getByPoint(hitPoint, options.hitRadius || 0, Object.assign(Object.assign({}, options), { target: this }));
|
|
10168
10215
|
};
|
|
10169
10216
|
|
|
@@ -10652,7 +10699,7 @@ function getPatternData(paint, box, image) {
|
|
|
10652
10699
|
box = tempBox.set(box).shrink(paint.padding);
|
|
10653
10700
|
if (paint.mode === 'strench')
|
|
10654
10701
|
paint.mode = 'stretch';
|
|
10655
|
-
const { opacity, mode, align, offset, scale, size, rotation, repeat } = paint;
|
|
10702
|
+
const { opacity, mode, align, offset, scale, size, rotation, repeat, filters } = paint;
|
|
10656
10703
|
const sameBox = box.width === width && box.height === height;
|
|
10657
10704
|
const data = { mode };
|
|
10658
10705
|
const swapSize = align !== 'center' && (rotation || 0) % 180 === 90;
|
|
@@ -10715,6 +10762,8 @@ function getPatternData(paint, box, image) {
|
|
|
10715
10762
|
data.height = height;
|
|
10716
10763
|
if (opacity)
|
|
10717
10764
|
data.opacity = opacity;
|
|
10765
|
+
if (filters)
|
|
10766
|
+
data.filters = filters;
|
|
10718
10767
|
if (repeat)
|
|
10719
10768
|
data.repeat = typeof repeat === 'string' ? (repeat === 'x' ? 'repeat-x' : 'repeat-y') : 'repeat';
|
|
10720
10769
|
return data;
|
|
@@ -10817,7 +10866,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
10817
10866
|
scaleX = abs$1(scaleX);
|
|
10818
10867
|
scaleY = abs$1(scaleY);
|
|
10819
10868
|
const { image, data } = paint;
|
|
10820
|
-
let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy,
|
|
10869
|
+
let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, transform, repeat } = data;
|
|
10821
10870
|
if (sx) {
|
|
10822
10871
|
imageMatrix = get$1();
|
|
10823
10872
|
copy$1(imageMatrix, transform);
|
|
@@ -10860,7 +10909,7 @@ function createPattern(ui, paint, pixelRatio) {
|
|
|
10860
10909
|
}
|
|
10861
10910
|
scale(imageMatrix, 1 / scaleX, 1 / scaleY);
|
|
10862
10911
|
}
|
|
10863
|
-
const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, opacity);
|
|
10912
|
+
const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, data.opacity, data.filters);
|
|
10864
10913
|
const pattern = image.getPattern(canvas, repeat || (Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint);
|
|
10865
10914
|
paint.style = pattern;
|
|
10866
10915
|
paint.patternId = id;
|
|
@@ -10904,7 +10953,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
10904
10953
|
canvas.opacity *= data.opacity;
|
|
10905
10954
|
if (data.transform)
|
|
10906
10955
|
canvas.transform(data.transform);
|
|
10907
|
-
canvas.drawImage(paint.image.
|
|
10956
|
+
canvas.drawImage(paint.image.getFull(data.filters), 0, 0, data.width, data.height);
|
|
10908
10957
|
canvas.restore();
|
|
10909
10958
|
return true;
|
|
10910
10959
|
}
|
|
@@ -10914,7 +10963,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
10914
10963
|
}
|
|
10915
10964
|
else {
|
|
10916
10965
|
if (!paint.patternTask) {
|
|
10917
|
-
paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this,
|
|
10966
|
+
paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
|
|
10918
10967
|
paint.patternTask = null;
|
|
10919
10968
|
if (canvas.bounds.hit(ui.__nowWorld))
|
|
10920
10969
|
createPattern(ui, paint, pixelRatio);
|
|
@@ -11504,11 +11553,11 @@ const TextMode = 2;
|
|
|
11504
11553
|
function layoutChar(drawData, style, width, _height) {
|
|
11505
11554
|
const { rows } = drawData;
|
|
11506
11555
|
const { textAlign, paraIndent, letterSpacing } = style;
|
|
11507
|
-
let charX, addWordWidth, indentWidth, mode, wordChar;
|
|
11556
|
+
let charX, addWordWidth, indentWidth, mode, wordChar, wordsLength;
|
|
11508
11557
|
rows.forEach(row => {
|
|
11509
11558
|
if (row.words) {
|
|
11510
|
-
indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
|
|
11511
|
-
addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') &&
|
|
11559
|
+
indentWidth = paraIndent && row.paraStart ? paraIndent : 0, wordsLength = row.words.length;
|
|
11560
|
+
addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && wordsLength > 1) ? (width - row.width - indentWidth) / (wordsLength - 1) : 0;
|
|
11512
11561
|
mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
|
|
11513
11562
|
if (row.isOverflow && !letterSpacing)
|
|
11514
11563
|
row.textMode = true;
|
|
@@ -11520,7 +11569,7 @@ function layoutChar(drawData, style, width, _height) {
|
|
|
11520
11569
|
row.x += indentWidth;
|
|
11521
11570
|
charX = row.x;
|
|
11522
11571
|
row.data = [];
|
|
11523
|
-
row.words.forEach(word => {
|
|
11572
|
+
row.words.forEach((word, index) => {
|
|
11524
11573
|
if (mode === WordMode) {
|
|
11525
11574
|
wordChar = { char: '', x: charX };
|
|
11526
11575
|
charX = toWordChar(word.data, charX, wordChar);
|
|
@@ -11530,7 +11579,7 @@ function layoutChar(drawData, style, width, _height) {
|
|
|
11530
11579
|
else {
|
|
11531
11580
|
charX = toChar(word.data, charX, row.data, row.isOverflow);
|
|
11532
11581
|
}
|
|
11533
|
-
if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
|
|
11582
|
+
if (addWordWidth && (!row.paraEnd || textAlign === 'both') && (index !== wordsLength - 1)) {
|
|
11534
11583
|
charX += addWordWidth;
|
|
11535
11584
|
row.width += addWordWidth;
|
|
11536
11585
|
}
|
|
@@ -11817,4 +11866,5 @@ if (platform === 'ios') {
|
|
|
11817
11866
|
};
|
|
11818
11867
|
}
|
|
11819
11868
|
|
|
11820
|
-
export { AlignHelper, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Frame, FrameData, Group, GroupData, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, 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, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, 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 };
|
|
11869
|
+
export { AlignHelper, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Frame, FrameData, Group, GroupData, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, 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, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, 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 };
|
|
11870
|
+
//# sourceMappingURL=miniapp.module.js.map
|