@leafer-ui/worker 1.3.1 → 1.3.3

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
@@ -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 === void 0 ? void 0 : value.constructor) === Object && ((_a = t[key]) === null || _a === void 0 ? void 0 : _a.constructor) === Object)
1539
+ if ((value === null || value === undefined ? undefined : value.constructor) === Object && ((_a = t[key]) === null || _a === undefined ? undefined : _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 === void 0 ? void 0 : _b.constructor) === Object)
1542
+ if (((_b = exclude[key]) === null || _b === undefined ? undefined : _b.constructor) === Object)
1543
1543
  assign(t[key] = {}, merge[key], exclude[key]);
1544
1544
  return;
1545
1545
  }
@@ -1708,7 +1708,7 @@ var LeaferUI = (function (exports) {
1708
1708
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1709
1709
  PERFORMANCE OF THIS SOFTWARE.
1710
1710
  ***************************************************************************** */
1711
- /* global Reflect, Promise, SuppressedError, Symbol */
1711
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
1712
1712
 
1713
1713
 
1714
1714
  function __decorate(decorators, target, key, desc) {
@@ -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 void 0; }
1779
+ getTransform() { return undefined; }
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 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; }
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; }
1840
1840
  fillText(_text, _x, _y, _maxWidth) { }
1841
- measureText(_text) { return void 0; }
1841
+ measureText(_text) { return undefined; }
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", void 0);
1849
+ ], Canvas.prototype, "smooth", undefined);
1850
1850
  __decorate([
1851
1851
  contextAttr('imageSmoothingQuality')
1852
- ], Canvas.prototype, "smoothLevel", void 0);
1852
+ ], Canvas.prototype, "smoothLevel", undefined);
1853
1853
  __decorate([
1854
1854
  contextAttr('globalAlpha')
1855
- ], Canvas.prototype, "opacity", void 0);
1855
+ ], Canvas.prototype, "opacity", undefined);
1856
1856
  __decorate([
1857
1857
  contextAttr()
1858
- ], Canvas.prototype, "fillStyle", void 0);
1858
+ ], Canvas.prototype, "fillStyle", undefined);
1859
1859
  __decorate([
1860
1860
  contextAttr()
1861
- ], Canvas.prototype, "strokeStyle", void 0);
1861
+ ], Canvas.prototype, "strokeStyle", undefined);
1862
1862
  __decorate([
1863
1863
  contextAttr('lineWidth')
1864
- ], Canvas.prototype, "strokeWidth", void 0);
1864
+ ], Canvas.prototype, "strokeWidth", undefined);
1865
1865
  __decorate([
1866
1866
  contextAttr('lineCap')
1867
- ], Canvas.prototype, "strokeCap", void 0);
1867
+ ], Canvas.prototype, "strokeCap", undefined);
1868
1868
  __decorate([
1869
1869
  contextAttr('lineJoin')
1870
- ], Canvas.prototype, "strokeJoin", void 0);
1870
+ ], Canvas.prototype, "strokeJoin", undefined);
1871
1871
  __decorate([
1872
1872
  contextAttr('lineDashOffset')
1873
- ], Canvas.prototype, "dashOffset", void 0);
1873
+ ], Canvas.prototype, "dashOffset", undefined);
1874
1874
  __decorate([
1875
1875
  contextAttr()
1876
- ], Canvas.prototype, "miterLimit", void 0);
1876
+ ], Canvas.prototype, "miterLimit", undefined);
1877
1877
  __decorate([
1878
1878
  contextAttr()
1879
- ], Canvas.prototype, "shadowBlur", void 0);
1879
+ ], Canvas.prototype, "shadowBlur", undefined);
1880
1880
  __decorate([
1881
1881
  contextAttr()
1882
- ], Canvas.prototype, "shadowColor", void 0);
1882
+ ], Canvas.prototype, "shadowColor", undefined);
1883
1883
  __decorate([
1884
1884
  contextAttr()
1885
- ], Canvas.prototype, "shadowOffsetX", void 0);
1885
+ ], Canvas.prototype, "shadowOffsetX", undefined);
1886
1886
  __decorate([
1887
1887
  contextAttr()
1888
- ], Canvas.prototype, "shadowOffsetY", void 0);
1888
+ ], Canvas.prototype, "shadowOffsetY", undefined);
1889
1889
  __decorate([
1890
1890
  contextAttr()
1891
- ], Canvas.prototype, "filter", void 0);
1891
+ ], Canvas.prototype, "filter", undefined);
1892
1892
  __decorate([
1893
1893
  contextAttr()
1894
- ], Canvas.prototype, "font", void 0);
1894
+ ], Canvas.prototype, "font", undefined);
1895
1895
  __decorate([
1896
1896
  contextAttr()
1897
- ], Canvas.prototype, "fontKerning", void 0);
1897
+ ], Canvas.prototype, "fontKerning", undefined);
1898
1898
  __decorate([
1899
1899
  contextAttr()
1900
- ], Canvas.prototype, "fontStretch", void 0);
1900
+ ], Canvas.prototype, "fontStretch", undefined);
1901
1901
  __decorate([
1902
1902
  contextAttr()
1903
- ], Canvas.prototype, "fontVariantCaps", void 0);
1903
+ ], Canvas.prototype, "fontVariantCaps", undefined);
1904
1904
  __decorate([
1905
1905
  contextAttr()
1906
- ], Canvas.prototype, "textAlign", void 0);
1906
+ ], Canvas.prototype, "textAlign", undefined);
1907
1907
  __decorate([
1908
1908
  contextAttr()
1909
- ], Canvas.prototype, "textBaseline", void 0);
1909
+ ], Canvas.prototype, "textBaseline", undefined);
1910
1910
  __decorate([
1911
1911
  contextAttr()
1912
- ], Canvas.prototype, "textRendering", void 0);
1912
+ ], Canvas.prototype, "textRendering", undefined);
1913
1913
  __decorate([
1914
1914
  contextAttr()
1915
- ], Canvas.prototype, "wordSpacing", void 0);
1915
+ ], Canvas.prototype, "wordSpacing", undefined);
1916
1916
  __decorate([
1917
1917
  contextAttr()
1918
- ], Canvas.prototype, "letterSpacing", void 0);
1918
+ ], Canvas.prototype, "letterSpacing", undefined);
1919
1919
  __decorate([
1920
1920
  contextAttr()
1921
- ], Canvas.prototype, "direction", void 0);
1921
+ ], Canvas.prototype, "direction", undefined);
1922
1922
  __decorate([
1923
1923
  contextMethod()
1924
1924
  ], Canvas.prototype, "setTransform", null);
@@ -3387,7 +3387,7 @@ var LeaferUI = (function (exports) {
3387
3387
  this.task = task;
3388
3388
  }
3389
3389
  run() {
3390
- return __awaiter(this, void 0, void 0, function* () {
3390
+ return __awaiter(this, undefined, undefined, function* () {
3391
3391
  try {
3392
3392
  if (this.task && !this.isComplete && this.parent.running)
3393
3393
  yield this.task();
@@ -3699,7 +3699,7 @@ var LeaferUI = (function (exports) {
3699
3699
  load(onSuccess, onError) {
3700
3700
  if (!this.loading) {
3701
3701
  this.loading = true;
3702
- ImageManager.tasker.add(() => __awaiter(this, void 0, void 0, function* () {
3702
+ ImageManager.tasker.add(() => __awaiter(this, undefined, undefined, function* () {
3703
3703
  return yield Platform.origin.loadImage(this.url).then((img) => {
3704
3704
  this.ready = true;
3705
3705
  this.width = img.naturalWidth || img.width;
@@ -5178,8 +5178,7 @@ var LeaferUI = (function (exports) {
5178
5178
  __updateAutoLayout() {
5179
5179
  this.__layout.matrixChanged = true;
5180
5180
  if (this.isBranch) {
5181
- if (this.leaferIsReady)
5182
- this.leafer.layouter.addExtra(this);
5181
+ this.__extraUpdate();
5183
5182
  if (this.__.flow) {
5184
5183
  if (this.__layout.boxChanged)
5185
5184
  this.__updateFlowLayout();
@@ -5332,7 +5331,7 @@ var LeaferUI = (function (exports) {
5332
5331
  get __worldFlipped() { return this.__world.scaleX < 0 || this.__world.scaleY < 0; }
5333
5332
  get __onlyHitMask() { return this.__hasMask && !this.__.hitChildren; }
5334
5333
  get __ignoreHitWorld() { return (this.__hasMask || this.__hasEraser) && this.__.hitChildren; }
5335
- get __inLazyBounds() { const { leafer } = this; return leafer && leafer.created && leafer.lazyBounds.hit(this.__world); }
5334
+ get __inLazyBounds() { return this.leaferIsCreated && this.leafer.lazyBounds.hit(this.__world); }
5336
5335
  get pathInputed() { return this.__.__pathInputed; }
5337
5336
  set event(map) { this.on(map); }
5338
5337
  constructor(data) {
@@ -5443,6 +5442,10 @@ var LeaferUI = (function (exports) {
5443
5442
  forceRender(_bounds, _sync) {
5444
5443
  this.forceUpdate('surface');
5445
5444
  }
5445
+ __extraUpdate() {
5446
+ if (this.leaferIsReady)
5447
+ this.leafer.layouter.addExtra(this);
5448
+ }
5446
5449
  __updateWorldMatrix() { }
5447
5450
  __updateLocalMatrix() { }
5448
5451
  __updateWorldBounds() { }
@@ -6010,7 +6013,7 @@ var LeaferUI = (function (exports) {
6010
6013
  }
6011
6014
  }
6012
6015
 
6013
- const version = "1.3.1";
6016
+ const version = "1.3.3";
6014
6017
 
6015
6018
  class LeaferCanvas extends LeaferCanvasBase {
6016
6019
  get allowBackgroundColor() { return true; }
@@ -6355,7 +6358,7 @@ var LeaferUI = (function (exports) {
6355
6358
  }
6356
6359
  partLayout() {
6357
6360
  var _a;
6358
- if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
6361
+ if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
6359
6362
  return;
6360
6363
  const t = Run.start('PartLayout');
6361
6364
  const { target, __updatedList: updateList } = this;
@@ -6542,7 +6545,7 @@ var LeaferUI = (function (exports) {
6542
6545
  partRender() {
6543
6546
  const { canvas, updateBlocks: list } = this;
6544
6547
  if (!list)
6545
- return debug$3.warn('PartRender: need update attr');
6548
+ return;
6546
6549
  this.mergeBlocks();
6547
6550
  list.forEach(block => { if (canvas.bounds.hit(block) && !block.isEmpty())
6548
6551
  this.clipRender(block); });
@@ -6926,6 +6929,7 @@ var LeaferUI = (function (exports) {
6926
6929
  return t.fill && this.__hasStroke;
6927
6930
  }
6928
6931
  get __clipAfterFill() { const t = this; return (t.cornerRadius || t.innerShadow || t.__pathInputed); }
6932
+ get __hasSurface() { const t = this; return (t.fill || t.stroke); }
6929
6933
  get __autoWidth() { return !this._width; }
6930
6934
  get __autoHeight() { return !this._height; }
6931
6935
  get __autoSide() { return !this._width || !this._height; }
@@ -7398,7 +7402,7 @@ var LeaferUI = (function (exports) {
7398
7402
  animate(_keyframe, _options, _type, _isTemp) {
7399
7403
  return Plugin.need('animate');
7400
7404
  }
7401
- killAnimate(_type, _killStyle) { }
7405
+ killAnimate(_type, _nextStyle) { }
7402
7406
  export(_filename, _options) {
7403
7407
  return Plugin.need('export');
7404
7408
  }
@@ -7429,199 +7433,199 @@ var LeaferUI = (function (exports) {
7429
7433
  };
7430
7434
  __decorate([
7431
7435
  dataProcessor(UIData)
7432
- ], exports.UI.prototype, "__", void 0);
7436
+ ], exports.UI.prototype, "__", undefined);
7433
7437
  __decorate([
7434
7438
  zoomLayerType()
7435
- ], exports.UI.prototype, "zoomLayer", void 0);
7439
+ ], exports.UI.prototype, "zoomLayer", undefined);
7436
7440
  __decorate([
7437
7441
  dataType('')
7438
- ], exports.UI.prototype, "id", void 0);
7442
+ ], exports.UI.prototype, "id", undefined);
7439
7443
  __decorate([
7440
7444
  dataType('')
7441
- ], exports.UI.prototype, "name", void 0);
7445
+ ], exports.UI.prototype, "name", undefined);
7442
7446
  __decorate([
7443
7447
  dataType('')
7444
- ], exports.UI.prototype, "className", void 0);
7448
+ ], exports.UI.prototype, "className", undefined);
7445
7449
  __decorate([
7446
7450
  surfaceType('pass-through')
7447
- ], exports.UI.prototype, "blendMode", void 0);
7451
+ ], exports.UI.prototype, "blendMode", undefined);
7448
7452
  __decorate([
7449
7453
  opacityType(1)
7450
- ], exports.UI.prototype, "opacity", void 0);
7454
+ ], exports.UI.prototype, "opacity", undefined);
7451
7455
  __decorate([
7452
7456
  visibleType(true)
7453
- ], exports.UI.prototype, "visible", void 0);
7457
+ ], exports.UI.prototype, "visible", undefined);
7454
7458
  __decorate([
7455
7459
  surfaceType(false)
7456
- ], exports.UI.prototype, "locked", void 0);
7460
+ ], exports.UI.prototype, "locked", undefined);
7457
7461
  __decorate([
7458
7462
  sortType(0)
7459
- ], exports.UI.prototype, "zIndex", void 0);
7463
+ ], exports.UI.prototype, "zIndex", undefined);
7460
7464
  __decorate([
7461
7465
  maskType(false)
7462
- ], exports.UI.prototype, "mask", void 0);
7466
+ ], exports.UI.prototype, "mask", undefined);
7463
7467
  __decorate([
7464
7468
  eraserType(false)
7465
- ], exports.UI.prototype, "eraser", void 0);
7469
+ ], exports.UI.prototype, "eraser", undefined);
7466
7470
  __decorate([
7467
7471
  positionType(0, true)
7468
- ], exports.UI.prototype, "x", void 0);
7472
+ ], exports.UI.prototype, "x", undefined);
7469
7473
  __decorate([
7470
7474
  positionType(0, true)
7471
- ], exports.UI.prototype, "y", void 0);
7475
+ ], exports.UI.prototype, "y", undefined);
7472
7476
  __decorate([
7473
7477
  boundsType(100, true)
7474
- ], exports.UI.prototype, "width", void 0);
7478
+ ], exports.UI.prototype, "width", undefined);
7475
7479
  __decorate([
7476
7480
  boundsType(100, true)
7477
- ], exports.UI.prototype, "height", void 0);
7481
+ ], exports.UI.prototype, "height", undefined);
7478
7482
  __decorate([
7479
7483
  scaleType(1, true)
7480
- ], exports.UI.prototype, "scaleX", void 0);
7484
+ ], exports.UI.prototype, "scaleX", undefined);
7481
7485
  __decorate([
7482
7486
  scaleType(1, true)
7483
- ], exports.UI.prototype, "scaleY", void 0);
7487
+ ], exports.UI.prototype, "scaleY", undefined);
7484
7488
  __decorate([
7485
7489
  rotationType(0, true)
7486
- ], exports.UI.prototype, "rotation", void 0);
7490
+ ], exports.UI.prototype, "rotation", undefined);
7487
7491
  __decorate([
7488
7492
  rotationType(0, true)
7489
- ], exports.UI.prototype, "skewX", void 0);
7493
+ ], exports.UI.prototype, "skewX", undefined);
7490
7494
  __decorate([
7491
7495
  rotationType(0, true)
7492
- ], exports.UI.prototype, "skewY", void 0);
7496
+ ], exports.UI.prototype, "skewY", undefined);
7493
7497
  __decorate([
7494
7498
  positionType(0, true)
7495
- ], exports.UI.prototype, "offsetX", void 0);
7499
+ ], exports.UI.prototype, "offsetX", undefined);
7496
7500
  __decorate([
7497
7501
  positionType(0, true)
7498
- ], exports.UI.prototype, "offsetY", void 0);
7502
+ ], exports.UI.prototype, "offsetY", undefined);
7499
7503
  __decorate([
7500
7504
  positionType(0, true)
7501
- ], exports.UI.prototype, "scrollX", void 0);
7505
+ ], exports.UI.prototype, "scrollX", undefined);
7502
7506
  __decorate([
7503
7507
  positionType(0, true)
7504
- ], exports.UI.prototype, "scrollY", void 0);
7508
+ ], exports.UI.prototype, "scrollY", undefined);
7505
7509
  __decorate([
7506
7510
  autoLayoutType()
7507
- ], exports.UI.prototype, "origin", void 0);
7511
+ ], exports.UI.prototype, "origin", undefined);
7508
7512
  __decorate([
7509
7513
  autoLayoutType()
7510
- ], exports.UI.prototype, "around", void 0);
7514
+ ], exports.UI.prototype, "around", undefined);
7511
7515
  __decorate([
7512
7516
  dataType(false)
7513
- ], exports.UI.prototype, "lazy", void 0);
7517
+ ], exports.UI.prototype, "lazy", undefined);
7514
7518
  __decorate([
7515
7519
  naturalBoundsType(1)
7516
- ], exports.UI.prototype, "pixelRatio", void 0);
7520
+ ], exports.UI.prototype, "pixelRatio", undefined);
7517
7521
  __decorate([
7518
7522
  pathInputType()
7519
- ], exports.UI.prototype, "path", void 0);
7523
+ ], exports.UI.prototype, "path", undefined);
7520
7524
  __decorate([
7521
7525
  pathType()
7522
- ], exports.UI.prototype, "windingRule", void 0);
7526
+ ], exports.UI.prototype, "windingRule", undefined);
7523
7527
  __decorate([
7524
7528
  pathType(true)
7525
- ], exports.UI.prototype, "closed", void 0);
7529
+ ], exports.UI.prototype, "closed", undefined);
7526
7530
  __decorate([
7527
7531
  boundsType(0)
7528
- ], exports.UI.prototype, "padding", void 0);
7532
+ ], exports.UI.prototype, "padding", undefined);
7529
7533
  __decorate([
7530
7534
  boundsType(false)
7531
- ], exports.UI.prototype, "lockRatio", void 0);
7535
+ ], exports.UI.prototype, "lockRatio", undefined);
7532
7536
  __decorate([
7533
7537
  boundsType()
7534
- ], exports.UI.prototype, "widthRange", void 0);
7538
+ ], exports.UI.prototype, "widthRange", undefined);
7535
7539
  __decorate([
7536
7540
  boundsType()
7537
- ], exports.UI.prototype, "heightRange", void 0);
7541
+ ], exports.UI.prototype, "heightRange", undefined);
7538
7542
  __decorate([
7539
7543
  dataType(false)
7540
- ], exports.UI.prototype, "draggable", void 0);
7544
+ ], exports.UI.prototype, "draggable", undefined);
7541
7545
  __decorate([
7542
7546
  dataType()
7543
- ], exports.UI.prototype, "dragBounds", void 0);
7547
+ ], exports.UI.prototype, "dragBounds", undefined);
7544
7548
  __decorate([
7545
7549
  dataType(false)
7546
- ], exports.UI.prototype, "editable", void 0);
7550
+ ], exports.UI.prototype, "editable", undefined);
7547
7551
  __decorate([
7548
7552
  hitType(true)
7549
- ], exports.UI.prototype, "hittable", void 0);
7553
+ ], exports.UI.prototype, "hittable", undefined);
7550
7554
  __decorate([
7551
7555
  hitType('path')
7552
- ], exports.UI.prototype, "hitFill", void 0);
7556
+ ], exports.UI.prototype, "hitFill", undefined);
7553
7557
  __decorate([
7554
7558
  strokeType('path')
7555
- ], exports.UI.prototype, "hitStroke", void 0);
7559
+ ], exports.UI.prototype, "hitStroke", undefined);
7556
7560
  __decorate([
7557
7561
  hitType(false)
7558
- ], exports.UI.prototype, "hitBox", void 0);
7562
+ ], exports.UI.prototype, "hitBox", undefined);
7559
7563
  __decorate([
7560
7564
  hitType(true)
7561
- ], exports.UI.prototype, "hitChildren", void 0);
7565
+ ], exports.UI.prototype, "hitChildren", undefined);
7562
7566
  __decorate([
7563
7567
  hitType(true)
7564
- ], exports.UI.prototype, "hitSelf", void 0);
7568
+ ], exports.UI.prototype, "hitSelf", undefined);
7565
7569
  __decorate([
7566
7570
  hitType()
7567
- ], exports.UI.prototype, "hitRadius", void 0);
7571
+ ], exports.UI.prototype, "hitRadius", undefined);
7568
7572
  __decorate([
7569
7573
  cursorType('')
7570
- ], exports.UI.prototype, "cursor", void 0);
7574
+ ], exports.UI.prototype, "cursor", undefined);
7571
7575
  __decorate([
7572
7576
  surfaceType()
7573
- ], exports.UI.prototype, "fill", void 0);
7577
+ ], exports.UI.prototype, "fill", undefined);
7574
7578
  __decorate([
7575
7579
  strokeType()
7576
- ], exports.UI.prototype, "stroke", void 0);
7580
+ ], exports.UI.prototype, "stroke", undefined);
7577
7581
  __decorate([
7578
7582
  strokeType('inside')
7579
- ], exports.UI.prototype, "strokeAlign", void 0);
7583
+ ], exports.UI.prototype, "strokeAlign", undefined);
7580
7584
  __decorate([
7581
7585
  strokeType(1)
7582
- ], exports.UI.prototype, "strokeWidth", void 0);
7586
+ ], exports.UI.prototype, "strokeWidth", undefined);
7583
7587
  __decorate([
7584
7588
  strokeType(false)
7585
- ], exports.UI.prototype, "strokeWidthFixed", void 0);
7589
+ ], exports.UI.prototype, "strokeWidthFixed", undefined);
7586
7590
  __decorate([
7587
7591
  strokeType('none')
7588
- ], exports.UI.prototype, "strokeCap", void 0);
7592
+ ], exports.UI.prototype, "strokeCap", undefined);
7589
7593
  __decorate([
7590
7594
  strokeType('miter')
7591
- ], exports.UI.prototype, "strokeJoin", void 0);
7595
+ ], exports.UI.prototype, "strokeJoin", undefined);
7592
7596
  __decorate([
7593
7597
  strokeType()
7594
- ], exports.UI.prototype, "dashPattern", void 0);
7598
+ ], exports.UI.prototype, "dashPattern", undefined);
7595
7599
  __decorate([
7596
7600
  strokeType()
7597
- ], exports.UI.prototype, "dashOffset", void 0);
7601
+ ], exports.UI.prototype, "dashOffset", undefined);
7598
7602
  __decorate([
7599
7603
  strokeType(10)
7600
- ], exports.UI.prototype, "miterLimit", void 0);
7604
+ ], exports.UI.prototype, "miterLimit", undefined);
7601
7605
  __decorate([
7602
7606
  pathType(0)
7603
- ], exports.UI.prototype, "cornerRadius", void 0);
7607
+ ], exports.UI.prototype, "cornerRadius", undefined);
7604
7608
  __decorate([
7605
7609
  pathType()
7606
- ], exports.UI.prototype, "cornerSmoothing", void 0);
7610
+ ], exports.UI.prototype, "cornerSmoothing", undefined);
7607
7611
  __decorate([
7608
7612
  effectType()
7609
- ], exports.UI.prototype, "shadow", void 0);
7613
+ ], exports.UI.prototype, "shadow", undefined);
7610
7614
  __decorate([
7611
7615
  effectType()
7612
- ], exports.UI.prototype, "innerShadow", void 0);
7616
+ ], exports.UI.prototype, "innerShadow", undefined);
7613
7617
  __decorate([
7614
7618
  effectType()
7615
- ], exports.UI.prototype, "blur", void 0);
7619
+ ], exports.UI.prototype, "blur", undefined);
7616
7620
  __decorate([
7617
7621
  effectType()
7618
- ], exports.UI.prototype, "backgroundBlur", void 0);
7622
+ ], exports.UI.prototype, "backgroundBlur", undefined);
7619
7623
  __decorate([
7620
7624
  effectType()
7621
- ], exports.UI.prototype, "grayscale", void 0);
7625
+ ], exports.UI.prototype, "grayscale", undefined);
7622
7626
  __decorate([
7623
7627
  dataType({})
7624
- ], exports.UI.prototype, "data", void 0);
7628
+ ], exports.UI.prototype, "data", undefined);
7625
7629
  __decorate([
7626
7630
  rewrite(exports.Leaf.prototype.reset)
7627
7631
  ], exports.UI.prototype, "reset", null);
@@ -7682,7 +7686,7 @@ var LeaferUI = (function (exports) {
7682
7686
  };
7683
7687
  __decorate([
7684
7688
  dataProcessor(GroupData)
7685
- ], exports.Group.prototype, "__", void 0);
7689
+ ], exports.Group.prototype, "__", undefined);
7686
7690
  exports.Group = __decorate([
7687
7691
  useModule(exports.Branch),
7688
7692
  registerUI()
@@ -7853,8 +7857,6 @@ var LeaferUI = (function (exports) {
7853
7857
  __setAttr(attrName, newValue) {
7854
7858
  if (this.canvas) {
7855
7859
  if (canvasSizeAttrs.includes(attrName)) {
7856
- if (!newValue)
7857
- debug$1.warn(attrName + ' is 0');
7858
7860
  this.__changeCanvasSize(attrName, newValue);
7859
7861
  }
7860
7862
  else if (attrName === 'fill') {
@@ -7894,8 +7896,6 @@ var LeaferUI = (function (exports) {
7894
7896
  this.created = true;
7895
7897
  }
7896
7898
  __onReady() {
7897
- if (this.ready)
7898
- return;
7899
7899
  this.ready = true;
7900
7900
  this.emitLeafer(LeaferEvent.BEFORE_READY);
7901
7901
  this.emitLeafer(LeaferEvent.READY);
@@ -7909,6 +7909,20 @@ var LeaferUI = (function (exports) {
7909
7909
  this.emitLeafer(LeaferEvent.VIEW_READY);
7910
7910
  WaitHelper.run(this.__viewReadyWait);
7911
7911
  }
7912
+ __onLayoutEnd() {
7913
+ const { grow, growWidth, growHeight } = this.config;
7914
+ if (grow) {
7915
+ let { width, height, pixelRatio } = this;
7916
+ const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
7917
+ if (growWidth !== false)
7918
+ width = Math.max(1, bounds.x + bounds.width);
7919
+ if (growHeight !== false)
7920
+ height = Math.max(1, bounds.y + bounds.height);
7921
+ this.__doResize({ width, height, pixelRatio });
7922
+ }
7923
+ if (!this.ready)
7924
+ this.__onReady();
7925
+ }
7912
7926
  __onNextRender() {
7913
7927
  if (this.viewReady) {
7914
7928
  WaitHelper.run(this.__nextRenderWait);
@@ -8002,10 +8016,9 @@ var LeaferUI = (function (exports) {
8002
8016
  const runId = Run.start('FirstCreate ' + this.innerName);
8003
8017
  this.once(LeaferEvent.START, () => Run.end(runId));
8004
8018
  this.once(LayoutEvent.START, () => this.updateLazyBounds());
8005
- this.once(LayoutEvent.END, () => this.__onReady());
8006
8019
  this.once(RenderEvent.START, () => this.__onCreated());
8007
8020
  this.once(RenderEvent.END, () => this.__onViewReady());
8008
- this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
8021
+ this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(LayoutEvent.END, this.__onLayoutEnd, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
8009
8022
  }
8010
8023
  __removeListenEvents() {
8011
8024
  this.off_(this.__eventIds);
@@ -8046,10 +8059,10 @@ var LeaferUI = (function (exports) {
8046
8059
  exports.Leafer.list = new LeafList();
8047
8060
  __decorate([
8048
8061
  dataProcessor(LeaferData)
8049
- ], exports.Leafer.prototype, "__", void 0);
8062
+ ], exports.Leafer.prototype, "__", undefined);
8050
8063
  __decorate([
8051
8064
  boundsType()
8052
- ], exports.Leafer.prototype, "pixelRatio", void 0);
8065
+ ], exports.Leafer.prototype, "pixelRatio", undefined);
8053
8066
  exports.Leafer = Leafer_1 = __decorate([
8054
8067
  registerUI()
8055
8068
  ], exports.Leafer);
@@ -8062,7 +8075,7 @@ var LeaferUI = (function (exports) {
8062
8075
  };
8063
8076
  __decorate([
8064
8077
  dataProcessor(RectData)
8065
- ], exports.Rect.prototype, "__", void 0);
8078
+ ], exports.Rect.prototype, "__", undefined);
8066
8079
  exports.Rect = __decorate([
8067
8080
  useModule(RectRender),
8068
8081
  rewriteAble(),
@@ -8087,6 +8100,8 @@ var LeaferUI = (function (exports) {
8087
8100
  const data = this.__;
8088
8101
  if (this.children.length) {
8089
8102
  if (data.__autoSide) {
8103
+ if (data.__hasSurface)
8104
+ this.__extraUpdate();
8090
8105
  super.__updateBoxBounds();
8091
8106
  const { boxBounds } = this.__layout;
8092
8107
  if (!data.__autoSize) {
@@ -8151,13 +8166,13 @@ var LeaferUI = (function (exports) {
8151
8166
  };
8152
8167
  __decorate([
8153
8168
  dataProcessor(BoxData)
8154
- ], exports.Box.prototype, "__", void 0);
8169
+ ], exports.Box.prototype, "__", undefined);
8155
8170
  __decorate([
8156
8171
  dataType(false)
8157
- ], exports.Box.prototype, "resizeChildren", void 0);
8172
+ ], exports.Box.prototype, "resizeChildren", undefined);
8158
8173
  __decorate([
8159
8174
  affectRenderBoundsType('show')
8160
- ], exports.Box.prototype, "overflow", void 0);
8175
+ ], exports.Box.prototype, "overflow", undefined);
8161
8176
  __decorate([
8162
8177
  rewrite(rect$1.__updateStrokeSpread)
8163
8178
  ], exports.Box.prototype, "__updateStrokeSpread", null);
@@ -8196,13 +8211,13 @@ var LeaferUI = (function (exports) {
8196
8211
  };
8197
8212
  __decorate([
8198
8213
  dataProcessor(FrameData)
8199
- ], exports.Frame.prototype, "__", void 0);
8214
+ ], exports.Frame.prototype, "__", undefined);
8200
8215
  __decorate([
8201
8216
  surfaceType('#FFFFFF')
8202
- ], exports.Frame.prototype, "fill", void 0);
8217
+ ], exports.Frame.prototype, "fill", undefined);
8203
8218
  __decorate([
8204
8219
  affectRenderBoundsType('hide')
8205
- ], exports.Frame.prototype, "overflow", void 0);
8220
+ ], exports.Frame.prototype, "overflow", undefined);
8206
8221
  exports.Frame = __decorate([
8207
8222
  registerUI()
8208
8223
  ], exports.Frame);
@@ -8249,16 +8264,16 @@ var LeaferUI = (function (exports) {
8249
8264
  };
8250
8265
  __decorate([
8251
8266
  dataProcessor(EllipseData)
8252
- ], exports.Ellipse.prototype, "__", void 0);
8267
+ ], exports.Ellipse.prototype, "__", undefined);
8253
8268
  __decorate([
8254
8269
  pathType(0)
8255
- ], exports.Ellipse.prototype, "innerRadius", void 0);
8270
+ ], exports.Ellipse.prototype, "innerRadius", undefined);
8256
8271
  __decorate([
8257
8272
  pathType(0)
8258
- ], exports.Ellipse.prototype, "startAngle", void 0);
8273
+ ], exports.Ellipse.prototype, "startAngle", undefined);
8259
8274
  __decorate([
8260
8275
  pathType(0)
8261
- ], exports.Ellipse.prototype, "endAngle", void 0);
8276
+ ], exports.Ellipse.prototype, "endAngle", undefined);
8262
8277
  exports.Ellipse = __decorate([
8263
8278
  registerUI()
8264
8279
  ], exports.Ellipse);
@@ -8317,22 +8332,22 @@ var LeaferUI = (function (exports) {
8317
8332
  };
8318
8333
  __decorate([
8319
8334
  dataProcessor(LineData)
8320
- ], exports.Line.prototype, "__", void 0);
8335
+ ], exports.Line.prototype, "__", undefined);
8321
8336
  __decorate([
8322
8337
  affectStrokeBoundsType('center')
8323
- ], exports.Line.prototype, "strokeAlign", void 0);
8338
+ ], exports.Line.prototype, "strokeAlign", undefined);
8324
8339
  __decorate([
8325
8340
  boundsType(0)
8326
- ], exports.Line.prototype, "height", void 0);
8341
+ ], exports.Line.prototype, "height", undefined);
8327
8342
  __decorate([
8328
8343
  pathType()
8329
- ], exports.Line.prototype, "points", void 0);
8344
+ ], exports.Line.prototype, "points", undefined);
8330
8345
  __decorate([
8331
8346
  pathType(0)
8332
- ], exports.Line.prototype, "curve", void 0);
8347
+ ], exports.Line.prototype, "curve", undefined);
8333
8348
  __decorate([
8334
8349
  pathType(false)
8335
- ], exports.Line.prototype, "closed", void 0);
8350
+ ], exports.Line.prototype, "closed", undefined);
8336
8351
  exports.Line = __decorate([
8337
8352
  registerUI()
8338
8353
  ], exports.Line);
@@ -8365,16 +8380,16 @@ var LeaferUI = (function (exports) {
8365
8380
  };
8366
8381
  __decorate([
8367
8382
  dataProcessor(PolygonData)
8368
- ], exports.Polygon.prototype, "__", void 0);
8383
+ ], exports.Polygon.prototype, "__", undefined);
8369
8384
  __decorate([
8370
8385
  pathType(3)
8371
- ], exports.Polygon.prototype, "sides", void 0);
8386
+ ], exports.Polygon.prototype, "sides", undefined);
8372
8387
  __decorate([
8373
8388
  pathType()
8374
- ], exports.Polygon.prototype, "points", void 0);
8389
+ ], exports.Polygon.prototype, "points", undefined);
8375
8390
  __decorate([
8376
8391
  pathType(0)
8377
- ], exports.Polygon.prototype, "curve", void 0);
8392
+ ], exports.Polygon.prototype, "curve", undefined);
8378
8393
  __decorate([
8379
8394
  rewrite(line.__updateRenderPath)
8380
8395
  ], exports.Polygon.prototype, "__updateRenderPath", null);
@@ -8406,13 +8421,13 @@ var LeaferUI = (function (exports) {
8406
8421
  };
8407
8422
  __decorate([
8408
8423
  dataProcessor(StarData)
8409
- ], exports.Star.prototype, "__", void 0);
8424
+ ], exports.Star.prototype, "__", undefined);
8410
8425
  __decorate([
8411
8426
  pathType(5)
8412
- ], exports.Star.prototype, "corners", void 0);
8427
+ ], exports.Star.prototype, "corners", undefined);
8413
8428
  __decorate([
8414
8429
  pathType(0.382)
8415
- ], exports.Star.prototype, "innerRadius", void 0);
8430
+ ], exports.Star.prototype, "innerRadius", undefined);
8416
8431
  exports.Star = __decorate([
8417
8432
  registerUI()
8418
8433
  ], exports.Star);
@@ -8434,10 +8449,10 @@ var LeaferUI = (function (exports) {
8434
8449
  };
8435
8450
  __decorate([
8436
8451
  dataProcessor(ImageData)
8437
- ], exports.Image.prototype, "__", void 0);
8452
+ ], exports.Image.prototype, "__", undefined);
8438
8453
  __decorate([
8439
8454
  boundsType('')
8440
- ], exports.Image.prototype, "url", void 0);
8455
+ ], exports.Image.prototype, "url", undefined);
8441
8456
  exports.Image = __decorate([
8442
8457
  registerUI()
8443
8458
  ], exports.Image);
@@ -8500,25 +8515,25 @@ var LeaferUI = (function (exports) {
8500
8515
  };
8501
8516
  __decorate([
8502
8517
  dataProcessor(CanvasData)
8503
- ], exports.Canvas.prototype, "__", void 0);
8518
+ ], exports.Canvas.prototype, "__", undefined);
8504
8519
  __decorate([
8505
8520
  resizeType(100)
8506
- ], exports.Canvas.prototype, "width", void 0);
8521
+ ], exports.Canvas.prototype, "width", undefined);
8507
8522
  __decorate([
8508
8523
  resizeType(100)
8509
- ], exports.Canvas.prototype, "height", void 0);
8524
+ ], exports.Canvas.prototype, "height", undefined);
8510
8525
  __decorate([
8511
8526
  resizeType(1)
8512
- ], exports.Canvas.prototype, "pixelRatio", void 0);
8527
+ ], exports.Canvas.prototype, "pixelRatio", undefined);
8513
8528
  __decorate([
8514
8529
  resizeType(true)
8515
- ], exports.Canvas.prototype, "smooth", void 0);
8530
+ ], exports.Canvas.prototype, "smooth", undefined);
8516
8531
  __decorate([
8517
8532
  dataType(false)
8518
- ], exports.Canvas.prototype, "safeResize", void 0);
8533
+ ], exports.Canvas.prototype, "safeResize", undefined);
8519
8534
  __decorate([
8520
8535
  resizeType()
8521
- ], exports.Canvas.prototype, "contextSettings", void 0);
8536
+ ], exports.Canvas.prototype, "contextSettings", undefined);
8522
8537
  exports.Canvas = __decorate([
8523
8538
  registerUI()
8524
8539
  ], exports.Canvas);
@@ -8609,76 +8624,76 @@ var LeaferUI = (function (exports) {
8609
8624
  };
8610
8625
  __decorate([
8611
8626
  dataProcessor(TextData)
8612
- ], exports.Text.prototype, "__", void 0);
8627
+ ], exports.Text.prototype, "__", undefined);
8613
8628
  __decorate([
8614
8629
  boundsType(0)
8615
- ], exports.Text.prototype, "width", void 0);
8630
+ ], exports.Text.prototype, "width", undefined);
8616
8631
  __decorate([
8617
8632
  boundsType(0)
8618
- ], exports.Text.prototype, "height", void 0);
8633
+ ], exports.Text.prototype, "height", undefined);
8619
8634
  __decorate([
8620
8635
  dataType(false)
8621
- ], exports.Text.prototype, "resizeFontSize", void 0);
8636
+ ], exports.Text.prototype, "resizeFontSize", undefined);
8622
8637
  __decorate([
8623
8638
  surfaceType('#000000')
8624
- ], exports.Text.prototype, "fill", void 0);
8639
+ ], exports.Text.prototype, "fill", undefined);
8625
8640
  __decorate([
8626
8641
  affectStrokeBoundsType('outside')
8627
- ], exports.Text.prototype, "strokeAlign", void 0);
8642
+ ], exports.Text.prototype, "strokeAlign", undefined);
8628
8643
  __decorate([
8629
8644
  hitType('all')
8630
- ], exports.Text.prototype, "hitFill", void 0);
8645
+ ], exports.Text.prototype, "hitFill", undefined);
8631
8646
  __decorate([
8632
8647
  boundsType('')
8633
- ], exports.Text.prototype, "text", void 0);
8648
+ ], exports.Text.prototype, "text", undefined);
8634
8649
  __decorate([
8635
- boundsType('L')
8636
- ], exports.Text.prototype, "fontFamily", void 0);
8650
+ boundsType('caption')
8651
+ ], exports.Text.prototype, "fontFamily", undefined);
8637
8652
  __decorate([
8638
8653
  boundsType(12)
8639
- ], exports.Text.prototype, "fontSize", void 0);
8654
+ ], exports.Text.prototype, "fontSize", undefined);
8640
8655
  __decorate([
8641
8656
  boundsType('normal')
8642
- ], exports.Text.prototype, "fontWeight", void 0);
8657
+ ], exports.Text.prototype, "fontWeight", undefined);
8643
8658
  __decorate([
8644
8659
  boundsType(false)
8645
- ], exports.Text.prototype, "italic", void 0);
8660
+ ], exports.Text.prototype, "italic", undefined);
8646
8661
  __decorate([
8647
8662
  boundsType('none')
8648
- ], exports.Text.prototype, "textCase", void 0);
8663
+ ], exports.Text.prototype, "textCase", undefined);
8649
8664
  __decorate([
8650
8665
  boundsType('none')
8651
- ], exports.Text.prototype, "textDecoration", void 0);
8666
+ ], exports.Text.prototype, "textDecoration", undefined);
8652
8667
  __decorate([
8653
8668
  boundsType(0)
8654
- ], exports.Text.prototype, "letterSpacing", void 0);
8669
+ ], exports.Text.prototype, "letterSpacing", undefined);
8655
8670
  __decorate([
8656
8671
  boundsType({ type: 'percent', value: 1.5 })
8657
- ], exports.Text.prototype, "lineHeight", void 0);
8672
+ ], exports.Text.prototype, "lineHeight", undefined);
8658
8673
  __decorate([
8659
8674
  boundsType(0)
8660
- ], exports.Text.prototype, "paraIndent", void 0);
8675
+ ], exports.Text.prototype, "paraIndent", undefined);
8661
8676
  __decorate([
8662
8677
  boundsType(0)
8663
- ], exports.Text.prototype, "paraSpacing", void 0);
8678
+ ], exports.Text.prototype, "paraSpacing", undefined);
8664
8679
  __decorate([
8665
8680
  boundsType('x')
8666
- ], exports.Text.prototype, "writingMode", void 0);
8681
+ ], exports.Text.prototype, "writingMode", undefined);
8667
8682
  __decorate([
8668
8683
  boundsType('left')
8669
- ], exports.Text.prototype, "textAlign", void 0);
8684
+ ], exports.Text.prototype, "textAlign", undefined);
8670
8685
  __decorate([
8671
8686
  boundsType('top')
8672
- ], exports.Text.prototype, "verticalAlign", void 0);
8687
+ ], exports.Text.prototype, "verticalAlign", undefined);
8673
8688
  __decorate([
8674
8689
  boundsType(true)
8675
- ], exports.Text.prototype, "autoSizeAlign", void 0);
8690
+ ], exports.Text.prototype, "autoSizeAlign", undefined);
8676
8691
  __decorate([
8677
8692
  boundsType('normal')
8678
- ], exports.Text.prototype, "textWrap", void 0);
8693
+ ], exports.Text.prototype, "textWrap", undefined);
8679
8694
  __decorate([
8680
8695
  boundsType('show')
8681
- ], exports.Text.prototype, "textOverflow", void 0);
8696
+ ], exports.Text.prototype, "textOverflow", undefined);
8682
8697
  exports.Text = __decorate([
8683
8698
  registerUI()
8684
8699
  ], exports.Text);
@@ -8691,10 +8706,10 @@ var LeaferUI = (function (exports) {
8691
8706
  };
8692
8707
  __decorate([
8693
8708
  dataProcessor(PathData)
8694
- ], exports.Path.prototype, "__", void 0);
8709
+ ], exports.Path.prototype, "__", undefined);
8695
8710
  __decorate([
8696
8711
  affectStrokeBoundsType('center')
8697
- ], exports.Path.prototype, "strokeAlign", void 0);
8712
+ ], exports.Path.prototype, "strokeAlign", undefined);
8698
8713
  exports.Path = __decorate([
8699
8714
  registerUI()
8700
8715
  ], exports.Path);
@@ -8733,10 +8748,10 @@ var LeaferUI = (function (exports) {
8733
8748
  };
8734
8749
  __decorate([
8735
8750
  dataProcessor(PenData)
8736
- ], exports.Pen.prototype, "__", void 0);
8751
+ ], exports.Pen.prototype, "__", undefined);
8737
8752
  __decorate([
8738
8753
  penPathType()
8739
- ], exports.Pen.prototype, "path", void 0);
8754
+ ], exports.Pen.prototype, "path", undefined);
8740
8755
  exports.Pen = __decorate([
8741
8756
  useModule(PathCreator, ['set', 'path', 'paint']),
8742
8757
  registerUI()
@@ -9921,9 +9936,9 @@ var LeaferUI = (function (exports) {
9921
9936
  }
9922
9937
  return this.__hit(inner);
9923
9938
  };
9924
- leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitFill(inner, this.__.windingRule); };
9925
- leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitStroke(inner, strokeWidth); };
9926
- leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitPixel(inner, this.__layout.renderBounds, this.__hitCanvas.hitScale); };
9939
+ leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitFill(inner, this.__.windingRule); };
9940
+ leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitStroke(inner, strokeWidth); };
9941
+ leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitPixel(inner, this.__layout.renderBounds, this.__hitCanvas.hitScale); };
9927
9942
  leaf.__drawHitPath = function (canvas) { if (canvas)
9928
9943
  this.__drawRenderPath(canvas); };
9929
9944
 
@@ -10658,7 +10673,7 @@ var LeaferUI = (function (exports) {
10658
10673
  }
10659
10674
  else {
10660
10675
  if (!paint.patternTask) {
10661
- paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
10676
+ paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
10662
10677
  paint.patternTask = null;
10663
10678
  if (canvas.bounds.hit(ui.__nowWorld))
10664
10679
  createPattern(ui, paint, pixelRatio);
@@ -10814,7 +10829,7 @@ var LeaferUI = (function (exports) {
10814
10829
  const end = shadow.length - 1;
10815
10830
  toOffsetOutBounds$1(bounds, offsetOutBounds$1);
10816
10831
  shadow.forEach((item, index) => {
10817
- other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, item.color);
10832
+ other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, ColorConvert.string(item.color));
10818
10833
  spreadScale = item.spread ? 1 + item.spread * 2 / (__layout.boxBounds.width + (__layout.strokeBoxSpread || 0) * 2) : 0;
10819
10834
  drawWorldShadow(other, offsetOutBounds$1, spreadScale, shape);
10820
10835
  copyBounds = bounds;
@@ -10890,7 +10905,7 @@ var LeaferUI = (function (exports) {
10890
10905
  other.copyWorld(shape.canvas, shapeBounds, bounds, 'source-out');
10891
10906
  copyBounds = bounds;
10892
10907
  }
10893
- other.fillWorld(copyBounds, item.color, 'source-in');
10908
+ other.fillWorld(copyBounds, ColorConvert.string(item.color), 'source-in');
10894
10909
  if (ui.__worldFlipped) {
10895
10910
  current.copyWorldByReset(other, copyBounds, nowWorld, item.blendMode);
10896
10911
  }
@@ -11252,7 +11267,7 @@ var LeaferUI = (function (exports) {
11252
11267
  rows.forEach(row => {
11253
11268
  if (row.words) {
11254
11269
  indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
11255
- addWordWidth = (width && textAlign === 'justify' && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
11270
+ addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
11256
11271
  mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
11257
11272
  if (row.isOverflow && !letterSpacing)
11258
11273
  row.textMode = true;
@@ -11274,7 +11289,7 @@ var LeaferUI = (function (exports) {
11274
11289
  else {
11275
11290
  charX = toChar(word.data, charX, row.data, row.isOverflow);
11276
11291
  }
11277
- if (!row.paraEnd && addWordWidth) {
11292
+ if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
11278
11293
  charX += addWordWidth;
11279
11294
  row.width += addWordWidth;
11280
11295
  }