@leafer-draw/worker 1.3.3 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1374,7 +1374,7 @@ function getNameList(name) {
1374
1374
  }
1375
1375
  const D$4 = Debug;
1376
1376
 
1377
- const debug$d = Debug.get('RunTime');
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$d.log(name, duration, 'ms');
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$c = Debug.get('UICreator');
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$c.repeat(tag);
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$c.error('not register ' + tag);
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$b = Debug.get('EventCreator');
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$b.repeat(name), nameList[name] = Event;
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 === undefined ? undefined : value.constructor) === Object && ((_a = t[key]) === null || _a === undefined ? undefined : _a.constructor) === Object)
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 === undefined ? undefined : _b.constructor) === Object)
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 undefined; }
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 undefined; }
1834
- createLinearGradient(_x0, _y0, _x1, _y1) { return undefined; }
1835
- createPattern(_image, _repetition) { return undefined; }
1836
- createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return undefined; }
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 undefined; }
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", undefined);
1846
+ ], Canvas$1.prototype, "smooth", void 0);
1847
1847
  __decorate([
1848
1848
  contextAttr('imageSmoothingQuality')
1849
- ], Canvas$1.prototype, "smoothLevel", undefined);
1849
+ ], Canvas$1.prototype, "smoothLevel", void 0);
1850
1850
  __decorate([
1851
1851
  contextAttr('globalAlpha')
1852
- ], Canvas$1.prototype, "opacity", undefined);
1852
+ ], Canvas$1.prototype, "opacity", void 0);
1853
1853
  __decorate([
1854
1854
  contextAttr()
1855
- ], Canvas$1.prototype, "fillStyle", undefined);
1855
+ ], Canvas$1.prototype, "fillStyle", void 0);
1856
1856
  __decorate([
1857
1857
  contextAttr()
1858
- ], Canvas$1.prototype, "strokeStyle", undefined);
1858
+ ], Canvas$1.prototype, "strokeStyle", void 0);
1859
1859
  __decorate([
1860
1860
  contextAttr('lineWidth')
1861
- ], Canvas$1.prototype, "strokeWidth", undefined);
1861
+ ], Canvas$1.prototype, "strokeWidth", void 0);
1862
1862
  __decorate([
1863
1863
  contextAttr('lineCap')
1864
- ], Canvas$1.prototype, "strokeCap", undefined);
1864
+ ], Canvas$1.prototype, "strokeCap", void 0);
1865
1865
  __decorate([
1866
1866
  contextAttr('lineJoin')
1867
- ], Canvas$1.prototype, "strokeJoin", undefined);
1867
+ ], Canvas$1.prototype, "strokeJoin", void 0);
1868
1868
  __decorate([
1869
1869
  contextAttr('lineDashOffset')
1870
- ], Canvas$1.prototype, "dashOffset", undefined);
1870
+ ], Canvas$1.prototype, "dashOffset", void 0);
1871
1871
  __decorate([
1872
1872
  contextAttr()
1873
- ], Canvas$1.prototype, "miterLimit", undefined);
1873
+ ], Canvas$1.prototype, "miterLimit", void 0);
1874
1874
  __decorate([
1875
1875
  contextAttr()
1876
- ], Canvas$1.prototype, "shadowBlur", undefined);
1876
+ ], Canvas$1.prototype, "shadowBlur", void 0);
1877
1877
  __decorate([
1878
1878
  contextAttr()
1879
- ], Canvas$1.prototype, "shadowColor", undefined);
1879
+ ], Canvas$1.prototype, "shadowColor", void 0);
1880
1880
  __decorate([
1881
1881
  contextAttr()
1882
- ], Canvas$1.prototype, "shadowOffsetX", undefined);
1882
+ ], Canvas$1.prototype, "shadowOffsetX", void 0);
1883
1883
  __decorate([
1884
1884
  contextAttr()
1885
- ], Canvas$1.prototype, "shadowOffsetY", undefined);
1885
+ ], Canvas$1.prototype, "shadowOffsetY", void 0);
1886
1886
  __decorate([
1887
1887
  contextAttr()
1888
- ], Canvas$1.prototype, "filter", undefined);
1888
+ ], Canvas$1.prototype, "filter", void 0);
1889
1889
  __decorate([
1890
1890
  contextAttr()
1891
- ], Canvas$1.prototype, "font", undefined);
1891
+ ], Canvas$1.prototype, "font", void 0);
1892
1892
  __decorate([
1893
1893
  contextAttr()
1894
- ], Canvas$1.prototype, "fontKerning", undefined);
1894
+ ], Canvas$1.prototype, "fontKerning", void 0);
1895
1895
  __decorate([
1896
1896
  contextAttr()
1897
- ], Canvas$1.prototype, "fontStretch", undefined);
1897
+ ], Canvas$1.prototype, "fontStretch", void 0);
1898
1898
  __decorate([
1899
1899
  contextAttr()
1900
- ], Canvas$1.prototype, "fontVariantCaps", undefined);
1900
+ ], Canvas$1.prototype, "fontVariantCaps", void 0);
1901
1901
  __decorate([
1902
1902
  contextAttr()
1903
- ], Canvas$1.prototype, "textAlign", undefined);
1903
+ ], Canvas$1.prototype, "textAlign", void 0);
1904
1904
  __decorate([
1905
1905
  contextAttr()
1906
- ], Canvas$1.prototype, "textBaseline", undefined);
1906
+ ], Canvas$1.prototype, "textBaseline", void 0);
1907
1907
  __decorate([
1908
1908
  contextAttr()
1909
- ], Canvas$1.prototype, "textRendering", undefined);
1909
+ ], Canvas$1.prototype, "textRendering", void 0);
1910
1910
  __decorate([
1911
1911
  contextAttr()
1912
- ], Canvas$1.prototype, "wordSpacing", undefined);
1912
+ ], Canvas$1.prototype, "wordSpacing", void 0);
1913
1913
  __decorate([
1914
1914
  contextAttr()
1915
- ], Canvas$1.prototype, "letterSpacing", undefined);
1915
+ ], Canvas$1.prototype, "letterSpacing", void 0);
1916
1916
  __decorate([
1917
1917
  contextAttr()
1918
- ], Canvas$1.prototype, "direction", undefined);
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$a = Debug.get('PathConvert');
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$a.error(`command: ${command} [index:${i}]`, old);
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 maxRadius = tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2) * (getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2) / 2);
2966
- data.push(U$2, x1, y1, x2, y2, min(radius, abs$2(maxRadius)));
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$9 = Debug.get('PathDrawer');
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$9.error(`command: ${command} [index:${i}]`, data);
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$8 = Debug.get('PathBounds');
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$8.error(`command: ${command} [index:${i}]`, data);
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$7 = Debug.get('TaskProcessor');
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, undefined, undefined, function* () {
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$7.error(error);
3391
+ debug$8.error(error);
3394
3392
  }
3395
3393
  });
3396
3394
  }
@@ -3623,18 +3621,52 @@ class TaskProcessor {
3623
3621
  }
3624
3622
  }
3625
3623
 
3626
- const ImageManager = {
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
+ 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.tasker.isComplete; },
3632
3666
  get(config) {
3633
- let image = I.map[config.url];
3634
- if (!image) {
3635
- image = Creator.image(config);
3636
- I.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
- delete I.map[image.url];
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.map = {};
3679
3710
  I.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
- this.isSVG = ImageManager.isFormat('svg', config);
3694
- this.hasOpacityPixel = ImageManager.hasOpacityPixel(config);
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
- ImageManager.tasker.add(() => __awaiter(this, undefined, undefined, function* () {
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
- copy$6(matrix, t.__localMatrix);
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$6(matrix, o);
4215
4260
  scaleOfOuter$2(matrix, origin, scaleX, scaleY);
4216
4261
  if (t.origin || t.around) {
4217
- L.setTransform(t, matrix, resize);
4262
+ L.setTransform(t, matrix, resize, transition);
4218
4263
  }
4219
4264
  else {
4220
- moveByMatrix(t, matrix);
4221
- t.scaleResize(scaleX, scaleY, resize !== true);
4265
+ const x = t.x + matrix.e - o.e, y = t.y + matrix.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
- copy$6(matrix, t.__localMatrix);
4275
+ rotateOfLocal(t, origin, angle, transition) {
4276
+ const o = t.__localMatrix;
4277
+ copy$6(matrix, o);
4229
4278
  rotateOfOuter$2(matrix, origin, angle);
4230
- if (t.origin || t.around) {
4231
- L.setTransform(t, matrix);
4232
- }
4233
- else {
4234
- moveByMatrix(t, matrix);
4235
- t.rotation = MathHelper.formatRotation(t.rotation + angle);
4236
- }
4279
+ if (t.origin || t.around)
4280
+ L.setTransform(t, matrix, false, transition);
4281
+ else
4282
+ t.set({ x: t.x + matrix.e - o.e, y: t.y + matrix.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$6(matrix, t.__localMatrix);
4243
4289
  skewOfOuter(matrix, origin, skewX, skewY);
4244
- L.setTransform(t, matrix, resize);
4290
+ L.setTransform(t, matrix, resize, transition);
4245
4291
  },
4246
- transformWorld(t, transform, resize) {
4292
+ transformWorld(t, transform, resize, transition) {
4247
4293
  copy$6(matrix, t.worldTransform);
4248
4294
  multiplyParent$2(matrix, transform);
4249
4295
  if (t.parent)
4250
4296
  divideParent(matrix, t.parent.worldTransform);
4251
- L.setTransform(t, matrix, resize);
4297
+ L.setTransform(t, matrix, resize, transition);
4252
4298
  },
4253
- transform(t, transform, resize) {
4299
+ transform(t, transform, resize, transition) {
4254
4300
  copy$6(matrix, t.localTransform);
4255
4301
  multiplyParent$2(matrix, transform);
4256
- L.setTransform(t, matrix, resize);
4302
+ L.setTransform(t, matrix, 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.3.3";
6054
+ const version = "1.4.1";
6014
6055
 
6015
6056
  class LeaferCanvas extends LeaferCanvasBase {
6016
6057
  get allowBackgroundColor() { return true; }
@@ -6355,7 +6396,7 @@ class Layouter {
6355
6396
  }
6356
6397
  partLayout() {
6357
6398
  var _a;
6358
- if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
6399
+ if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
6359
6400
  return;
6360
6401
  const t = Run.start('PartLayout');
6361
6402
  const { target, __updatedList: updateList } = this;
@@ -6724,9 +6765,7 @@ const TextConvert = {};
6724
6765
  const ColorConvert = {};
6725
6766
  const UnitConvert = {
6726
6767
  number(value, percentRefer) {
6727
- if (typeof value === 'object')
6728
- return value.type === 'percent' ? value.value * percentRefer : value.value;
6729
- return value;
6768
+ return typeof value === 'object' ? (value.type === 'percent' ? value.value * percentRefer : value.value) : value;
6730
6769
  }
6731
6770
  };
6732
6771
  const PathArrow = {};
@@ -6734,16 +6773,15 @@ const Paint = {};
6734
6773
  const PaintImage = {};
6735
6774
  const PaintGradient = {};
6736
6775
  const Effect = {};
6776
+ const Filter = {
6777
+ apply() { Plugin.need('filter'); }
6778
+ };
6737
6779
  const Export = {};
6738
6780
  const State = {
6739
- setStyleName(_leaf, _styleName, _value) { return Plugin.need('state'); },
6740
- set(_leaf, _stateName) { return Plugin.need('state'); }
6741
- };
6742
- const Transition = {
6743
- list: {},
6744
- register(attrName, fn) { Transition.list[attrName] = fn; },
6745
- get(attrName) { return Transition.list[attrName]; }
6781
+ setStyleName() { return Plugin.need('state'); },
6782
+ set() { return Plugin.need('state'); }
6746
6783
  };
6784
+ const Transition = {};
6747
6785
 
6748
6786
  const { parse, objectToCanvasData } = PathConvert;
6749
6787
  const emptyPaint = {};
@@ -6850,24 +6888,13 @@ class UIData extends LeafData {
6850
6888
  }
6851
6889
  }
6852
6890
  setShadow(value) {
6853
- this.__setInput('shadow', value);
6854
- if (value instanceof Array) {
6855
- if (value.some((item) => item.visible === false))
6856
- value = value.filter((item) => item.visible !== false);
6857
- this._shadow = value.length ? value : null;
6858
- }
6859
- else
6860
- this._shadow = value && value.visible !== false ? [value] : null;
6891
+ setArray(this, 'shadow', value);
6861
6892
  }
6862
6893
  setInnerShadow(value) {
6863
- this.__setInput('innerShadow', value);
6864
- if (value instanceof Array) {
6865
- if (value.some((item) => item.visible === false))
6866
- value = value.filter((item) => item.visible !== false);
6867
- this._innerShadow = value.length ? value : null;
6868
- }
6869
- else
6870
- this._innerShadow = value && value.visible !== false ? [value] : null;
6894
+ setArray(this, 'innerShadow', value);
6895
+ }
6896
+ setFilter(value) {
6897
+ setArray(this, 'filter', value);
6871
6898
  }
6872
6899
  __computePaint() {
6873
6900
  const { fill, stroke } = this.__input;
@@ -6878,6 +6905,17 @@ class UIData extends LeafData {
6878
6905
  this.__needComputePaint = false;
6879
6906
  }
6880
6907
  }
6908
+ function setArray(data, key, value) {
6909
+ data.__setInput(key, value);
6910
+ if (value instanceof Array) {
6911
+ if (value.some((item) => item.visible === false))
6912
+ value = value.filter((item) => item.visible !== false);
6913
+ value.length || (value = null);
6914
+ }
6915
+ else
6916
+ value = value && value.visible !== false ? [value] : null;
6917
+ data['_' + key] = value;
6918
+ }
6881
6919
 
6882
6920
  class GroupData extends UIData {
6883
6921
  }
@@ -7000,11 +7038,13 @@ const UIBounds = {
7000
7038
  },
7001
7039
  __updateRenderSpread() {
7002
7040
  let width = 0;
7003
- const { shadow, innerShadow, blur, backgroundBlur } = this.__;
7041
+ const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
7004
7042
  if (shadow)
7005
7043
  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));
7006
7044
  if (blur)
7007
7045
  width = Math.max(width, blur);
7046
+ if (filter)
7047
+ width += Filter.getSpread(filter);
7008
7048
  let shapeWidth = width = Math.ceil(width);
7009
7049
  if (innerShadow)
7010
7050
  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));
@@ -7019,8 +7059,8 @@ const UIRender = {
7019
7059
  __updateChange() {
7020
7060
  const data = this.__;
7021
7061
  if (data.__useEffect) {
7022
- const { shadow, innerShadow, blur, backgroundBlur } = this.__;
7023
- data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur);
7062
+ const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
7063
+ data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur || filter);
7024
7064
  }
7025
7065
  data.__checkSingle();
7026
7066
  const complex = data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect;
@@ -7034,7 +7074,7 @@ const UIRender = {
7034
7074
  __drawFast(canvas, options) {
7035
7075
  drawFast(this, canvas, options);
7036
7076
  },
7037
- __draw(canvas, options) {
7077
+ __draw(canvas, options, originCanvas) {
7038
7078
  const data = this.__;
7039
7079
  if (data.__complex) {
7040
7080
  if (data.__needComputePaint)
@@ -7044,7 +7084,7 @@ const UIRender = {
7044
7084
  if (data.__useEffect) {
7045
7085
  const shape = Paint.shape(this, canvas, options);
7046
7086
  this.__nowWorld = this.__getNowWorld(options);
7047
- const { shadow, innerShadow } = data;
7087
+ const { shadow, innerShadow, filter } = data;
7048
7088
  if (shadow)
7049
7089
  Effect.shadow(this, canvas, shape);
7050
7090
  if (fill)
@@ -7055,6 +7095,8 @@ const UIRender = {
7055
7095
  Effect.innerShadow(this, canvas, shape);
7056
7096
  if (stroke)
7057
7097
  data.__isStrokes ? Paint.strokes(stroke, this, canvas) : Paint.stroke(stroke, this, canvas);
7098
+ if (filter)
7099
+ Filter.apply(filter, this, this.__nowWorld, canvas, originCanvas, shape);
7058
7100
  if (shape.worldCanvas)
7059
7101
  shape.worldCanvas.recycle();
7060
7102
  shape.canvas.recycle();
@@ -7274,199 +7316,202 @@ let UI = UI_1 = class UI extends Leaf {
7274
7316
  };
7275
7317
  __decorate([
7276
7318
  dataProcessor(UIData)
7277
- ], UI.prototype, "__", undefined);
7319
+ ], UI.prototype, "__", void 0);
7278
7320
  __decorate([
7279
7321
  zoomLayerType()
7280
- ], UI.prototype, "zoomLayer", undefined);
7322
+ ], UI.prototype, "zoomLayer", void 0);
7281
7323
  __decorate([
7282
7324
  dataType('')
7283
- ], UI.prototype, "id", undefined);
7325
+ ], UI.prototype, "id", void 0);
7284
7326
  __decorate([
7285
7327
  dataType('')
7286
- ], UI.prototype, "name", undefined);
7328
+ ], UI.prototype, "name", void 0);
7287
7329
  __decorate([
7288
7330
  dataType('')
7289
- ], UI.prototype, "className", undefined);
7331
+ ], UI.prototype, "className", void 0);
7290
7332
  __decorate([
7291
7333
  surfaceType('pass-through')
7292
- ], UI.prototype, "blendMode", undefined);
7334
+ ], UI.prototype, "blendMode", void 0);
7293
7335
  __decorate([
7294
7336
  opacityType(1)
7295
- ], UI.prototype, "opacity", undefined);
7337
+ ], UI.prototype, "opacity", void 0);
7296
7338
  __decorate([
7297
7339
  visibleType(true)
7298
- ], UI.prototype, "visible", undefined);
7340
+ ], UI.prototype, "visible", void 0);
7299
7341
  __decorate([
7300
7342
  surfaceType(false)
7301
- ], UI.prototype, "locked", undefined);
7343
+ ], UI.prototype, "locked", void 0);
7302
7344
  __decorate([
7303
7345
  sortType(0)
7304
- ], UI.prototype, "zIndex", undefined);
7346
+ ], UI.prototype, "zIndex", void 0);
7305
7347
  __decorate([
7306
7348
  maskType(false)
7307
- ], UI.prototype, "mask", undefined);
7349
+ ], UI.prototype, "mask", void 0);
7308
7350
  __decorate([
7309
7351
  eraserType(false)
7310
- ], UI.prototype, "eraser", undefined);
7352
+ ], UI.prototype, "eraser", void 0);
7311
7353
  __decorate([
7312
7354
  positionType(0, true)
7313
- ], UI.prototype, "x", undefined);
7355
+ ], UI.prototype, "x", void 0);
7314
7356
  __decorate([
7315
7357
  positionType(0, true)
7316
- ], UI.prototype, "y", undefined);
7358
+ ], UI.prototype, "y", void 0);
7317
7359
  __decorate([
7318
7360
  boundsType(100, true)
7319
- ], UI.prototype, "width", undefined);
7361
+ ], UI.prototype, "width", void 0);
7320
7362
  __decorate([
7321
7363
  boundsType(100, true)
7322
- ], UI.prototype, "height", undefined);
7364
+ ], UI.prototype, "height", void 0);
7323
7365
  __decorate([
7324
7366
  scaleType(1, true)
7325
- ], UI.prototype, "scaleX", undefined);
7367
+ ], UI.prototype, "scaleX", void 0);
7326
7368
  __decorate([
7327
7369
  scaleType(1, true)
7328
- ], UI.prototype, "scaleY", undefined);
7370
+ ], UI.prototype, "scaleY", void 0);
7329
7371
  __decorate([
7330
7372
  rotationType(0, true)
7331
- ], UI.prototype, "rotation", undefined);
7373
+ ], UI.prototype, "rotation", void 0);
7332
7374
  __decorate([
7333
7375
  rotationType(0, true)
7334
- ], UI.prototype, "skewX", undefined);
7376
+ ], UI.prototype, "skewX", void 0);
7335
7377
  __decorate([
7336
7378
  rotationType(0, true)
7337
- ], UI.prototype, "skewY", undefined);
7379
+ ], UI.prototype, "skewY", void 0);
7338
7380
  __decorate([
7339
7381
  positionType(0, true)
7340
- ], UI.prototype, "offsetX", undefined);
7382
+ ], UI.prototype, "offsetX", void 0);
7341
7383
  __decorate([
7342
7384
  positionType(0, true)
7343
- ], UI.prototype, "offsetY", undefined);
7385
+ ], UI.prototype, "offsetY", void 0);
7344
7386
  __decorate([
7345
7387
  positionType(0, true)
7346
- ], UI.prototype, "scrollX", undefined);
7388
+ ], UI.prototype, "scrollX", void 0);
7347
7389
  __decorate([
7348
7390
  positionType(0, true)
7349
- ], UI.prototype, "scrollY", undefined);
7391
+ ], UI.prototype, "scrollY", void 0);
7350
7392
  __decorate([
7351
7393
  autoLayoutType()
7352
- ], UI.prototype, "origin", undefined);
7394
+ ], UI.prototype, "origin", void 0);
7353
7395
  __decorate([
7354
7396
  autoLayoutType()
7355
- ], UI.prototype, "around", undefined);
7397
+ ], UI.prototype, "around", void 0);
7356
7398
  __decorate([
7357
7399
  dataType(false)
7358
- ], UI.prototype, "lazy", undefined);
7400
+ ], UI.prototype, "lazy", void 0);
7359
7401
  __decorate([
7360
7402
  naturalBoundsType(1)
7361
- ], UI.prototype, "pixelRatio", undefined);
7403
+ ], UI.prototype, "pixelRatio", void 0);
7362
7404
  __decorate([
7363
7405
  pathInputType()
7364
- ], UI.prototype, "path", undefined);
7406
+ ], UI.prototype, "path", void 0);
7365
7407
  __decorate([
7366
7408
  pathType()
7367
- ], UI.prototype, "windingRule", undefined);
7409
+ ], UI.prototype, "windingRule", void 0);
7368
7410
  __decorate([
7369
7411
  pathType(true)
7370
- ], UI.prototype, "closed", undefined);
7412
+ ], UI.prototype, "closed", void 0);
7371
7413
  __decorate([
7372
7414
  boundsType(0)
7373
- ], UI.prototype, "padding", undefined);
7415
+ ], UI.prototype, "padding", void 0);
7374
7416
  __decorate([
7375
7417
  boundsType(false)
7376
- ], UI.prototype, "lockRatio", undefined);
7418
+ ], UI.prototype, "lockRatio", void 0);
7377
7419
  __decorate([
7378
7420
  boundsType()
7379
- ], UI.prototype, "widthRange", undefined);
7421
+ ], UI.prototype, "widthRange", void 0);
7380
7422
  __decorate([
7381
7423
  boundsType()
7382
- ], UI.prototype, "heightRange", undefined);
7424
+ ], UI.prototype, "heightRange", void 0);
7383
7425
  __decorate([
7384
7426
  dataType(false)
7385
- ], UI.prototype, "draggable", undefined);
7427
+ ], UI.prototype, "draggable", void 0);
7386
7428
  __decorate([
7387
7429
  dataType()
7388
- ], UI.prototype, "dragBounds", undefined);
7430
+ ], UI.prototype, "dragBounds", void 0);
7389
7431
  __decorate([
7390
7432
  dataType(false)
7391
- ], UI.prototype, "editable", undefined);
7433
+ ], UI.prototype, "editable", void 0);
7392
7434
  __decorate([
7393
7435
  hitType(true)
7394
- ], UI.prototype, "hittable", undefined);
7436
+ ], UI.prototype, "hittable", void 0);
7395
7437
  __decorate([
7396
7438
  hitType('path')
7397
- ], UI.prototype, "hitFill", undefined);
7439
+ ], UI.prototype, "hitFill", void 0);
7398
7440
  __decorate([
7399
7441
  strokeType('path')
7400
- ], UI.prototype, "hitStroke", undefined);
7442
+ ], UI.prototype, "hitStroke", void 0);
7401
7443
  __decorate([
7402
7444
  hitType(false)
7403
- ], UI.prototype, "hitBox", undefined);
7445
+ ], UI.prototype, "hitBox", void 0);
7404
7446
  __decorate([
7405
7447
  hitType(true)
7406
- ], UI.prototype, "hitChildren", undefined);
7448
+ ], UI.prototype, "hitChildren", void 0);
7407
7449
  __decorate([
7408
7450
  hitType(true)
7409
- ], UI.prototype, "hitSelf", undefined);
7451
+ ], UI.prototype, "hitSelf", void 0);
7410
7452
  __decorate([
7411
7453
  hitType()
7412
- ], UI.prototype, "hitRadius", undefined);
7454
+ ], UI.prototype, "hitRadius", void 0);
7413
7455
  __decorate([
7414
7456
  cursorType('')
7415
- ], UI.prototype, "cursor", undefined);
7457
+ ], UI.prototype, "cursor", void 0);
7416
7458
  __decorate([
7417
7459
  surfaceType()
7418
- ], UI.prototype, "fill", undefined);
7460
+ ], UI.prototype, "fill", void 0);
7419
7461
  __decorate([
7420
7462
  strokeType()
7421
- ], UI.prototype, "stroke", undefined);
7463
+ ], UI.prototype, "stroke", void 0);
7422
7464
  __decorate([
7423
7465
  strokeType('inside')
7424
- ], UI.prototype, "strokeAlign", undefined);
7466
+ ], UI.prototype, "strokeAlign", void 0);
7425
7467
  __decorate([
7426
7468
  strokeType(1)
7427
- ], UI.prototype, "strokeWidth", undefined);
7469
+ ], UI.prototype, "strokeWidth", void 0);
7428
7470
  __decorate([
7429
7471
  strokeType(false)
7430
- ], UI.prototype, "strokeWidthFixed", undefined);
7472
+ ], UI.prototype, "strokeWidthFixed", void 0);
7431
7473
  __decorate([
7432
7474
  strokeType('none')
7433
- ], UI.prototype, "strokeCap", undefined);
7475
+ ], UI.prototype, "strokeCap", void 0);
7434
7476
  __decorate([
7435
7477
  strokeType('miter')
7436
- ], UI.prototype, "strokeJoin", undefined);
7478
+ ], UI.prototype, "strokeJoin", void 0);
7437
7479
  __decorate([
7438
7480
  strokeType()
7439
- ], UI.prototype, "dashPattern", undefined);
7481
+ ], UI.prototype, "dashPattern", void 0);
7440
7482
  __decorate([
7441
7483
  strokeType()
7442
- ], UI.prototype, "dashOffset", undefined);
7484
+ ], UI.prototype, "dashOffset", void 0);
7443
7485
  __decorate([
7444
7486
  strokeType(10)
7445
- ], UI.prototype, "miterLimit", undefined);
7487
+ ], UI.prototype, "miterLimit", void 0);
7446
7488
  __decorate([
7447
7489
  pathType(0)
7448
- ], UI.prototype, "cornerRadius", undefined);
7490
+ ], UI.prototype, "cornerRadius", void 0);
7449
7491
  __decorate([
7450
7492
  pathType()
7451
- ], UI.prototype, "cornerSmoothing", undefined);
7493
+ ], UI.prototype, "cornerSmoothing", void 0);
7494
+ __decorate([
7495
+ effectType()
7496
+ ], UI.prototype, "shadow", void 0);
7452
7497
  __decorate([
7453
7498
  effectType()
7454
- ], UI.prototype, "shadow", undefined);
7499
+ ], UI.prototype, "innerShadow", void 0);
7455
7500
  __decorate([
7456
7501
  effectType()
7457
- ], UI.prototype, "innerShadow", undefined);
7502
+ ], UI.prototype, "blur", void 0);
7458
7503
  __decorate([
7459
7504
  effectType()
7460
- ], UI.prototype, "blur", undefined);
7505
+ ], UI.prototype, "backgroundBlur", void 0);
7461
7506
  __decorate([
7462
7507
  effectType()
7463
- ], UI.prototype, "backgroundBlur", undefined);
7508
+ ], UI.prototype, "grayscale", void 0);
7464
7509
  __decorate([
7465
7510
  effectType()
7466
- ], UI.prototype, "grayscale", undefined);
7511
+ ], UI.prototype, "filter", void 0);
7467
7512
  __decorate([
7468
7513
  dataType({})
7469
- ], UI.prototype, "data", undefined);
7514
+ ], UI.prototype, "data", void 0);
7470
7515
  __decorate([
7471
7516
  rewrite(Leaf.prototype.reset)
7472
7517
  ], UI.prototype, "reset", null);
@@ -7527,7 +7572,7 @@ let Group = class Group extends UI {
7527
7572
  };
7528
7573
  __decorate([
7529
7574
  dataProcessor(GroupData)
7530
- ], Group.prototype, "__", undefined);
7575
+ ], Group.prototype, "__", void 0);
7531
7576
  Group = __decorate([
7532
7577
  useModule(Branch),
7533
7578
  registerUI()
@@ -7540,7 +7585,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7540
7585
  get isApp() { return false; }
7541
7586
  get app() { return this.parent || this; }
7542
7587
  get isLeafer() { return true; }
7543
- get imageReady() { return this.viewReady && ImageManager.isComplete; }
7588
+ get imageReady() { return this.viewReady && Resource.isComplete; }
7544
7589
  get layoutLocked() { return !this.layouter.running; }
7545
7590
  get FPS() { return this.renderer ? this.renderer.FPS : 60; }
7546
7591
  get cursorPoint() { return (this.interaction && this.interaction.hoverData) || { x: this.width / 2, y: this.height / 2 }; }
@@ -7751,13 +7796,13 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7751
7796
  WaitHelper.run(this.__viewReadyWait);
7752
7797
  }
7753
7798
  __onLayoutEnd() {
7754
- const { grow, growWidth, growHeight } = this.config;
7799
+ const { grow, width: fixedWidth, height: fixedHeight } = this.config;
7755
7800
  if (grow) {
7756
7801
  let { width, height, pixelRatio } = this;
7757
7802
  const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
7758
- if (growWidth !== false)
7803
+ if (!fixedWidth)
7759
7804
  width = Math.max(1, bounds.x + bounds.width);
7760
- if (growHeight !== false)
7805
+ if (!fixedHeight)
7761
7806
  height = Math.max(1, bounds.y + bounds.height);
7762
7807
  this.__doResize({ width, height, pixelRatio });
7763
7808
  }
@@ -7835,7 +7880,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7835
7880
  list.push(item);
7836
7881
  this.requestRender();
7837
7882
  }
7838
- zoom(_zoomType, _padding, _fixedScale) {
7883
+ zoom(_zoomType, _padding, _fixedScale, _transition) {
7839
7884
  return Plugin.need('view');
7840
7885
  }
7841
7886
  getValidMove(moveX, moveY) { return { x: moveX, y: moveY }; }
@@ -7900,10 +7945,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7900
7945
  Leafer.list = new LeafList();
7901
7946
  __decorate([
7902
7947
  dataProcessor(LeaferData)
7903
- ], Leafer.prototype, "__", undefined);
7948
+ ], Leafer.prototype, "__", void 0);
7904
7949
  __decorate([
7905
7950
  boundsType()
7906
- ], Leafer.prototype, "pixelRatio", undefined);
7951
+ ], Leafer.prototype, "pixelRatio", void 0);
7907
7952
  Leafer = Leafer_1 = __decorate([
7908
7953
  registerUI()
7909
7954
  ], Leafer);
@@ -7916,7 +7961,7 @@ let Rect = class Rect extends UI {
7916
7961
  };
7917
7962
  __decorate([
7918
7963
  dataProcessor(RectData)
7919
- ], Rect.prototype, "__", undefined);
7964
+ ], Rect.prototype, "__", void 0);
7920
7965
  Rect = __decorate([
7921
7966
  useModule(RectRender),
7922
7967
  rewriteAble(),
@@ -8007,13 +8052,13 @@ let Box = class Box extends Group {
8007
8052
  };
8008
8053
  __decorate([
8009
8054
  dataProcessor(BoxData)
8010
- ], Box.prototype, "__", undefined);
8055
+ ], Box.prototype, "__", void 0);
8011
8056
  __decorate([
8012
8057
  dataType(false)
8013
- ], Box.prototype, "resizeChildren", undefined);
8058
+ ], Box.prototype, "resizeChildren", void 0);
8014
8059
  __decorate([
8015
8060
  affectRenderBoundsType('show')
8016
- ], Box.prototype, "overflow", undefined);
8061
+ ], Box.prototype, "overflow", void 0);
8017
8062
  __decorate([
8018
8063
  rewrite(rect.__updateStrokeSpread)
8019
8064
  ], Box.prototype, "__updateStrokeSpread", null);
@@ -8052,13 +8097,13 @@ let Frame = class Frame extends Box {
8052
8097
  };
8053
8098
  __decorate([
8054
8099
  dataProcessor(FrameData)
8055
- ], Frame.prototype, "__", undefined);
8100
+ ], Frame.prototype, "__", void 0);
8056
8101
  __decorate([
8057
8102
  surfaceType('#FFFFFF')
8058
- ], Frame.prototype, "fill", undefined);
8103
+ ], Frame.prototype, "fill", void 0);
8059
8104
  __decorate([
8060
8105
  affectRenderBoundsType('hide')
8061
- ], Frame.prototype, "overflow", undefined);
8106
+ ], Frame.prototype, "overflow", void 0);
8062
8107
  Frame = __decorate([
8063
8108
  registerUI()
8064
8109
  ], Frame);
@@ -8105,16 +8150,16 @@ let Ellipse = class Ellipse extends UI {
8105
8150
  };
8106
8151
  __decorate([
8107
8152
  dataProcessor(EllipseData)
8108
- ], Ellipse.prototype, "__", undefined);
8153
+ ], Ellipse.prototype, "__", void 0);
8109
8154
  __decorate([
8110
8155
  pathType(0)
8111
- ], Ellipse.prototype, "innerRadius", undefined);
8156
+ ], Ellipse.prototype, "innerRadius", void 0);
8112
8157
  __decorate([
8113
8158
  pathType(0)
8114
- ], Ellipse.prototype, "startAngle", undefined);
8159
+ ], Ellipse.prototype, "startAngle", void 0);
8115
8160
  __decorate([
8116
8161
  pathType(0)
8117
- ], Ellipse.prototype, "endAngle", undefined);
8162
+ ], Ellipse.prototype, "endAngle", void 0);
8118
8163
  Ellipse = __decorate([
8119
8164
  registerUI()
8120
8165
  ], Ellipse);
@@ -8173,22 +8218,22 @@ let Line = class Line extends UI {
8173
8218
  };
8174
8219
  __decorate([
8175
8220
  dataProcessor(LineData)
8176
- ], Line.prototype, "__", undefined);
8221
+ ], Line.prototype, "__", void 0);
8177
8222
  __decorate([
8178
8223
  affectStrokeBoundsType('center')
8179
- ], Line.prototype, "strokeAlign", undefined);
8224
+ ], Line.prototype, "strokeAlign", void 0);
8180
8225
  __decorate([
8181
8226
  boundsType(0)
8182
- ], Line.prototype, "height", undefined);
8227
+ ], Line.prototype, "height", void 0);
8183
8228
  __decorate([
8184
8229
  pathType()
8185
- ], Line.prototype, "points", undefined);
8230
+ ], Line.prototype, "points", void 0);
8186
8231
  __decorate([
8187
8232
  pathType(0)
8188
- ], Line.prototype, "curve", undefined);
8233
+ ], Line.prototype, "curve", void 0);
8189
8234
  __decorate([
8190
8235
  pathType(false)
8191
- ], Line.prototype, "closed", undefined);
8236
+ ], Line.prototype, "closed", void 0);
8192
8237
  Line = __decorate([
8193
8238
  registerUI()
8194
8239
  ], Line);
@@ -8221,16 +8266,16 @@ let Polygon = class Polygon extends UI {
8221
8266
  };
8222
8267
  __decorate([
8223
8268
  dataProcessor(PolygonData)
8224
- ], Polygon.prototype, "__", undefined);
8269
+ ], Polygon.prototype, "__", void 0);
8225
8270
  __decorate([
8226
8271
  pathType(3)
8227
- ], Polygon.prototype, "sides", undefined);
8272
+ ], Polygon.prototype, "sides", void 0);
8228
8273
  __decorate([
8229
8274
  pathType()
8230
- ], Polygon.prototype, "points", undefined);
8275
+ ], Polygon.prototype, "points", void 0);
8231
8276
  __decorate([
8232
8277
  pathType(0)
8233
- ], Polygon.prototype, "curve", undefined);
8278
+ ], Polygon.prototype, "curve", void 0);
8234
8279
  __decorate([
8235
8280
  rewrite(line.__updateRenderPath)
8236
8281
  ], Polygon.prototype, "__updateRenderPath", null);
@@ -8262,13 +8307,13 @@ let Star = class Star extends UI {
8262
8307
  };
8263
8308
  __decorate([
8264
8309
  dataProcessor(StarData)
8265
- ], Star.prototype, "__", undefined);
8310
+ ], Star.prototype, "__", void 0);
8266
8311
  __decorate([
8267
8312
  pathType(5)
8268
- ], Star.prototype, "corners", undefined);
8313
+ ], Star.prototype, "corners", void 0);
8269
8314
  __decorate([
8270
8315
  pathType(0.382)
8271
- ], Star.prototype, "innerRadius", undefined);
8316
+ ], Star.prototype, "innerRadius", void 0);
8272
8317
  Star = __decorate([
8273
8318
  registerUI()
8274
8319
  ], Star);
@@ -8290,10 +8335,10 @@ let Image = class Image extends Rect {
8290
8335
  };
8291
8336
  __decorate([
8292
8337
  dataProcessor(ImageData)
8293
- ], Image.prototype, "__", undefined);
8338
+ ], Image.prototype, "__", void 0);
8294
8339
  __decorate([
8295
8340
  boundsType('')
8296
- ], Image.prototype, "url", undefined);
8341
+ ], Image.prototype, "url", void 0);
8297
8342
  Image = __decorate([
8298
8343
  registerUI()
8299
8344
  ], Image);
@@ -8356,25 +8401,25 @@ let Canvas = class Canvas extends Rect {
8356
8401
  };
8357
8402
  __decorate([
8358
8403
  dataProcessor(CanvasData)
8359
- ], Canvas.prototype, "__", undefined);
8404
+ ], Canvas.prototype, "__", void 0);
8360
8405
  __decorate([
8361
8406
  resizeType(100)
8362
- ], Canvas.prototype, "width", undefined);
8407
+ ], Canvas.prototype, "width", void 0);
8363
8408
  __decorate([
8364
8409
  resizeType(100)
8365
- ], Canvas.prototype, "height", undefined);
8410
+ ], Canvas.prototype, "height", void 0);
8366
8411
  __decorate([
8367
8412
  resizeType(1)
8368
- ], Canvas.prototype, "pixelRatio", undefined);
8413
+ ], Canvas.prototype, "pixelRatio", void 0);
8369
8414
  __decorate([
8370
8415
  resizeType(true)
8371
- ], Canvas.prototype, "smooth", undefined);
8416
+ ], Canvas.prototype, "smooth", void 0);
8372
8417
  __decorate([
8373
8418
  dataType(false)
8374
- ], Canvas.prototype, "safeResize", undefined);
8419
+ ], Canvas.prototype, "safeResize", void 0);
8375
8420
  __decorate([
8376
8421
  resizeType()
8377
- ], Canvas.prototype, "contextSettings", undefined);
8422
+ ], Canvas.prototype, "contextSettings", void 0);
8378
8423
  Canvas = __decorate([
8379
8424
  registerUI()
8380
8425
  ], Canvas);
@@ -8465,76 +8510,76 @@ let Text = class Text extends UI {
8465
8510
  };
8466
8511
  __decorate([
8467
8512
  dataProcessor(TextData)
8468
- ], Text.prototype, "__", undefined);
8513
+ ], Text.prototype, "__", void 0);
8469
8514
  __decorate([
8470
8515
  boundsType(0)
8471
- ], Text.prototype, "width", undefined);
8516
+ ], Text.prototype, "width", void 0);
8472
8517
  __decorate([
8473
8518
  boundsType(0)
8474
- ], Text.prototype, "height", undefined);
8519
+ ], Text.prototype, "height", void 0);
8475
8520
  __decorate([
8476
8521
  dataType(false)
8477
- ], Text.prototype, "resizeFontSize", undefined);
8522
+ ], Text.prototype, "resizeFontSize", void 0);
8478
8523
  __decorate([
8479
8524
  surfaceType('#000000')
8480
- ], Text.prototype, "fill", undefined);
8525
+ ], Text.prototype, "fill", void 0);
8481
8526
  __decorate([
8482
8527
  affectStrokeBoundsType('outside')
8483
- ], Text.prototype, "strokeAlign", undefined);
8528
+ ], Text.prototype, "strokeAlign", void 0);
8484
8529
  __decorate([
8485
8530
  hitType('all')
8486
- ], Text.prototype, "hitFill", undefined);
8531
+ ], Text.prototype, "hitFill", void 0);
8487
8532
  __decorate([
8488
8533
  boundsType('')
8489
- ], Text.prototype, "text", undefined);
8534
+ ], Text.prototype, "text", void 0);
8490
8535
  __decorate([
8491
8536
  boundsType('caption')
8492
- ], Text.prototype, "fontFamily", undefined);
8537
+ ], Text.prototype, "fontFamily", void 0);
8493
8538
  __decorate([
8494
8539
  boundsType(12)
8495
- ], Text.prototype, "fontSize", undefined);
8540
+ ], Text.prototype, "fontSize", void 0);
8496
8541
  __decorate([
8497
8542
  boundsType('normal')
8498
- ], Text.prototype, "fontWeight", undefined);
8543
+ ], Text.prototype, "fontWeight", void 0);
8499
8544
  __decorate([
8500
8545
  boundsType(false)
8501
- ], Text.prototype, "italic", undefined);
8546
+ ], Text.prototype, "italic", void 0);
8502
8547
  __decorate([
8503
8548
  boundsType('none')
8504
- ], Text.prototype, "textCase", undefined);
8549
+ ], Text.prototype, "textCase", void 0);
8505
8550
  __decorate([
8506
8551
  boundsType('none')
8507
- ], Text.prototype, "textDecoration", undefined);
8552
+ ], Text.prototype, "textDecoration", void 0);
8508
8553
  __decorate([
8509
8554
  boundsType(0)
8510
- ], Text.prototype, "letterSpacing", undefined);
8555
+ ], Text.prototype, "letterSpacing", void 0);
8511
8556
  __decorate([
8512
8557
  boundsType({ type: 'percent', value: 1.5 })
8513
- ], Text.prototype, "lineHeight", undefined);
8558
+ ], Text.prototype, "lineHeight", void 0);
8514
8559
  __decorate([
8515
8560
  boundsType(0)
8516
- ], Text.prototype, "paraIndent", undefined);
8561
+ ], Text.prototype, "paraIndent", void 0);
8517
8562
  __decorate([
8518
8563
  boundsType(0)
8519
- ], Text.prototype, "paraSpacing", undefined);
8564
+ ], Text.prototype, "paraSpacing", void 0);
8520
8565
  __decorate([
8521
8566
  boundsType('x')
8522
- ], Text.prototype, "writingMode", undefined);
8567
+ ], Text.prototype, "writingMode", void 0);
8523
8568
  __decorate([
8524
8569
  boundsType('left')
8525
- ], Text.prototype, "textAlign", undefined);
8570
+ ], Text.prototype, "textAlign", void 0);
8526
8571
  __decorate([
8527
8572
  boundsType('top')
8528
- ], Text.prototype, "verticalAlign", undefined);
8573
+ ], Text.prototype, "verticalAlign", void 0);
8529
8574
  __decorate([
8530
8575
  boundsType(true)
8531
- ], Text.prototype, "autoSizeAlign", undefined);
8576
+ ], Text.prototype, "autoSizeAlign", void 0);
8532
8577
  __decorate([
8533
8578
  boundsType('normal')
8534
- ], Text.prototype, "textWrap", undefined);
8579
+ ], Text.prototype, "textWrap", void 0);
8535
8580
  __decorate([
8536
8581
  boundsType('show')
8537
- ], Text.prototype, "textOverflow", undefined);
8582
+ ], Text.prototype, "textOverflow", void 0);
8538
8583
  Text = __decorate([
8539
8584
  registerUI()
8540
8585
  ], Text);
@@ -8547,10 +8592,10 @@ let Path = class Path extends UI {
8547
8592
  };
8548
8593
  __decorate([
8549
8594
  dataProcessor(PathData)
8550
- ], Path.prototype, "__", undefined);
8595
+ ], Path.prototype, "__", void 0);
8551
8596
  __decorate([
8552
8597
  affectStrokeBoundsType('center')
8553
- ], Path.prototype, "strokeAlign", undefined);
8598
+ ], Path.prototype, "strokeAlign", void 0);
8554
8599
  Path = __decorate([
8555
8600
  registerUI()
8556
8601
  ], Path);
@@ -8589,10 +8634,10 @@ let Pen = class Pen extends Group {
8589
8634
  };
8590
8635
  __decorate([
8591
8636
  dataProcessor(PenData)
8592
- ], Pen.prototype, "__", undefined);
8637
+ ], Pen.prototype, "__", void 0);
8593
8638
  __decorate([
8594
8639
  penPathType()
8595
- ], Pen.prototype, "path", undefined);
8640
+ ], Pen.prototype, "path", void 0);
8596
8641
  Pen = __decorate([
8597
8642
  useModule(PathCreator, ['set', 'path', 'paint']),
8598
8643
  registerUI()
@@ -8964,7 +9009,7 @@ function getPatternData(paint, box, image) {
8964
9009
  box = tempBox.set(box).shrink(paint.padding);
8965
9010
  if (paint.mode === 'strench')
8966
9011
  paint.mode = 'stretch';
8967
- const { opacity, mode, align, offset, scale, size, rotation, repeat } = paint;
9012
+ const { opacity, mode, align, offset, scale, size, rotation, repeat, filters } = paint;
8968
9013
  const sameBox = box.width === width && box.height === height;
8969
9014
  const data = { mode };
8970
9015
  const swapSize = align !== 'center' && (rotation || 0) % 180 === 90;
@@ -9027,6 +9072,8 @@ function getPatternData(paint, box, image) {
9027
9072
  data.height = height;
9028
9073
  if (opacity)
9029
9074
  data.opacity = opacity;
9075
+ if (filters)
9076
+ data.filters = filters;
9030
9077
  if (repeat)
9031
9078
  data.repeat = typeof repeat === 'string' ? (repeat === 'x' ? 'repeat-x' : 'repeat-y') : 'repeat';
9032
9079
  return data;
@@ -9129,7 +9176,7 @@ function createPattern(ui, paint, pixelRatio) {
9129
9176
  scaleX = abs$1(scaleX);
9130
9177
  scaleY = abs$1(scaleY);
9131
9178
  const { image, data } = paint;
9132
- let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, opacity, transform, repeat } = data;
9179
+ let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, transform, repeat } = data;
9133
9180
  if (sx) {
9134
9181
  imageMatrix = get$1();
9135
9182
  copy$1(imageMatrix, transform);
@@ -9172,7 +9219,7 @@ function createPattern(ui, paint, pixelRatio) {
9172
9219
  }
9173
9220
  scale(imageMatrix, 1 / scaleX, 1 / scaleY);
9174
9221
  }
9175
- const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, opacity);
9222
+ const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, data.opacity, data.filters);
9176
9223
  const pattern = image.getPattern(canvas, repeat || (Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint);
9177
9224
  paint.style = pattern;
9178
9225
  paint.patternId = id;
@@ -9216,7 +9263,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
9216
9263
  canvas.opacity *= data.opacity;
9217
9264
  if (data.transform)
9218
9265
  canvas.transform(data.transform);
9219
- canvas.drawImage(paint.image.view, 0, 0, data.width, data.height);
9266
+ canvas.drawImage(paint.image.getFull(data.filters), 0, 0, data.width, data.height);
9220
9267
  canvas.restore();
9221
9268
  return true;
9222
9269
  }
@@ -9226,7 +9273,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
9226
9273
  }
9227
9274
  else {
9228
9275
  if (!paint.patternTask) {
9229
- paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
9276
+ paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
9230
9277
  paint.patternTask = null;
9231
9278
  if (canvas.bounds.hit(ui.__nowWorld))
9232
9279
  createPattern(ui, paint, pixelRatio);
@@ -9816,11 +9863,11 @@ const TextMode = 2;
9816
9863
  function layoutChar(drawData, style, width, _height) {
9817
9864
  const { rows } = drawData;
9818
9865
  const { textAlign, paraIndent, letterSpacing } = style;
9819
- let charX, addWordWidth, indentWidth, mode, wordChar;
9866
+ let charX, addWordWidth, indentWidth, mode, wordChar, wordsLength;
9820
9867
  rows.forEach(row => {
9821
9868
  if (row.words) {
9822
- indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
9823
- addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
9869
+ indentWidth = paraIndent && row.paraStart ? paraIndent : 0, wordsLength = row.words.length;
9870
+ addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && wordsLength > 1) ? (width - row.width - indentWidth) / (wordsLength - 1) : 0;
9824
9871
  mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
9825
9872
  if (row.isOverflow && !letterSpacing)
9826
9873
  row.textMode = true;
@@ -9832,7 +9879,7 @@ function layoutChar(drawData, style, width, _height) {
9832
9879
  row.x += indentWidth;
9833
9880
  charX = row.x;
9834
9881
  row.data = [];
9835
- row.words.forEach(word => {
9882
+ row.words.forEach((word, index) => {
9836
9883
  if (mode === WordMode) {
9837
9884
  wordChar = { char: '', x: charX };
9838
9885
  charX = toWordChar(word.data, charX, wordChar);
@@ -9842,7 +9889,7 @@ function layoutChar(drawData, style, width, _height) {
9842
9889
  else {
9843
9890
  charX = toChar(word.data, charX, row.data, row.isOverflow);
9844
9891
  }
9845
- if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
9892
+ if (addWordWidth && (!row.paraEnd || textAlign === 'both') && (index !== wordsLength - 1)) {
9846
9893
  charX += addWordWidth;
9847
9894
  row.width += addWordWidth;
9848
9895
  }
@@ -10093,4 +10140,5 @@ Object.assign(Effect, EffectModule);
10093
10140
 
10094
10141
  useCanvas();
10095
10142
 
10096
- 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 };
10143
+ 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 };
10144
+ //# sourceMappingURL=worker.module.js.map