@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.
package/dist/worker.js CHANGED
@@ -1377,7 +1377,7 @@ var LeaferUI = (function (exports) {
1377
1377
  }
1378
1378
  const D$4 = Debug;
1379
1379
 
1380
- const debug$d = Debug.get('RunTime');
1380
+ const debug$e = Debug.get('RunTime');
1381
1381
  const Run = {
1382
1382
  currentId: 0,
1383
1383
  currentName: '',
@@ -1386,24 +1386,24 @@ var LeaferUI = (function (exports) {
1386
1386
  nameToIdMap: {},
1387
1387
  start(name, microsecond) {
1388
1388
  const id = IncrementId.create(IncrementId.RUNTIME);
1389
- R.currentId = R.idMap[id] = microsecond ? performance.now() : Date.now();
1390
- R.currentName = R.nameMap[id] = name;
1391
- R.nameToIdMap[name] = id;
1389
+ R$1.currentId = R$1.idMap[id] = microsecond ? performance.now() : Date.now();
1390
+ R$1.currentName = R$1.nameMap[id] = name;
1391
+ R$1.nameToIdMap[name] = id;
1392
1392
  return id;
1393
1393
  },
1394
1394
  end(id, microsecond) {
1395
- const time = R.idMap[id], name = R.nameMap[id];
1395
+ const time = R$1.idMap[id], name = R$1.nameMap[id];
1396
1396
  const duration = microsecond ? (performance.now() - time) / 1000 : Date.now() - time;
1397
- R.idMap[id] = R.nameMap[id] = R.nameToIdMap[name] = undefined;
1398
- debug$d.log(name, duration, 'ms');
1397
+ R$1.idMap[id] = R$1.nameMap[id] = R$1.nameToIdMap[name] = undefined;
1398
+ debug$e.log(name, duration, 'ms');
1399
1399
  },
1400
1400
  endOfName(name, microsecond) {
1401
- const id = R.nameToIdMap[name];
1401
+ const id = R$1.nameToIdMap[name];
1402
1402
  if (id !== undefined)
1403
- R.end(id, microsecond);
1403
+ R$1.end(id, microsecond);
1404
1404
  }
1405
1405
  };
1406
- const R = Run;
1406
+ const R$1 = Run;
1407
1407
 
1408
1408
  const check = [];
1409
1409
  const Plugin = {
@@ -1424,18 +1424,18 @@ var LeaferUI = (function (exports) {
1424
1424
  };
1425
1425
  setTimeout(() => check.forEach(name => Plugin.has(name, true)));
1426
1426
 
1427
- const debug$c = Debug.get('UICreator');
1427
+ const debug$d = Debug.get('UICreator');
1428
1428
  const UICreator = {
1429
1429
  list: {},
1430
1430
  register(UI) {
1431
1431
  const { __tag: tag } = UI.prototype;
1432
1432
  if (list$1[tag])
1433
- debug$c.repeat(tag);
1433
+ debug$d.repeat(tag);
1434
1434
  list$1[tag] = UI;
1435
1435
  },
1436
1436
  get(tag, data, x, y, width, height) {
1437
1437
  if (!list$1[tag])
1438
- debug$c.error('not register ' + tag);
1438
+ debug$d.error('not register ' + tag);
1439
1439
  const ui = new list$1[tag](data);
1440
1440
  if (x !== undefined) {
1441
1441
  ui.x = x;
@@ -1451,7 +1451,7 @@ var LeaferUI = (function (exports) {
1451
1451
  };
1452
1452
  const { list: list$1 } = UICreator;
1453
1453
 
1454
- const debug$b = Debug.get('EventCreator');
1454
+ const debug$c = Debug.get('EventCreator');
1455
1455
  const EventCreator = {
1456
1456
  nameList: {},
1457
1457
  register(Event) {
@@ -1459,7 +1459,7 @@ var LeaferUI = (function (exports) {
1459
1459
  Object.keys(Event).forEach(key => {
1460
1460
  name = Event[key];
1461
1461
  if (typeof name === 'string')
1462
- nameList[name] && debug$b.repeat(name), nameList[name] = Event;
1462
+ nameList[name] && debug$c.repeat(name), nameList[name] = Event;
1463
1463
  });
1464
1464
  },
1465
1465
  changeName(oldName, newName) {
@@ -1536,10 +1536,10 @@ var LeaferUI = (function (exports) {
1536
1536
  Object.keys(merge).forEach(key => {
1537
1537
  var _a, _b;
1538
1538
  value = merge[key];
1539
- if ((value === null || value === undefined ? undefined : value.constructor) === Object && ((_a = t[key]) === null || _a === undefined ? undefined : _a.constructor) === Object)
1539
+ if ((value === null || value === void 0 ? void 0 : value.constructor) === Object && ((_a = t[key]) === null || _a === void 0 ? void 0 : _a.constructor) === Object)
1540
1540
  return assign(t[key], merge[key], exclude && exclude[key]);
1541
1541
  if (exclude && (key in exclude)) {
1542
- if (((_b = exclude[key]) === null || _b === undefined ? undefined : _b.constructor) === Object)
1542
+ if (((_b = exclude[key]) === null || _b === void 0 ? void 0 : _b.constructor) === Object)
1543
1543
  assign(t[key] = {}, merge[key], exclude[key]);
1544
1544
  return;
1545
1545
  }
@@ -1663,7 +1663,7 @@ var LeaferUI = (function (exports) {
1663
1663
  const t = this;
1664
1664
  if (t.blendMode === 'pass-through') {
1665
1665
  const leaf = this.__leaf;
1666
- if ((t.opacity < 1 && (leaf.isBranch || t.__hasMultiPaint)) || leaf.__hasEraser || t.eraser) {
1666
+ if ((t.opacity < 1 && (leaf.isBranch || t.__hasMultiPaint)) || leaf.__hasEraser || t.eraser || t.filter) {
1667
1667
  t.__single = true;
1668
1668
  }
1669
1669
  else if (t.__single) {
@@ -1776,7 +1776,7 @@ var LeaferUI = (function (exports) {
1776
1776
  }
1777
1777
  setTransform(_a, _b, _c, _d, _e, _f) { }
1778
1778
  resetTransform() { }
1779
- getTransform() { return undefined; }
1779
+ getTransform() { return void 0; }
1780
1780
  save() { }
1781
1781
  restore() { }
1782
1782
  transform(a, b, c, d, e, f) {
@@ -1833,12 +1833,12 @@ var LeaferUI = (function (exports) {
1833
1833
  ellipse(_x, _y, _radiusX, _radiusY, _rotation, _startAngle, _endAngle, _anticlockwise) { }
1834
1834
  rect(_x, _y, _width, _height) { }
1835
1835
  roundRect(_x, _y, _width, _height, _radius) { }
1836
- createConicGradient(_startAngle, _x, _y) { return undefined; }
1837
- createLinearGradient(_x0, _y0, _x1, _y1) { return undefined; }
1838
- createPattern(_image, _repetition) { return undefined; }
1839
- createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return undefined; }
1836
+ createConicGradient(_startAngle, _x, _y) { return void 0; }
1837
+ createLinearGradient(_x0, _y0, _x1, _y1) { return void 0; }
1838
+ createPattern(_image, _repetition) { return void 0; }
1839
+ createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return void 0; }
1840
1840
  fillText(_text, _x, _y, _maxWidth) { }
1841
- measureText(_text) { return undefined; }
1841
+ measureText(_text) { return void 0; }
1842
1842
  strokeText(_text, _x, _y, _maxWidth) { }
1843
1843
  destroy() {
1844
1844
  this.context = null;
@@ -1846,79 +1846,79 @@ var LeaferUI = (function (exports) {
1846
1846
  }
1847
1847
  __decorate([
1848
1848
  contextAttr('imageSmoothingEnabled')
1849
- ], Canvas.prototype, "smooth", undefined);
1849
+ ], Canvas.prototype, "smooth", void 0);
1850
1850
  __decorate([
1851
1851
  contextAttr('imageSmoothingQuality')
1852
- ], Canvas.prototype, "smoothLevel", undefined);
1852
+ ], Canvas.prototype, "smoothLevel", void 0);
1853
1853
  __decorate([
1854
1854
  contextAttr('globalAlpha')
1855
- ], Canvas.prototype, "opacity", undefined);
1855
+ ], Canvas.prototype, "opacity", void 0);
1856
1856
  __decorate([
1857
1857
  contextAttr()
1858
- ], Canvas.prototype, "fillStyle", undefined);
1858
+ ], Canvas.prototype, "fillStyle", void 0);
1859
1859
  __decorate([
1860
1860
  contextAttr()
1861
- ], Canvas.prototype, "strokeStyle", undefined);
1861
+ ], Canvas.prototype, "strokeStyle", void 0);
1862
1862
  __decorate([
1863
1863
  contextAttr('lineWidth')
1864
- ], Canvas.prototype, "strokeWidth", undefined);
1864
+ ], Canvas.prototype, "strokeWidth", void 0);
1865
1865
  __decorate([
1866
1866
  contextAttr('lineCap')
1867
- ], Canvas.prototype, "strokeCap", undefined);
1867
+ ], Canvas.prototype, "strokeCap", void 0);
1868
1868
  __decorate([
1869
1869
  contextAttr('lineJoin')
1870
- ], Canvas.prototype, "strokeJoin", undefined);
1870
+ ], Canvas.prototype, "strokeJoin", void 0);
1871
1871
  __decorate([
1872
1872
  contextAttr('lineDashOffset')
1873
- ], Canvas.prototype, "dashOffset", undefined);
1873
+ ], Canvas.prototype, "dashOffset", void 0);
1874
1874
  __decorate([
1875
1875
  contextAttr()
1876
- ], Canvas.prototype, "miterLimit", undefined);
1876
+ ], Canvas.prototype, "miterLimit", void 0);
1877
1877
  __decorate([
1878
1878
  contextAttr()
1879
- ], Canvas.prototype, "shadowBlur", undefined);
1879
+ ], Canvas.prototype, "shadowBlur", void 0);
1880
1880
  __decorate([
1881
1881
  contextAttr()
1882
- ], Canvas.prototype, "shadowColor", undefined);
1882
+ ], Canvas.prototype, "shadowColor", void 0);
1883
1883
  __decorate([
1884
1884
  contextAttr()
1885
- ], Canvas.prototype, "shadowOffsetX", undefined);
1885
+ ], Canvas.prototype, "shadowOffsetX", void 0);
1886
1886
  __decorate([
1887
1887
  contextAttr()
1888
- ], Canvas.prototype, "shadowOffsetY", undefined);
1888
+ ], Canvas.prototype, "shadowOffsetY", void 0);
1889
1889
  __decorate([
1890
1890
  contextAttr()
1891
- ], Canvas.prototype, "filter", undefined);
1891
+ ], Canvas.prototype, "filter", void 0);
1892
1892
  __decorate([
1893
1893
  contextAttr()
1894
- ], Canvas.prototype, "font", undefined);
1894
+ ], Canvas.prototype, "font", void 0);
1895
1895
  __decorate([
1896
1896
  contextAttr()
1897
- ], Canvas.prototype, "fontKerning", undefined);
1897
+ ], Canvas.prototype, "fontKerning", void 0);
1898
1898
  __decorate([
1899
1899
  contextAttr()
1900
- ], Canvas.prototype, "fontStretch", undefined);
1900
+ ], Canvas.prototype, "fontStretch", void 0);
1901
1901
  __decorate([
1902
1902
  contextAttr()
1903
- ], Canvas.prototype, "fontVariantCaps", undefined);
1903
+ ], Canvas.prototype, "fontVariantCaps", void 0);
1904
1904
  __decorate([
1905
1905
  contextAttr()
1906
- ], Canvas.prototype, "textAlign", undefined);
1906
+ ], Canvas.prototype, "textAlign", void 0);
1907
1907
  __decorate([
1908
1908
  contextAttr()
1909
- ], Canvas.prototype, "textBaseline", undefined);
1909
+ ], Canvas.prototype, "textBaseline", void 0);
1910
1910
  __decorate([
1911
1911
  contextAttr()
1912
- ], Canvas.prototype, "textRendering", undefined);
1912
+ ], Canvas.prototype, "textRendering", void 0);
1913
1913
  __decorate([
1914
1914
  contextAttr()
1915
- ], Canvas.prototype, "wordSpacing", undefined);
1915
+ ], Canvas.prototype, "wordSpacing", void 0);
1916
1916
  __decorate([
1917
1917
  contextAttr()
1918
- ], Canvas.prototype, "letterSpacing", undefined);
1918
+ ], Canvas.prototype, "letterSpacing", void 0);
1919
1919
  __decorate([
1920
1920
  contextAttr()
1921
- ], Canvas.prototype, "direction", undefined);
1921
+ ], Canvas.prototype, "direction", void 0);
1922
1922
  __decorate([
1923
1923
  contextMethod()
1924
1924
  ], Canvas.prototype, "setTransform", null);
@@ -2615,7 +2615,7 @@ var LeaferUI = (function (exports) {
2615
2615
  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;
2616
2616
  const { rect: rect$2, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1 } = BezierHelper;
2617
2617
  const { ellipticalArc } = EllipseHelper;
2618
- const debug$a = Debug.get('PathConvert');
2618
+ const debug$b = Debug.get('PathConvert');
2619
2619
  const setEndPoint$1 = {};
2620
2620
  const PathConvert = {
2621
2621
  current: { dot: 0 },
@@ -2856,7 +2856,7 @@ var LeaferUI = (function (exports) {
2856
2856
  i += 6;
2857
2857
  break;
2858
2858
  default:
2859
- debug$a.error(`command: ${command} [index:${i}]`, old);
2859
+ debug$b.error(`command: ${command} [index:${i}]`, old);
2860
2860
  return data;
2861
2861
  }
2862
2862
  lastCommand = command;
@@ -2965,12 +2965,10 @@ var LeaferUI = (function (exports) {
2965
2965
  },
2966
2966
  arcTo(data, x1, y1, x2, y2, radius, lastX, lastY) {
2967
2967
  if (lastX !== undefined) {
2968
- const maxRadius = tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2) * (getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2) / 2);
2969
- data.push(U$2, x1, y1, x2, y2, min(radius, abs$2(maxRadius)));
2970
- }
2971
- else {
2972
- data.push(U$2, x1, y1, x2, y2, radius);
2968
+ const d = getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2);
2969
+ radius = min(radius, min(d / 2, d / 2 * abs$2(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
2973
2970
  }
2971
+ data.push(U$2, x1, y1, x2, y2, radius);
2974
2972
  },
2975
2973
  drawEllipse(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
2976
2974
  BezierHelper.ellipse(null, x, y, radiusX, radiusY, rotation === undefined ? 0 : rotation, startAngle === undefined ? 0 : startAngle, endAngle === undefined ? 360 : endAngle, anticlockwise, null, null, startPoint);
@@ -3081,7 +3079,7 @@ var LeaferUI = (function (exports) {
3081
3079
  }
3082
3080
 
3083
3081
  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;
3084
- const debug$9 = Debug.get('PathDrawer');
3082
+ const debug$a = Debug.get('PathDrawer');
3085
3083
  const PathDrawer = {
3086
3084
  drawPathByData(drawer, data) {
3087
3085
  if (!data)
@@ -3144,7 +3142,7 @@ var LeaferUI = (function (exports) {
3144
3142
  i += 6;
3145
3143
  break;
3146
3144
  default:
3147
- debug$9.error(`command: ${command} [index:${i}]`, data);
3145
+ debug$a.error(`command: ${command} [index:${i}]`, data);
3148
3146
  return;
3149
3147
  }
3150
3148
  }
@@ -3154,7 +3152,7 @@ var LeaferUI = (function (exports) {
3154
3152
  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;
3155
3153
  const { toTwoPointBounds, toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc, ellipse: ellipse$1 } = BezierHelper;
3156
3154
  const { addPointBounds, copy: copy$7, addPoint, setPoint, addBounds, toBounds: toBounds$2 } = TwoPointBoundsHelper;
3157
- const debug$8 = Debug.get('PathBounds');
3155
+ const debug$9 = Debug.get('PathBounds');
3158
3156
  let radius, radiusX, radiusY;
3159
3157
  const tempPointBounds = {};
3160
3158
  const setPointBounds = {};
@@ -3262,7 +3260,7 @@ var LeaferUI = (function (exports) {
3262
3260
  i += 6;
3263
3261
  break;
3264
3262
  default:
3265
- debug$8.error(`command: ${command} [index:${i}]`, data);
3263
+ debug$9.error(`command: ${command} [index:${i}]`, data);
3266
3264
  return;
3267
3265
  }
3268
3266
  }
@@ -3378,7 +3376,7 @@ var LeaferUI = (function (exports) {
3378
3376
  const F = FileHelper;
3379
3377
  F.opacityTypes.forEach(type => F.upperCaseTypeMap[type] = type.toUpperCase());
3380
3378
 
3381
- const debug$7 = Debug.get('TaskProcessor');
3379
+ const debug$8 = Debug.get('TaskProcessor');
3382
3380
  class TaskItem {
3383
3381
  constructor(task) {
3384
3382
  this.parallel = true;
@@ -3387,13 +3385,13 @@ var LeaferUI = (function (exports) {
3387
3385
  this.task = task;
3388
3386
  }
3389
3387
  run() {
3390
- return __awaiter(this, undefined, undefined, function* () {
3388
+ return __awaiter(this, void 0, void 0, function* () {
3391
3389
  try {
3392
3390
  if (this.task && !this.isComplete && this.parent.running)
3393
3391
  yield this.task();
3394
3392
  }
3395
3393
  catch (error) {
3396
- debug$7.error(error);
3394
+ debug$8.error(error);
3397
3395
  }
3398
3396
  });
3399
3397
  }
@@ -3626,18 +3624,52 @@ var LeaferUI = (function (exports) {
3626
3624
  }
3627
3625
  }
3628
3626
 
3629
- const ImageManager = {
3627
+ const debug$7 = Debug.get('Resource');
3628
+ const Resource = {
3629
+ tasker: new TaskProcessor(),
3630
3630
  map: {},
3631
+ get isComplete() { return R.tasker.isComplete; },
3632
+ set(key, value) {
3633
+ if (R.map[key])
3634
+ debug$7.repeat(key);
3635
+ R.map[key] = value;
3636
+ },
3637
+ get(key) {
3638
+ return R.map[key];
3639
+ },
3640
+ remove(key) {
3641
+ delete R.map[key];
3642
+ },
3643
+ loadImage(key, format) {
3644
+ return new Promise((resolve, reject) => {
3645
+ const image = this.setImage(key, key, format);
3646
+ image.load(() => resolve(image), (e) => reject(e));
3647
+ });
3648
+ },
3649
+ setImage(key, value, format) {
3650
+ let config;
3651
+ if (typeof value === 'string')
3652
+ config = { url: value };
3653
+ else if (!value.url)
3654
+ config = { url: key, view: value };
3655
+ if (config)
3656
+ format && (config.format = format), value = Creator.image(config);
3657
+ R.set(key, value);
3658
+ return value;
3659
+ },
3660
+ destroy() {
3661
+ R.map = {};
3662
+ }
3663
+ };
3664
+ const R = Resource;
3665
+
3666
+ const ImageManager = {
3631
3667
  recycledList: [],
3632
- tasker: new TaskProcessor(),
3633
3668
  patternTasker: new TaskProcessor(),
3634
- get isComplete() { return I.tasker.isComplete; },
3635
3669
  get(config) {
3636
- let image = I.map[config.url];
3637
- if (!image) {
3638
- image = Creator.image(config);
3639
- I.map[config.url] = image;
3640
- }
3670
+ let image = Resource.get(config.url);
3671
+ if (!image)
3672
+ Resource.set(config.url, image = Creator.image(config));
3641
3673
  image.use++;
3642
3674
  return image;
3643
3675
  },
@@ -3651,7 +3683,7 @@ var LeaferUI = (function (exports) {
3651
3683
  if (list.length > 100) {
3652
3684
  list.forEach(image => {
3653
3685
  if (!image.use && image.url) {
3654
- delete I.map[image.url];
3686
+ Resource.remove(image.url);
3655
3687
  image.destroy();
3656
3688
  }
3657
3689
  });
@@ -3678,7 +3710,6 @@ var LeaferUI = (function (exports) {
3678
3710
  return false;
3679
3711
  },
3680
3712
  destroy() {
3681
- I.map = {};
3682
3713
  I.recycledList = [];
3683
3714
  }
3684
3715
  };
@@ -3692,21 +3723,19 @@ var LeaferUI = (function (exports) {
3692
3723
  this.use = 0;
3693
3724
  this.waitComplete = [];
3694
3725
  this.innerId = create$1(IMAGE);
3695
- this.config = config || { url: '' };
3696
- this.isSVG = ImageManager.isFormat('svg', config);
3697
- this.hasOpacityPixel = ImageManager.hasOpacityPixel(config);
3726
+ this.config = config || (config = { url: '' });
3727
+ if (config.view) {
3728
+ const { view } = config;
3729
+ this.setView(view.config ? view.view : view);
3730
+ }
3731
+ ImageManager.isFormat('svg', config) && (this.isSVG = true);
3732
+ ImageManager.hasOpacityPixel(config) && (this.hasOpacityPixel = true);
3698
3733
  }
3699
3734
  load(onSuccess, onError) {
3700
3735
  if (!this.loading) {
3701
3736
  this.loading = true;
3702
- ImageManager.tasker.add(() => __awaiter(this, undefined, undefined, function* () {
3703
- return yield Platform.origin.loadImage(this.url).then((img) => {
3704
- this.ready = true;
3705
- this.width = img.naturalWidth || img.width;
3706
- this.height = img.naturalHeight || img.height;
3707
- this.view = img;
3708
- this.onComplete(true);
3709
- }).catch((e) => {
3737
+ Resource.tasker.add(() => __awaiter(this, void 0, void 0, function* () {
3738
+ return yield Platform.origin.loadImage(this.url).then(img => this.setView(img)).catch((e) => {
3710
3739
  this.error = e;
3711
3740
  this.onComplete(false);
3712
3741
  });
@@ -3724,6 +3753,13 @@ var LeaferUI = (function (exports) {
3724
3753
  }
3725
3754
  l[index] = l[index + 1] = undefined;
3726
3755
  }
3756
+ setView(img) {
3757
+ this.ready = true;
3758
+ this.width = img.naturalWidth || img.width;
3759
+ this.height = img.naturalHeight || img.height;
3760
+ this.view = img;
3761
+ this.onComplete(true);
3762
+ }
3727
3763
  onComplete(isSuccess) {
3728
3764
  let odd;
3729
3765
  this.waitComplete.forEach((item, index) => {
@@ -3742,6 +3778,9 @@ var LeaferUI = (function (exports) {
3742
3778
  this.waitComplete.length = 0;
3743
3779
  this.loading = false;
3744
3780
  }
3781
+ getFull(_filters) {
3782
+ return this.view;
3783
+ }
3745
3784
  getCanvas(width, height, opacity, _filters) {
3746
3785
  width || (width = this.width);
3747
3786
  height || (height = this.height);
@@ -3824,10 +3863,10 @@ var LeaferUI = (function (exports) {
3824
3863
  return decorateLeafAttr(defaultValue, (key) => attr({
3825
3864
  set(value) {
3826
3865
  if (this.__setAttr(key, value)) {
3827
- this.__layout.matrixChanged || this.__layout.matrixChange();
3828
3866
  this.__hasAutoLayout = !!(this.origin || this.around || this.flow);
3829
3867
  if (!this.__local)
3830
3868
  this.__layout.createLocal();
3869
+ doBoundsType(this);
3831
3870
  }
3832
3871
  }
3833
3872
  }));
@@ -4210,55 +4249,62 @@ var LeaferUI = (function (exports) {
4210
4249
  y += t.y;
4211
4250
  transition ? t.animate({ x, y }, transition) : (t.x = x, t.y = y);
4212
4251
  },
4213
- zoomOfWorld(t, origin, scaleX, scaleY, resize) {
4214
- L.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize);
4252
+ zoomOfWorld(t, origin, scaleX, scaleY, resize, transition) {
4253
+ L.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize, transition);
4215
4254
  },
4216
- zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize) {
4217
- copy$6(matrix, t.__localMatrix);
4255
+ zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize, transition) {
4256
+ const o = t.__localMatrix;
4257
+ if (typeof scaleY !== 'number') {
4258
+ if (scaleY)
4259
+ transition = scaleY;
4260
+ scaleY = scaleX;
4261
+ }
4262
+ copy$6(matrix, o);
4218
4263
  scaleOfOuter$2(matrix, origin, scaleX, scaleY);
4219
4264
  if (t.origin || t.around) {
4220
- L.setTransform(t, matrix, resize);
4265
+ L.setTransform(t, matrix, resize, transition);
4221
4266
  }
4222
4267
  else {
4223
- moveByMatrix(t, matrix);
4224
- t.scaleResize(scaleX, scaleY, resize !== true);
4268
+ const x = t.x + matrix.e - o.e, y = t.y + matrix.f - o.f;
4269
+ if (transition && !resize)
4270
+ t.animate({ x, y, scaleX: t.scaleX * scaleX, scaleY: t.scaleY * scaleY }, transition);
4271
+ else
4272
+ t.x = x, t.y = y, t.scaleResize(scaleX, scaleY, resize !== true);
4225
4273
  }
4226
4274
  },
4227
- rotateOfWorld(t, origin, angle) {
4228
- L.rotateOfLocal(t, getTempLocal(t, origin), angle);
4275
+ rotateOfWorld(t, origin, angle, transition) {
4276
+ L.rotateOfLocal(t, getTempLocal(t, origin), angle, transition);
4229
4277
  },
4230
- rotateOfLocal(t, origin, angle) {
4231
- copy$6(matrix, t.__localMatrix);
4278
+ rotateOfLocal(t, origin, angle, transition) {
4279
+ const o = t.__localMatrix;
4280
+ copy$6(matrix, o);
4232
4281
  rotateOfOuter$2(matrix, origin, angle);
4233
- if (t.origin || t.around) {
4234
- L.setTransform(t, matrix);
4235
- }
4236
- else {
4237
- moveByMatrix(t, matrix);
4238
- t.rotation = MathHelper.formatRotation(t.rotation + angle);
4239
- }
4282
+ if (t.origin || t.around)
4283
+ L.setTransform(t, matrix, false, transition);
4284
+ else
4285
+ t.set({ x: t.x + matrix.e - o.e, y: t.y + matrix.f - o.f, rotation: MathHelper.formatRotation(t.rotation + angle) }, transition);
4240
4286
  },
4241
- skewOfWorld(t, origin, skewX, skewY, resize) {
4242
- L.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize);
4287
+ skewOfWorld(t, origin, skewX, skewY, resize, transition) {
4288
+ L.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize, transition);
4243
4289
  },
4244
- skewOfLocal(t, origin, skewX, skewY = 0, resize) {
4290
+ skewOfLocal(t, origin, skewX, skewY = 0, resize, transition) {
4245
4291
  copy$6(matrix, t.__localMatrix);
4246
4292
  skewOfOuter(matrix, origin, skewX, skewY);
4247
- L.setTransform(t, matrix, resize);
4293
+ L.setTransform(t, matrix, resize, transition);
4248
4294
  },
4249
- transformWorld(t, transform, resize) {
4295
+ transformWorld(t, transform, resize, transition) {
4250
4296
  copy$6(matrix, t.worldTransform);
4251
4297
  multiplyParent$2(matrix, transform);
4252
4298
  if (t.parent)
4253
4299
  divideParent(matrix, t.parent.worldTransform);
4254
- L.setTransform(t, matrix, resize);
4300
+ L.setTransform(t, matrix, resize, transition);
4255
4301
  },
4256
- transform(t, transform, resize) {
4302
+ transform(t, transform, resize, transition) {
4257
4303
  copy$6(matrix, t.localTransform);
4258
4304
  multiplyParent$2(matrix, transform);
4259
- L.setTransform(t, matrix, resize);
4305
+ L.setTransform(t, matrix, resize, transition);
4260
4306
  },
4261
- setTransform(t, transform, resize) {
4307
+ setTransform(t, transform, resize, transition) {
4262
4308
  const data = t.__, originPoint = data.origin && L.getInnerOrigin(t, data.origin);
4263
4309
  const layout = getLayout(transform, originPoint, data.around && L.getInnerOrigin(t, data.around));
4264
4310
  if (resize) {
@@ -4273,7 +4319,7 @@ var LeaferUI = (function (exports) {
4273
4319
  t.scaleResize(scaleX, scaleY, false);
4274
4320
  }
4275
4321
  else
4276
- t.set(layout);
4322
+ t.set(layout, transition);
4277
4323
  },
4278
4324
  getFlipTransform(t, axis) {
4279
4325
  const m = getMatrixData();
@@ -4310,11 +4356,6 @@ var LeaferUI = (function (exports) {
4310
4356
  };
4311
4357
  const L = LeafHelper;
4312
4358
  const { updateAllMatrix: updateAllMatrix$3, updateMatrix: updateMatrix$2, updateAllWorldOpacity: updateAllWorldOpacity$1, updateAllChange: updateAllChange$1 } = L;
4313
- function moveByMatrix(t, matrix) {
4314
- const { e, f } = t.__localMatrix;
4315
- t.x += matrix.e - e;
4316
- t.y += matrix.f - f;
4317
- }
4318
4359
  function getTempLocal(t, world) {
4319
4360
  t.__layout.update();
4320
4361
  return t.parent ? PointHelper.tempToInnerOf(world, t.parent.__world) : world;
@@ -5220,7 +5261,7 @@ var LeaferUI = (function (exports) {
5220
5261
  if (this.__.eraser === 'path')
5221
5262
  return this.__renderEraser(canvas, options);
5222
5263
  const tempCanvas = canvas.getSameCanvas(true, true);
5223
- this.__draw(tempCanvas, options);
5264
+ this.__draw(tempCanvas, options, canvas);
5224
5265
  if (this.__worldFlipped) {
5225
5266
  canvas.copyWorldByReset(tempCanvas, this.__nowWorld, null, this.__.__blendMode, true);
5226
5267
  }
@@ -5588,11 +5629,11 @@ var LeaferUI = (function (exports) {
5588
5629
  const layer = this.leafer ? this.leafer.zoomLayer : this;
5589
5630
  return layer.getWorldPoint(page, relative, distance, change);
5590
5631
  }
5591
- setTransform(matrix, resize) {
5592
- setTransform(this, matrix, resize);
5632
+ setTransform(matrix, resize, transition) {
5633
+ setTransform(this, matrix, resize, transition);
5593
5634
  }
5594
- transform(matrix, resize) {
5595
- transform(this, matrix, resize);
5635
+ transform(matrix, resize, transition) {
5636
+ transform(this, matrix, resize, transition);
5596
5637
  }
5597
5638
  move(x, y, transition) {
5598
5639
  moveLocal(this, x, y, transition);
@@ -5600,32 +5641,32 @@ var LeaferUI = (function (exports) {
5600
5641
  moveInner(x, y, transition) {
5601
5642
  moveWorld(this, x, y, true, transition);
5602
5643
  }
5603
- scaleOf(origin, scaleX, scaleY, resize) {
5604
- zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize);
5644
+ scaleOf(origin, scaleX, scaleY, resize, transition) {
5645
+ zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize, transition);
5605
5646
  }
5606
- rotateOf(origin, rotation) {
5607
- rotateOfLocal(this, getLocalOrigin(this, origin), rotation);
5647
+ rotateOf(origin, rotation, transition) {
5648
+ rotateOfLocal(this, getLocalOrigin(this, origin), rotation, transition);
5608
5649
  }
5609
- skewOf(origin, skewX, skewY, resize) {
5610
- skewOfLocal(this, getLocalOrigin(this, origin), skewX, skewY, resize);
5650
+ skewOf(origin, skewX, skewY, resize, transition) {
5651
+ skewOfLocal(this, getLocalOrigin(this, origin), skewX, skewY, resize, transition);
5611
5652
  }
5612
- transformWorld(worldTransform, resize) {
5613
- transformWorld(this, worldTransform, resize);
5653
+ transformWorld(worldTransform, resize, transition) {
5654
+ transformWorld(this, worldTransform, resize, transition);
5614
5655
  }
5615
5656
  moveWorld(x, y, transition) {
5616
5657
  moveWorld(this, x, y, false, transition);
5617
5658
  }
5618
- scaleOfWorld(worldOrigin, scaleX, scaleY, resize) {
5619
- zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize);
5659
+ scaleOfWorld(worldOrigin, scaleX, scaleY, resize, transition) {
5660
+ zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize, transition);
5620
5661
  }
5621
5662
  rotateOfWorld(worldOrigin, rotation) {
5622
5663
  rotateOfWorld(this, worldOrigin, rotation);
5623
5664
  }
5624
- skewOfWorld(worldOrigin, skewX, skewY, resize) {
5625
- skewOfWorld(this, worldOrigin, skewX, skewY, resize);
5665
+ skewOfWorld(worldOrigin, skewX, skewY, resize, transition) {
5666
+ skewOfWorld(this, worldOrigin, skewX, skewY, resize, transition);
5626
5667
  }
5627
- flip(axis) {
5628
- transform(this, getFlipTransform(this, axis));
5668
+ flip(axis, transition) {
5669
+ transform(this, getFlipTransform(this, axis), false, transition);
5629
5670
  }
5630
5671
  scaleResize(scaleX, scaleY = scaleX, _noResize) {
5631
5672
  this.scaleX *= scaleX;
@@ -6013,7 +6054,7 @@ var LeaferUI = (function (exports) {
6013
6054
  }
6014
6055
  }
6015
6056
 
6016
- const version = "1.3.3";
6057
+ const version = "1.4.1";
6017
6058
 
6018
6059
  class LeaferCanvas extends LeaferCanvasBase {
6019
6060
  get allowBackgroundColor() { return true; }
@@ -6358,7 +6399,7 @@ var LeaferUI = (function (exports) {
6358
6399
  }
6359
6400
  partLayout() {
6360
6401
  var _a;
6361
- if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
6402
+ if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
6362
6403
  return;
6363
6404
  const t = Run.start('PartLayout');
6364
6405
  const { target, __updatedList: updateList } = this;
@@ -6727,9 +6768,7 @@ var LeaferUI = (function (exports) {
6727
6768
  const ColorConvert = {};
6728
6769
  const UnitConvert = {
6729
6770
  number(value, percentRefer) {
6730
- if (typeof value === 'object')
6731
- return value.type === 'percent' ? value.value * percentRefer : value.value;
6732
- return value;
6771
+ return typeof value === 'object' ? (value.type === 'percent' ? value.value * percentRefer : value.value) : value;
6733
6772
  }
6734
6773
  };
6735
6774
  const PathArrow = {};
@@ -6737,16 +6776,15 @@ var LeaferUI = (function (exports) {
6737
6776
  const PaintImage = {};
6738
6777
  const PaintGradient = {};
6739
6778
  const Effect = {};
6779
+ const Filter = {
6780
+ apply() { Plugin.need('filter'); }
6781
+ };
6740
6782
  const Export = {};
6741
6783
  const State = {
6742
- setStyleName(_leaf, _styleName, _value) { return Plugin.need('state'); },
6743
- set(_leaf, _stateName) { return Plugin.need('state'); }
6744
- };
6745
- const Transition = {
6746
- list: {},
6747
- register(attrName, fn) { Transition.list[attrName] = fn; },
6748
- get(attrName) { return Transition.list[attrName]; }
6784
+ setStyleName() { return Plugin.need('state'); },
6785
+ set() { return Plugin.need('state'); }
6749
6786
  };
6787
+ const Transition = {};
6750
6788
 
6751
6789
  const { parse, objectToCanvasData } = PathConvert;
6752
6790
  const emptyPaint = {};
@@ -6853,24 +6891,13 @@ var LeaferUI = (function (exports) {
6853
6891
  }
6854
6892
  }
6855
6893
  setShadow(value) {
6856
- this.__setInput('shadow', value);
6857
- if (value instanceof Array) {
6858
- if (value.some((item) => item.visible === false))
6859
- value = value.filter((item) => item.visible !== false);
6860
- this._shadow = value.length ? value : null;
6861
- }
6862
- else
6863
- this._shadow = value && value.visible !== false ? [value] : null;
6894
+ setArray(this, 'shadow', value);
6864
6895
  }
6865
6896
  setInnerShadow(value) {
6866
- this.__setInput('innerShadow', value);
6867
- if (value instanceof Array) {
6868
- if (value.some((item) => item.visible === false))
6869
- value = value.filter((item) => item.visible !== false);
6870
- this._innerShadow = value.length ? value : null;
6871
- }
6872
- else
6873
- this._innerShadow = value && value.visible !== false ? [value] : null;
6897
+ setArray(this, 'innerShadow', value);
6898
+ }
6899
+ setFilter(value) {
6900
+ setArray(this, 'filter', value);
6874
6901
  }
6875
6902
  __computePaint() {
6876
6903
  const { fill, stroke } = this.__input;
@@ -6881,6 +6908,17 @@ var LeaferUI = (function (exports) {
6881
6908
  this.__needComputePaint = false;
6882
6909
  }
6883
6910
  }
6911
+ function setArray(data, key, value) {
6912
+ data.__setInput(key, value);
6913
+ if (value instanceof Array) {
6914
+ if (value.some((item) => item.visible === false))
6915
+ value = value.filter((item) => item.visible !== false);
6916
+ value.length || (value = null);
6917
+ }
6918
+ else
6919
+ value = value && value.visible !== false ? [value] : null;
6920
+ data['_' + key] = value;
6921
+ }
6884
6922
 
6885
6923
  class GroupData extends UIData {
6886
6924
  }
@@ -7003,11 +7041,13 @@ var LeaferUI = (function (exports) {
7003
7041
  },
7004
7042
  __updateRenderSpread() {
7005
7043
  let width = 0;
7006
- const { shadow, innerShadow, blur, backgroundBlur } = this.__;
7044
+ const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
7007
7045
  if (shadow)
7008
7046
  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));
7009
7047
  if (blur)
7010
7048
  width = Math.max(width, blur);
7049
+ if (filter)
7050
+ width += Filter.getSpread(filter);
7011
7051
  let shapeWidth = width = Math.ceil(width);
7012
7052
  if (innerShadow)
7013
7053
  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));
@@ -7022,8 +7062,8 @@ var LeaferUI = (function (exports) {
7022
7062
  __updateChange() {
7023
7063
  const data = this.__;
7024
7064
  if (data.__useEffect) {
7025
- const { shadow, innerShadow, blur, backgroundBlur } = this.__;
7026
- data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur);
7065
+ const { shadow, innerShadow, blur, backgroundBlur, filter } = this.__;
7066
+ data.__useEffect = !!(shadow || innerShadow || blur || backgroundBlur || filter);
7027
7067
  }
7028
7068
  data.__checkSingle();
7029
7069
  const complex = data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect;
@@ -7037,7 +7077,7 @@ var LeaferUI = (function (exports) {
7037
7077
  __drawFast(canvas, options) {
7038
7078
  drawFast(this, canvas, options);
7039
7079
  },
7040
- __draw(canvas, options) {
7080
+ __draw(canvas, options, originCanvas) {
7041
7081
  const data = this.__;
7042
7082
  if (data.__complex) {
7043
7083
  if (data.__needComputePaint)
@@ -7047,7 +7087,7 @@ var LeaferUI = (function (exports) {
7047
7087
  if (data.__useEffect) {
7048
7088
  const shape = Paint.shape(this, canvas, options);
7049
7089
  this.__nowWorld = this.__getNowWorld(options);
7050
- const { shadow, innerShadow } = data;
7090
+ const { shadow, innerShadow, filter } = data;
7051
7091
  if (shadow)
7052
7092
  Effect.shadow(this, canvas, shape);
7053
7093
  if (fill)
@@ -7058,6 +7098,8 @@ var LeaferUI = (function (exports) {
7058
7098
  Effect.innerShadow(this, canvas, shape);
7059
7099
  if (stroke)
7060
7100
  data.__isStrokes ? Paint.strokes(stroke, this, canvas) : Paint.stroke(stroke, this, canvas);
7101
+ if (filter)
7102
+ Filter.apply(filter, this, this.__nowWorld, canvas, originCanvas, shape);
7061
7103
  if (shape.worldCanvas)
7062
7104
  shape.worldCanvas.recycle();
7063
7105
  shape.canvas.recycle();
@@ -7277,199 +7319,202 @@ var LeaferUI = (function (exports) {
7277
7319
  };
7278
7320
  __decorate([
7279
7321
  dataProcessor(UIData)
7280
- ], exports.UI.prototype, "__", undefined);
7322
+ ], exports.UI.prototype, "__", void 0);
7281
7323
  __decorate([
7282
7324
  zoomLayerType()
7283
- ], exports.UI.prototype, "zoomLayer", undefined);
7325
+ ], exports.UI.prototype, "zoomLayer", void 0);
7284
7326
  __decorate([
7285
7327
  dataType('')
7286
- ], exports.UI.prototype, "id", undefined);
7328
+ ], exports.UI.prototype, "id", void 0);
7287
7329
  __decorate([
7288
7330
  dataType('')
7289
- ], exports.UI.prototype, "name", undefined);
7331
+ ], exports.UI.prototype, "name", void 0);
7290
7332
  __decorate([
7291
7333
  dataType('')
7292
- ], exports.UI.prototype, "className", undefined);
7334
+ ], exports.UI.prototype, "className", void 0);
7293
7335
  __decorate([
7294
7336
  surfaceType('pass-through')
7295
- ], exports.UI.prototype, "blendMode", undefined);
7337
+ ], exports.UI.prototype, "blendMode", void 0);
7296
7338
  __decorate([
7297
7339
  opacityType(1)
7298
- ], exports.UI.prototype, "opacity", undefined);
7340
+ ], exports.UI.prototype, "opacity", void 0);
7299
7341
  __decorate([
7300
7342
  visibleType(true)
7301
- ], exports.UI.prototype, "visible", undefined);
7343
+ ], exports.UI.prototype, "visible", void 0);
7302
7344
  __decorate([
7303
7345
  surfaceType(false)
7304
- ], exports.UI.prototype, "locked", undefined);
7346
+ ], exports.UI.prototype, "locked", void 0);
7305
7347
  __decorate([
7306
7348
  sortType(0)
7307
- ], exports.UI.prototype, "zIndex", undefined);
7349
+ ], exports.UI.prototype, "zIndex", void 0);
7308
7350
  __decorate([
7309
7351
  maskType(false)
7310
- ], exports.UI.prototype, "mask", undefined);
7352
+ ], exports.UI.prototype, "mask", void 0);
7311
7353
  __decorate([
7312
7354
  eraserType(false)
7313
- ], exports.UI.prototype, "eraser", undefined);
7355
+ ], exports.UI.prototype, "eraser", void 0);
7314
7356
  __decorate([
7315
7357
  positionType(0, true)
7316
- ], exports.UI.prototype, "x", undefined);
7358
+ ], exports.UI.prototype, "x", void 0);
7317
7359
  __decorate([
7318
7360
  positionType(0, true)
7319
- ], exports.UI.prototype, "y", undefined);
7361
+ ], exports.UI.prototype, "y", void 0);
7320
7362
  __decorate([
7321
7363
  boundsType(100, true)
7322
- ], exports.UI.prototype, "width", undefined);
7364
+ ], exports.UI.prototype, "width", void 0);
7323
7365
  __decorate([
7324
7366
  boundsType(100, true)
7325
- ], exports.UI.prototype, "height", undefined);
7367
+ ], exports.UI.prototype, "height", void 0);
7326
7368
  __decorate([
7327
7369
  scaleType(1, true)
7328
- ], exports.UI.prototype, "scaleX", undefined);
7370
+ ], exports.UI.prototype, "scaleX", void 0);
7329
7371
  __decorate([
7330
7372
  scaleType(1, true)
7331
- ], exports.UI.prototype, "scaleY", undefined);
7373
+ ], exports.UI.prototype, "scaleY", void 0);
7332
7374
  __decorate([
7333
7375
  rotationType(0, true)
7334
- ], exports.UI.prototype, "rotation", undefined);
7376
+ ], exports.UI.prototype, "rotation", void 0);
7335
7377
  __decorate([
7336
7378
  rotationType(0, true)
7337
- ], exports.UI.prototype, "skewX", undefined);
7379
+ ], exports.UI.prototype, "skewX", void 0);
7338
7380
  __decorate([
7339
7381
  rotationType(0, true)
7340
- ], exports.UI.prototype, "skewY", undefined);
7382
+ ], exports.UI.prototype, "skewY", void 0);
7341
7383
  __decorate([
7342
7384
  positionType(0, true)
7343
- ], exports.UI.prototype, "offsetX", undefined);
7385
+ ], exports.UI.prototype, "offsetX", void 0);
7344
7386
  __decorate([
7345
7387
  positionType(0, true)
7346
- ], exports.UI.prototype, "offsetY", undefined);
7388
+ ], exports.UI.prototype, "offsetY", void 0);
7347
7389
  __decorate([
7348
7390
  positionType(0, true)
7349
- ], exports.UI.prototype, "scrollX", undefined);
7391
+ ], exports.UI.prototype, "scrollX", void 0);
7350
7392
  __decorate([
7351
7393
  positionType(0, true)
7352
- ], exports.UI.prototype, "scrollY", undefined);
7394
+ ], exports.UI.prototype, "scrollY", void 0);
7353
7395
  __decorate([
7354
7396
  autoLayoutType()
7355
- ], exports.UI.prototype, "origin", undefined);
7397
+ ], exports.UI.prototype, "origin", void 0);
7356
7398
  __decorate([
7357
7399
  autoLayoutType()
7358
- ], exports.UI.prototype, "around", undefined);
7400
+ ], exports.UI.prototype, "around", void 0);
7359
7401
  __decorate([
7360
7402
  dataType(false)
7361
- ], exports.UI.prototype, "lazy", undefined);
7403
+ ], exports.UI.prototype, "lazy", void 0);
7362
7404
  __decorate([
7363
7405
  naturalBoundsType(1)
7364
- ], exports.UI.prototype, "pixelRatio", undefined);
7406
+ ], exports.UI.prototype, "pixelRatio", void 0);
7365
7407
  __decorate([
7366
7408
  pathInputType()
7367
- ], exports.UI.prototype, "path", undefined);
7409
+ ], exports.UI.prototype, "path", void 0);
7368
7410
  __decorate([
7369
7411
  pathType()
7370
- ], exports.UI.prototype, "windingRule", undefined);
7412
+ ], exports.UI.prototype, "windingRule", void 0);
7371
7413
  __decorate([
7372
7414
  pathType(true)
7373
- ], exports.UI.prototype, "closed", undefined);
7415
+ ], exports.UI.prototype, "closed", void 0);
7374
7416
  __decorate([
7375
7417
  boundsType(0)
7376
- ], exports.UI.prototype, "padding", undefined);
7418
+ ], exports.UI.prototype, "padding", void 0);
7377
7419
  __decorate([
7378
7420
  boundsType(false)
7379
- ], exports.UI.prototype, "lockRatio", undefined);
7421
+ ], exports.UI.prototype, "lockRatio", void 0);
7380
7422
  __decorate([
7381
7423
  boundsType()
7382
- ], exports.UI.prototype, "widthRange", undefined);
7424
+ ], exports.UI.prototype, "widthRange", void 0);
7383
7425
  __decorate([
7384
7426
  boundsType()
7385
- ], exports.UI.prototype, "heightRange", undefined);
7427
+ ], exports.UI.prototype, "heightRange", void 0);
7386
7428
  __decorate([
7387
7429
  dataType(false)
7388
- ], exports.UI.prototype, "draggable", undefined);
7430
+ ], exports.UI.prototype, "draggable", void 0);
7389
7431
  __decorate([
7390
7432
  dataType()
7391
- ], exports.UI.prototype, "dragBounds", undefined);
7433
+ ], exports.UI.prototype, "dragBounds", void 0);
7392
7434
  __decorate([
7393
7435
  dataType(false)
7394
- ], exports.UI.prototype, "editable", undefined);
7436
+ ], exports.UI.prototype, "editable", void 0);
7395
7437
  __decorate([
7396
7438
  hitType(true)
7397
- ], exports.UI.prototype, "hittable", undefined);
7439
+ ], exports.UI.prototype, "hittable", void 0);
7398
7440
  __decorate([
7399
7441
  hitType('path')
7400
- ], exports.UI.prototype, "hitFill", undefined);
7442
+ ], exports.UI.prototype, "hitFill", void 0);
7401
7443
  __decorate([
7402
7444
  strokeType('path')
7403
- ], exports.UI.prototype, "hitStroke", undefined);
7445
+ ], exports.UI.prototype, "hitStroke", void 0);
7404
7446
  __decorate([
7405
7447
  hitType(false)
7406
- ], exports.UI.prototype, "hitBox", undefined);
7448
+ ], exports.UI.prototype, "hitBox", void 0);
7407
7449
  __decorate([
7408
7450
  hitType(true)
7409
- ], exports.UI.prototype, "hitChildren", undefined);
7451
+ ], exports.UI.prototype, "hitChildren", void 0);
7410
7452
  __decorate([
7411
7453
  hitType(true)
7412
- ], exports.UI.prototype, "hitSelf", undefined);
7454
+ ], exports.UI.prototype, "hitSelf", void 0);
7413
7455
  __decorate([
7414
7456
  hitType()
7415
- ], exports.UI.prototype, "hitRadius", undefined);
7457
+ ], exports.UI.prototype, "hitRadius", void 0);
7416
7458
  __decorate([
7417
7459
  cursorType('')
7418
- ], exports.UI.prototype, "cursor", undefined);
7460
+ ], exports.UI.prototype, "cursor", void 0);
7419
7461
  __decorate([
7420
7462
  surfaceType()
7421
- ], exports.UI.prototype, "fill", undefined);
7463
+ ], exports.UI.prototype, "fill", void 0);
7422
7464
  __decorate([
7423
7465
  strokeType()
7424
- ], exports.UI.prototype, "stroke", undefined);
7466
+ ], exports.UI.prototype, "stroke", void 0);
7425
7467
  __decorate([
7426
7468
  strokeType('inside')
7427
- ], exports.UI.prototype, "strokeAlign", undefined);
7469
+ ], exports.UI.prototype, "strokeAlign", void 0);
7428
7470
  __decorate([
7429
7471
  strokeType(1)
7430
- ], exports.UI.prototype, "strokeWidth", undefined);
7472
+ ], exports.UI.prototype, "strokeWidth", void 0);
7431
7473
  __decorate([
7432
7474
  strokeType(false)
7433
- ], exports.UI.prototype, "strokeWidthFixed", undefined);
7475
+ ], exports.UI.prototype, "strokeWidthFixed", void 0);
7434
7476
  __decorate([
7435
7477
  strokeType('none')
7436
- ], exports.UI.prototype, "strokeCap", undefined);
7478
+ ], exports.UI.prototype, "strokeCap", void 0);
7437
7479
  __decorate([
7438
7480
  strokeType('miter')
7439
- ], exports.UI.prototype, "strokeJoin", undefined);
7481
+ ], exports.UI.prototype, "strokeJoin", void 0);
7440
7482
  __decorate([
7441
7483
  strokeType()
7442
- ], exports.UI.prototype, "dashPattern", undefined);
7484
+ ], exports.UI.prototype, "dashPattern", void 0);
7443
7485
  __decorate([
7444
7486
  strokeType()
7445
- ], exports.UI.prototype, "dashOffset", undefined);
7487
+ ], exports.UI.prototype, "dashOffset", void 0);
7446
7488
  __decorate([
7447
7489
  strokeType(10)
7448
- ], exports.UI.prototype, "miterLimit", undefined);
7490
+ ], exports.UI.prototype, "miterLimit", void 0);
7449
7491
  __decorate([
7450
7492
  pathType(0)
7451
- ], exports.UI.prototype, "cornerRadius", undefined);
7493
+ ], exports.UI.prototype, "cornerRadius", void 0);
7452
7494
  __decorate([
7453
7495
  pathType()
7454
- ], exports.UI.prototype, "cornerSmoothing", undefined);
7496
+ ], exports.UI.prototype, "cornerSmoothing", void 0);
7497
+ __decorate([
7498
+ effectType()
7499
+ ], exports.UI.prototype, "shadow", void 0);
7455
7500
  __decorate([
7456
7501
  effectType()
7457
- ], exports.UI.prototype, "shadow", undefined);
7502
+ ], exports.UI.prototype, "innerShadow", void 0);
7458
7503
  __decorate([
7459
7504
  effectType()
7460
- ], exports.UI.prototype, "innerShadow", undefined);
7505
+ ], exports.UI.prototype, "blur", void 0);
7461
7506
  __decorate([
7462
7507
  effectType()
7463
- ], exports.UI.prototype, "blur", undefined);
7508
+ ], exports.UI.prototype, "backgroundBlur", void 0);
7464
7509
  __decorate([
7465
7510
  effectType()
7466
- ], exports.UI.prototype, "backgroundBlur", undefined);
7511
+ ], exports.UI.prototype, "grayscale", void 0);
7467
7512
  __decorate([
7468
7513
  effectType()
7469
- ], exports.UI.prototype, "grayscale", undefined);
7514
+ ], exports.UI.prototype, "filter", void 0);
7470
7515
  __decorate([
7471
7516
  dataType({})
7472
- ], exports.UI.prototype, "data", undefined);
7517
+ ], exports.UI.prototype, "data", void 0);
7473
7518
  __decorate([
7474
7519
  rewrite(exports.Leaf.prototype.reset)
7475
7520
  ], exports.UI.prototype, "reset", null);
@@ -7530,7 +7575,7 @@ var LeaferUI = (function (exports) {
7530
7575
  };
7531
7576
  __decorate([
7532
7577
  dataProcessor(GroupData)
7533
- ], exports.Group.prototype, "__", undefined);
7578
+ ], exports.Group.prototype, "__", void 0);
7534
7579
  exports.Group = __decorate([
7535
7580
  useModule(exports.Branch),
7536
7581
  registerUI()
@@ -7543,7 +7588,7 @@ var LeaferUI = (function (exports) {
7543
7588
  get isApp() { return false; }
7544
7589
  get app() { return this.parent || this; }
7545
7590
  get isLeafer() { return true; }
7546
- get imageReady() { return this.viewReady && ImageManager.isComplete; }
7591
+ get imageReady() { return this.viewReady && Resource.isComplete; }
7547
7592
  get layoutLocked() { return !this.layouter.running; }
7548
7593
  get FPS() { return this.renderer ? this.renderer.FPS : 60; }
7549
7594
  get cursorPoint() { return (this.interaction && this.interaction.hoverData) || { x: this.width / 2, y: this.height / 2 }; }
@@ -7754,13 +7799,13 @@ var LeaferUI = (function (exports) {
7754
7799
  WaitHelper.run(this.__viewReadyWait);
7755
7800
  }
7756
7801
  __onLayoutEnd() {
7757
- const { grow, growWidth, growHeight } = this.config;
7802
+ const { grow, width: fixedWidth, height: fixedHeight } = this.config;
7758
7803
  if (grow) {
7759
7804
  let { width, height, pixelRatio } = this;
7760
7805
  const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
7761
- if (growWidth !== false)
7806
+ if (!fixedWidth)
7762
7807
  width = Math.max(1, bounds.x + bounds.width);
7763
- if (growHeight !== false)
7808
+ if (!fixedHeight)
7764
7809
  height = Math.max(1, bounds.y + bounds.height);
7765
7810
  this.__doResize({ width, height, pixelRatio });
7766
7811
  }
@@ -7838,7 +7883,7 @@ var LeaferUI = (function (exports) {
7838
7883
  list.push(item);
7839
7884
  this.requestRender();
7840
7885
  }
7841
- zoom(_zoomType, _padding, _fixedScale) {
7886
+ zoom(_zoomType, _padding, _fixedScale, _transition) {
7842
7887
  return Plugin.need('view');
7843
7888
  }
7844
7889
  getValidMove(moveX, moveY) { return { x: moveX, y: moveY }; }
@@ -7903,10 +7948,10 @@ var LeaferUI = (function (exports) {
7903
7948
  exports.Leafer.list = new LeafList();
7904
7949
  __decorate([
7905
7950
  dataProcessor(LeaferData)
7906
- ], exports.Leafer.prototype, "__", undefined);
7951
+ ], exports.Leafer.prototype, "__", void 0);
7907
7952
  __decorate([
7908
7953
  boundsType()
7909
- ], exports.Leafer.prototype, "pixelRatio", undefined);
7954
+ ], exports.Leafer.prototype, "pixelRatio", void 0);
7910
7955
  exports.Leafer = Leafer_1 = __decorate([
7911
7956
  registerUI()
7912
7957
  ], exports.Leafer);
@@ -7919,7 +7964,7 @@ var LeaferUI = (function (exports) {
7919
7964
  };
7920
7965
  __decorate([
7921
7966
  dataProcessor(RectData)
7922
- ], exports.Rect.prototype, "__", undefined);
7967
+ ], exports.Rect.prototype, "__", void 0);
7923
7968
  exports.Rect = __decorate([
7924
7969
  useModule(RectRender),
7925
7970
  rewriteAble(),
@@ -8010,13 +8055,13 @@ var LeaferUI = (function (exports) {
8010
8055
  };
8011
8056
  __decorate([
8012
8057
  dataProcessor(BoxData)
8013
- ], exports.Box.prototype, "__", undefined);
8058
+ ], exports.Box.prototype, "__", void 0);
8014
8059
  __decorate([
8015
8060
  dataType(false)
8016
- ], exports.Box.prototype, "resizeChildren", undefined);
8061
+ ], exports.Box.prototype, "resizeChildren", void 0);
8017
8062
  __decorate([
8018
8063
  affectRenderBoundsType('show')
8019
- ], exports.Box.prototype, "overflow", undefined);
8064
+ ], exports.Box.prototype, "overflow", void 0);
8020
8065
  __decorate([
8021
8066
  rewrite(rect.__updateStrokeSpread)
8022
8067
  ], exports.Box.prototype, "__updateStrokeSpread", null);
@@ -8055,13 +8100,13 @@ var LeaferUI = (function (exports) {
8055
8100
  };
8056
8101
  __decorate([
8057
8102
  dataProcessor(FrameData)
8058
- ], exports.Frame.prototype, "__", undefined);
8103
+ ], exports.Frame.prototype, "__", void 0);
8059
8104
  __decorate([
8060
8105
  surfaceType('#FFFFFF')
8061
- ], exports.Frame.prototype, "fill", undefined);
8106
+ ], exports.Frame.prototype, "fill", void 0);
8062
8107
  __decorate([
8063
8108
  affectRenderBoundsType('hide')
8064
- ], exports.Frame.prototype, "overflow", undefined);
8109
+ ], exports.Frame.prototype, "overflow", void 0);
8065
8110
  exports.Frame = __decorate([
8066
8111
  registerUI()
8067
8112
  ], exports.Frame);
@@ -8108,16 +8153,16 @@ var LeaferUI = (function (exports) {
8108
8153
  };
8109
8154
  __decorate([
8110
8155
  dataProcessor(EllipseData)
8111
- ], exports.Ellipse.prototype, "__", undefined);
8156
+ ], exports.Ellipse.prototype, "__", void 0);
8112
8157
  __decorate([
8113
8158
  pathType(0)
8114
- ], exports.Ellipse.prototype, "innerRadius", undefined);
8159
+ ], exports.Ellipse.prototype, "innerRadius", void 0);
8115
8160
  __decorate([
8116
8161
  pathType(0)
8117
- ], exports.Ellipse.prototype, "startAngle", undefined);
8162
+ ], exports.Ellipse.prototype, "startAngle", void 0);
8118
8163
  __decorate([
8119
8164
  pathType(0)
8120
- ], exports.Ellipse.prototype, "endAngle", undefined);
8165
+ ], exports.Ellipse.prototype, "endAngle", void 0);
8121
8166
  exports.Ellipse = __decorate([
8122
8167
  registerUI()
8123
8168
  ], exports.Ellipse);
@@ -8176,22 +8221,22 @@ var LeaferUI = (function (exports) {
8176
8221
  };
8177
8222
  __decorate([
8178
8223
  dataProcessor(LineData)
8179
- ], exports.Line.prototype, "__", undefined);
8224
+ ], exports.Line.prototype, "__", void 0);
8180
8225
  __decorate([
8181
8226
  affectStrokeBoundsType('center')
8182
- ], exports.Line.prototype, "strokeAlign", undefined);
8227
+ ], exports.Line.prototype, "strokeAlign", void 0);
8183
8228
  __decorate([
8184
8229
  boundsType(0)
8185
- ], exports.Line.prototype, "height", undefined);
8230
+ ], exports.Line.prototype, "height", void 0);
8186
8231
  __decorate([
8187
8232
  pathType()
8188
- ], exports.Line.prototype, "points", undefined);
8233
+ ], exports.Line.prototype, "points", void 0);
8189
8234
  __decorate([
8190
8235
  pathType(0)
8191
- ], exports.Line.prototype, "curve", undefined);
8236
+ ], exports.Line.prototype, "curve", void 0);
8192
8237
  __decorate([
8193
8238
  pathType(false)
8194
- ], exports.Line.prototype, "closed", undefined);
8239
+ ], exports.Line.prototype, "closed", void 0);
8195
8240
  exports.Line = __decorate([
8196
8241
  registerUI()
8197
8242
  ], exports.Line);
@@ -8224,16 +8269,16 @@ var LeaferUI = (function (exports) {
8224
8269
  };
8225
8270
  __decorate([
8226
8271
  dataProcessor(PolygonData)
8227
- ], exports.Polygon.prototype, "__", undefined);
8272
+ ], exports.Polygon.prototype, "__", void 0);
8228
8273
  __decorate([
8229
8274
  pathType(3)
8230
- ], exports.Polygon.prototype, "sides", undefined);
8275
+ ], exports.Polygon.prototype, "sides", void 0);
8231
8276
  __decorate([
8232
8277
  pathType()
8233
- ], exports.Polygon.prototype, "points", undefined);
8278
+ ], exports.Polygon.prototype, "points", void 0);
8234
8279
  __decorate([
8235
8280
  pathType(0)
8236
- ], exports.Polygon.prototype, "curve", undefined);
8281
+ ], exports.Polygon.prototype, "curve", void 0);
8237
8282
  __decorate([
8238
8283
  rewrite(line.__updateRenderPath)
8239
8284
  ], exports.Polygon.prototype, "__updateRenderPath", null);
@@ -8265,13 +8310,13 @@ var LeaferUI = (function (exports) {
8265
8310
  };
8266
8311
  __decorate([
8267
8312
  dataProcessor(StarData)
8268
- ], exports.Star.prototype, "__", undefined);
8313
+ ], exports.Star.prototype, "__", void 0);
8269
8314
  __decorate([
8270
8315
  pathType(5)
8271
- ], exports.Star.prototype, "corners", undefined);
8316
+ ], exports.Star.prototype, "corners", void 0);
8272
8317
  __decorate([
8273
8318
  pathType(0.382)
8274
- ], exports.Star.prototype, "innerRadius", undefined);
8319
+ ], exports.Star.prototype, "innerRadius", void 0);
8275
8320
  exports.Star = __decorate([
8276
8321
  registerUI()
8277
8322
  ], exports.Star);
@@ -8293,10 +8338,10 @@ var LeaferUI = (function (exports) {
8293
8338
  };
8294
8339
  __decorate([
8295
8340
  dataProcessor(ImageData)
8296
- ], exports.Image.prototype, "__", undefined);
8341
+ ], exports.Image.prototype, "__", void 0);
8297
8342
  __decorate([
8298
8343
  boundsType('')
8299
- ], exports.Image.prototype, "url", undefined);
8344
+ ], exports.Image.prototype, "url", void 0);
8300
8345
  exports.Image = __decorate([
8301
8346
  registerUI()
8302
8347
  ], exports.Image);
@@ -8359,25 +8404,25 @@ var LeaferUI = (function (exports) {
8359
8404
  };
8360
8405
  __decorate([
8361
8406
  dataProcessor(CanvasData)
8362
- ], exports.Canvas.prototype, "__", undefined);
8407
+ ], exports.Canvas.prototype, "__", void 0);
8363
8408
  __decorate([
8364
8409
  resizeType(100)
8365
- ], exports.Canvas.prototype, "width", undefined);
8410
+ ], exports.Canvas.prototype, "width", void 0);
8366
8411
  __decorate([
8367
8412
  resizeType(100)
8368
- ], exports.Canvas.prototype, "height", undefined);
8413
+ ], exports.Canvas.prototype, "height", void 0);
8369
8414
  __decorate([
8370
8415
  resizeType(1)
8371
- ], exports.Canvas.prototype, "pixelRatio", undefined);
8416
+ ], exports.Canvas.prototype, "pixelRatio", void 0);
8372
8417
  __decorate([
8373
8418
  resizeType(true)
8374
- ], exports.Canvas.prototype, "smooth", undefined);
8419
+ ], exports.Canvas.prototype, "smooth", void 0);
8375
8420
  __decorate([
8376
8421
  dataType(false)
8377
- ], exports.Canvas.prototype, "safeResize", undefined);
8422
+ ], exports.Canvas.prototype, "safeResize", void 0);
8378
8423
  __decorate([
8379
8424
  resizeType()
8380
- ], exports.Canvas.prototype, "contextSettings", undefined);
8425
+ ], exports.Canvas.prototype, "contextSettings", void 0);
8381
8426
  exports.Canvas = __decorate([
8382
8427
  registerUI()
8383
8428
  ], exports.Canvas);
@@ -8468,76 +8513,76 @@ var LeaferUI = (function (exports) {
8468
8513
  };
8469
8514
  __decorate([
8470
8515
  dataProcessor(TextData)
8471
- ], exports.Text.prototype, "__", undefined);
8516
+ ], exports.Text.prototype, "__", void 0);
8472
8517
  __decorate([
8473
8518
  boundsType(0)
8474
- ], exports.Text.prototype, "width", undefined);
8519
+ ], exports.Text.prototype, "width", void 0);
8475
8520
  __decorate([
8476
8521
  boundsType(0)
8477
- ], exports.Text.prototype, "height", undefined);
8522
+ ], exports.Text.prototype, "height", void 0);
8478
8523
  __decorate([
8479
8524
  dataType(false)
8480
- ], exports.Text.prototype, "resizeFontSize", undefined);
8525
+ ], exports.Text.prototype, "resizeFontSize", void 0);
8481
8526
  __decorate([
8482
8527
  surfaceType('#000000')
8483
- ], exports.Text.prototype, "fill", undefined);
8528
+ ], exports.Text.prototype, "fill", void 0);
8484
8529
  __decorate([
8485
8530
  affectStrokeBoundsType('outside')
8486
- ], exports.Text.prototype, "strokeAlign", undefined);
8531
+ ], exports.Text.prototype, "strokeAlign", void 0);
8487
8532
  __decorate([
8488
8533
  hitType('all')
8489
- ], exports.Text.prototype, "hitFill", undefined);
8534
+ ], exports.Text.prototype, "hitFill", void 0);
8490
8535
  __decorate([
8491
8536
  boundsType('')
8492
- ], exports.Text.prototype, "text", undefined);
8537
+ ], exports.Text.prototype, "text", void 0);
8493
8538
  __decorate([
8494
8539
  boundsType('caption')
8495
- ], exports.Text.prototype, "fontFamily", undefined);
8540
+ ], exports.Text.prototype, "fontFamily", void 0);
8496
8541
  __decorate([
8497
8542
  boundsType(12)
8498
- ], exports.Text.prototype, "fontSize", undefined);
8543
+ ], exports.Text.prototype, "fontSize", void 0);
8499
8544
  __decorate([
8500
8545
  boundsType('normal')
8501
- ], exports.Text.prototype, "fontWeight", undefined);
8546
+ ], exports.Text.prototype, "fontWeight", void 0);
8502
8547
  __decorate([
8503
8548
  boundsType(false)
8504
- ], exports.Text.prototype, "italic", undefined);
8549
+ ], exports.Text.prototype, "italic", void 0);
8505
8550
  __decorate([
8506
8551
  boundsType('none')
8507
- ], exports.Text.prototype, "textCase", undefined);
8552
+ ], exports.Text.prototype, "textCase", void 0);
8508
8553
  __decorate([
8509
8554
  boundsType('none')
8510
- ], exports.Text.prototype, "textDecoration", undefined);
8555
+ ], exports.Text.prototype, "textDecoration", void 0);
8511
8556
  __decorate([
8512
8557
  boundsType(0)
8513
- ], exports.Text.prototype, "letterSpacing", undefined);
8558
+ ], exports.Text.prototype, "letterSpacing", void 0);
8514
8559
  __decorate([
8515
8560
  boundsType({ type: 'percent', value: 1.5 })
8516
- ], exports.Text.prototype, "lineHeight", undefined);
8561
+ ], exports.Text.prototype, "lineHeight", void 0);
8517
8562
  __decorate([
8518
8563
  boundsType(0)
8519
- ], exports.Text.prototype, "paraIndent", undefined);
8564
+ ], exports.Text.prototype, "paraIndent", void 0);
8520
8565
  __decorate([
8521
8566
  boundsType(0)
8522
- ], exports.Text.prototype, "paraSpacing", undefined);
8567
+ ], exports.Text.prototype, "paraSpacing", void 0);
8523
8568
  __decorate([
8524
8569
  boundsType('x')
8525
- ], exports.Text.prototype, "writingMode", undefined);
8570
+ ], exports.Text.prototype, "writingMode", void 0);
8526
8571
  __decorate([
8527
8572
  boundsType('left')
8528
- ], exports.Text.prototype, "textAlign", undefined);
8573
+ ], exports.Text.prototype, "textAlign", void 0);
8529
8574
  __decorate([
8530
8575
  boundsType('top')
8531
- ], exports.Text.prototype, "verticalAlign", undefined);
8576
+ ], exports.Text.prototype, "verticalAlign", void 0);
8532
8577
  __decorate([
8533
8578
  boundsType(true)
8534
- ], exports.Text.prototype, "autoSizeAlign", undefined);
8579
+ ], exports.Text.prototype, "autoSizeAlign", void 0);
8535
8580
  __decorate([
8536
8581
  boundsType('normal')
8537
- ], exports.Text.prototype, "textWrap", undefined);
8582
+ ], exports.Text.prototype, "textWrap", void 0);
8538
8583
  __decorate([
8539
8584
  boundsType('show')
8540
- ], exports.Text.prototype, "textOverflow", undefined);
8585
+ ], exports.Text.prototype, "textOverflow", void 0);
8541
8586
  exports.Text = __decorate([
8542
8587
  registerUI()
8543
8588
  ], exports.Text);
@@ -8550,10 +8595,10 @@ var LeaferUI = (function (exports) {
8550
8595
  };
8551
8596
  __decorate([
8552
8597
  dataProcessor(PathData)
8553
- ], exports.Path.prototype, "__", undefined);
8598
+ ], exports.Path.prototype, "__", void 0);
8554
8599
  __decorate([
8555
8600
  affectStrokeBoundsType('center')
8556
- ], exports.Path.prototype, "strokeAlign", undefined);
8601
+ ], exports.Path.prototype, "strokeAlign", void 0);
8557
8602
  exports.Path = __decorate([
8558
8603
  registerUI()
8559
8604
  ], exports.Path);
@@ -8592,10 +8637,10 @@ var LeaferUI = (function (exports) {
8592
8637
  };
8593
8638
  __decorate([
8594
8639
  dataProcessor(PenData)
8595
- ], exports.Pen.prototype, "__", undefined);
8640
+ ], exports.Pen.prototype, "__", void 0);
8596
8641
  __decorate([
8597
8642
  penPathType()
8598
- ], exports.Pen.prototype, "path", undefined);
8643
+ ], exports.Pen.prototype, "path", void 0);
8599
8644
  exports.Pen = __decorate([
8600
8645
  useModule(PathCreator, ['set', 'path', 'paint']),
8601
8646
  registerUI()
@@ -8967,7 +9012,7 @@ var LeaferUI = (function (exports) {
8967
9012
  box = tempBox.set(box).shrink(paint.padding);
8968
9013
  if (paint.mode === 'strench')
8969
9014
  paint.mode = 'stretch';
8970
- const { opacity, mode, align, offset, scale, size, rotation, repeat } = paint;
9015
+ const { opacity, mode, align, offset, scale, size, rotation, repeat, filters } = paint;
8971
9016
  const sameBox = box.width === width && box.height === height;
8972
9017
  const data = { mode };
8973
9018
  const swapSize = align !== 'center' && (rotation || 0) % 180 === 90;
@@ -9030,6 +9075,8 @@ var LeaferUI = (function (exports) {
9030
9075
  data.height = height;
9031
9076
  if (opacity)
9032
9077
  data.opacity = opacity;
9078
+ if (filters)
9079
+ data.filters = filters;
9033
9080
  if (repeat)
9034
9081
  data.repeat = typeof repeat === 'string' ? (repeat === 'x' ? 'repeat-x' : 'repeat-y') : 'repeat';
9035
9082
  return data;
@@ -9132,7 +9179,7 @@ var LeaferUI = (function (exports) {
9132
9179
  scaleX = abs$1(scaleX);
9133
9180
  scaleY = abs$1(scaleY);
9134
9181
  const { image, data } = paint;
9135
- let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, opacity, transform, repeat } = data;
9182
+ let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, transform, repeat } = data;
9136
9183
  if (sx) {
9137
9184
  imageMatrix = get$1();
9138
9185
  copy$1(imageMatrix, transform);
@@ -9175,7 +9222,7 @@ var LeaferUI = (function (exports) {
9175
9222
  }
9176
9223
  scale(imageMatrix, 1 / scaleX, 1 / scaleY);
9177
9224
  }
9178
- const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, opacity);
9225
+ const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, data.opacity, data.filters);
9179
9226
  const pattern = image.getPattern(canvas, repeat || (Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint);
9180
9227
  paint.style = pattern;
9181
9228
  paint.patternId = id;
@@ -9219,7 +9266,7 @@ var LeaferUI = (function (exports) {
9219
9266
  canvas.opacity *= data.opacity;
9220
9267
  if (data.transform)
9221
9268
  canvas.transform(data.transform);
9222
- canvas.drawImage(paint.image.view, 0, 0, data.width, data.height);
9269
+ canvas.drawImage(paint.image.getFull(data.filters), 0, 0, data.width, data.height);
9223
9270
  canvas.restore();
9224
9271
  return true;
9225
9272
  }
@@ -9229,7 +9276,7 @@ var LeaferUI = (function (exports) {
9229
9276
  }
9230
9277
  else {
9231
9278
  if (!paint.patternTask) {
9232
- paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
9279
+ paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
9233
9280
  paint.patternTask = null;
9234
9281
  if (canvas.bounds.hit(ui.__nowWorld))
9235
9282
  createPattern(ui, paint, pixelRatio);
@@ -9819,11 +9866,11 @@ var LeaferUI = (function (exports) {
9819
9866
  function layoutChar(drawData, style, width, _height) {
9820
9867
  const { rows } = drawData;
9821
9868
  const { textAlign, paraIndent, letterSpacing } = style;
9822
- let charX, addWordWidth, indentWidth, mode, wordChar;
9869
+ let charX, addWordWidth, indentWidth, mode, wordChar, wordsLength;
9823
9870
  rows.forEach(row => {
9824
9871
  if (row.words) {
9825
- indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
9826
- addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
9872
+ indentWidth = paraIndent && row.paraStart ? paraIndent : 0, wordsLength = row.words.length;
9873
+ addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && wordsLength > 1) ? (width - row.width - indentWidth) / (wordsLength - 1) : 0;
9827
9874
  mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
9828
9875
  if (row.isOverflow && !letterSpacing)
9829
9876
  row.textMode = true;
@@ -9835,7 +9882,7 @@ var LeaferUI = (function (exports) {
9835
9882
  row.x += indentWidth;
9836
9883
  charX = row.x;
9837
9884
  row.data = [];
9838
- row.words.forEach(word => {
9885
+ row.words.forEach((word, index) => {
9839
9886
  if (mode === WordMode) {
9840
9887
  wordChar = { char: '', x: charX };
9841
9888
  charX = toWordChar(word.data, charX, wordChar);
@@ -9845,7 +9892,7 @@ var LeaferUI = (function (exports) {
9845
9892
  else {
9846
9893
  charX = toChar(word.data, charX, row.data, row.isOverflow);
9847
9894
  }
9848
- if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
9895
+ if (addWordWidth && (!row.paraEnd || textAlign === 'both') && (index !== wordsLength - 1)) {
9849
9896
  charX += addWordWidth;
9850
9897
  row.width += addWordWidth;
9851
9898
  }
@@ -10120,6 +10167,7 @@ var LeaferUI = (function (exports) {
10120
10167
  exports.Eventer = Eventer;
10121
10168
  exports.Export = Export;
10122
10169
  exports.FileHelper = FileHelper;
10170
+ exports.Filter = Filter;
10123
10171
  exports.FrameData = FrameData;
10124
10172
  exports.GroupData = GroupData;
10125
10173
  exports.ImageData = ImageData;
@@ -10181,6 +10229,7 @@ var LeaferUI = (function (exports) {
10181
10229
  exports.RenderEvent = RenderEvent;
10182
10230
  exports.Renderer = Renderer;
10183
10231
  exports.ResizeEvent = ResizeEvent;
10232
+ exports.Resource = Resource;
10184
10233
  exports.Run = Run;
10185
10234
  exports.StarData = StarData;
10186
10235
  exports.State = State;
@@ -10254,3 +10303,4 @@ var LeaferUI = (function (exports) {
10254
10303
  return exports;
10255
10304
 
10256
10305
  })({});
10306
+ //# sourceMappingURL=worker.js.map