leafer-draw 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/web.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
  const debug$4 = Debug.get('LeaferCanvas');
6016
6019
  class LeaferCanvas extends LeaferCanvasBase {
@@ -6229,7 +6232,7 @@ var LeaferUI = (function (exports) {
6229
6232
  },
6230
6233
  loadImage(src) {
6231
6234
  return new Promise((resolve, reject) => {
6232
- const img = new Image();
6235
+ const img = new Platform.origin.Image();
6233
6236
  const { crossOrigin } = Platform.image;
6234
6237
  if (crossOrigin) {
6235
6238
  img.setAttribute('crossOrigin', crossOrigin);
@@ -6239,7 +6242,10 @@ var LeaferUI = (function (exports) {
6239
6242
  img.onerror = (e) => { reject(e); };
6240
6243
  img.src = Platform.image.getRealURL(src);
6241
6244
  });
6242
- }
6245
+ },
6246
+ Image,
6247
+ PointerEvent,
6248
+ DragEvent
6243
6249
  };
6244
6250
  Platform.event = {
6245
6251
  stopDefault(origin) { origin.preventDefault(); },
@@ -6528,7 +6534,7 @@ var LeaferUI = (function (exports) {
6528
6534
  }
6529
6535
  partLayout() {
6530
6536
  var _a;
6531
- if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
6537
+ if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
6532
6538
  return;
6533
6539
  const t = Run.start('PartLayout');
6534
6540
  const { target, __updatedList: updateList } = this;
@@ -6715,7 +6721,7 @@ var LeaferUI = (function (exports) {
6715
6721
  partRender() {
6716
6722
  const { canvas, updateBlocks: list } = this;
6717
6723
  if (!list)
6718
- return debug$2.warn('PartRender: need update attr');
6724
+ return;
6719
6725
  this.mergeBlocks();
6720
6726
  list.forEach(block => { if (canvas.bounds.hit(block) && !block.isEmpty())
6721
6727
  this.clipRender(block); });
@@ -6943,6 +6949,7 @@ var LeaferUI = (function (exports) {
6943
6949
  return t.fill && this.__hasStroke;
6944
6950
  }
6945
6951
  get __clipAfterFill() { const t = this; return (t.cornerRadius || t.innerShadow || t.__pathInputed); }
6952
+ get __hasSurface() { const t = this; return (t.fill || t.stroke); }
6946
6953
  get __autoWidth() { return !this._width; }
6947
6954
  get __autoHeight() { return !this._height; }
6948
6955
  get __autoSide() { return !this._width || !this._height; }
@@ -7415,7 +7422,7 @@ var LeaferUI = (function (exports) {
7415
7422
  animate(_keyframe, _options, _type, _isTemp) {
7416
7423
  return Plugin.need('animate');
7417
7424
  }
7418
- killAnimate(_type, _killStyle) { }
7425
+ killAnimate(_type, _nextStyle) { }
7419
7426
  export(_filename, _options) {
7420
7427
  return Plugin.need('export');
7421
7428
  }
@@ -7446,199 +7453,199 @@ var LeaferUI = (function (exports) {
7446
7453
  };
7447
7454
  __decorate([
7448
7455
  dataProcessor(UIData)
7449
- ], exports.UI.prototype, "__", void 0);
7456
+ ], exports.UI.prototype, "__", undefined);
7450
7457
  __decorate([
7451
7458
  zoomLayerType()
7452
- ], exports.UI.prototype, "zoomLayer", void 0);
7459
+ ], exports.UI.prototype, "zoomLayer", undefined);
7453
7460
  __decorate([
7454
7461
  dataType('')
7455
- ], exports.UI.prototype, "id", void 0);
7462
+ ], exports.UI.prototype, "id", undefined);
7456
7463
  __decorate([
7457
7464
  dataType('')
7458
- ], exports.UI.prototype, "name", void 0);
7465
+ ], exports.UI.prototype, "name", undefined);
7459
7466
  __decorate([
7460
7467
  dataType('')
7461
- ], exports.UI.prototype, "className", void 0);
7468
+ ], exports.UI.prototype, "className", undefined);
7462
7469
  __decorate([
7463
7470
  surfaceType('pass-through')
7464
- ], exports.UI.prototype, "blendMode", void 0);
7471
+ ], exports.UI.prototype, "blendMode", undefined);
7465
7472
  __decorate([
7466
7473
  opacityType(1)
7467
- ], exports.UI.prototype, "opacity", void 0);
7474
+ ], exports.UI.prototype, "opacity", undefined);
7468
7475
  __decorate([
7469
7476
  visibleType(true)
7470
- ], exports.UI.prototype, "visible", void 0);
7477
+ ], exports.UI.prototype, "visible", undefined);
7471
7478
  __decorate([
7472
7479
  surfaceType(false)
7473
- ], exports.UI.prototype, "locked", void 0);
7480
+ ], exports.UI.prototype, "locked", undefined);
7474
7481
  __decorate([
7475
7482
  sortType(0)
7476
- ], exports.UI.prototype, "zIndex", void 0);
7483
+ ], exports.UI.prototype, "zIndex", undefined);
7477
7484
  __decorate([
7478
7485
  maskType(false)
7479
- ], exports.UI.prototype, "mask", void 0);
7486
+ ], exports.UI.prototype, "mask", undefined);
7480
7487
  __decorate([
7481
7488
  eraserType(false)
7482
- ], exports.UI.prototype, "eraser", void 0);
7489
+ ], exports.UI.prototype, "eraser", undefined);
7483
7490
  __decorate([
7484
7491
  positionType(0, true)
7485
- ], exports.UI.prototype, "x", void 0);
7492
+ ], exports.UI.prototype, "x", undefined);
7486
7493
  __decorate([
7487
7494
  positionType(0, true)
7488
- ], exports.UI.prototype, "y", void 0);
7495
+ ], exports.UI.prototype, "y", undefined);
7489
7496
  __decorate([
7490
7497
  boundsType(100, true)
7491
- ], exports.UI.prototype, "width", void 0);
7498
+ ], exports.UI.prototype, "width", undefined);
7492
7499
  __decorate([
7493
7500
  boundsType(100, true)
7494
- ], exports.UI.prototype, "height", void 0);
7501
+ ], exports.UI.prototype, "height", undefined);
7495
7502
  __decorate([
7496
7503
  scaleType(1, true)
7497
- ], exports.UI.prototype, "scaleX", void 0);
7504
+ ], exports.UI.prototype, "scaleX", undefined);
7498
7505
  __decorate([
7499
7506
  scaleType(1, true)
7500
- ], exports.UI.prototype, "scaleY", void 0);
7507
+ ], exports.UI.prototype, "scaleY", undefined);
7501
7508
  __decorate([
7502
7509
  rotationType(0, true)
7503
- ], exports.UI.prototype, "rotation", void 0);
7510
+ ], exports.UI.prototype, "rotation", undefined);
7504
7511
  __decorate([
7505
7512
  rotationType(0, true)
7506
- ], exports.UI.prototype, "skewX", void 0);
7513
+ ], exports.UI.prototype, "skewX", undefined);
7507
7514
  __decorate([
7508
7515
  rotationType(0, true)
7509
- ], exports.UI.prototype, "skewY", void 0);
7516
+ ], exports.UI.prototype, "skewY", undefined);
7510
7517
  __decorate([
7511
7518
  positionType(0, true)
7512
- ], exports.UI.prototype, "offsetX", void 0);
7519
+ ], exports.UI.prototype, "offsetX", undefined);
7513
7520
  __decorate([
7514
7521
  positionType(0, true)
7515
- ], exports.UI.prototype, "offsetY", void 0);
7522
+ ], exports.UI.prototype, "offsetY", undefined);
7516
7523
  __decorate([
7517
7524
  positionType(0, true)
7518
- ], exports.UI.prototype, "scrollX", void 0);
7525
+ ], exports.UI.prototype, "scrollX", undefined);
7519
7526
  __decorate([
7520
7527
  positionType(0, true)
7521
- ], exports.UI.prototype, "scrollY", void 0);
7528
+ ], exports.UI.prototype, "scrollY", undefined);
7522
7529
  __decorate([
7523
7530
  autoLayoutType()
7524
- ], exports.UI.prototype, "origin", void 0);
7531
+ ], exports.UI.prototype, "origin", undefined);
7525
7532
  __decorate([
7526
7533
  autoLayoutType()
7527
- ], exports.UI.prototype, "around", void 0);
7534
+ ], exports.UI.prototype, "around", undefined);
7528
7535
  __decorate([
7529
7536
  dataType(false)
7530
- ], exports.UI.prototype, "lazy", void 0);
7537
+ ], exports.UI.prototype, "lazy", undefined);
7531
7538
  __decorate([
7532
7539
  naturalBoundsType(1)
7533
- ], exports.UI.prototype, "pixelRatio", void 0);
7540
+ ], exports.UI.prototype, "pixelRatio", undefined);
7534
7541
  __decorate([
7535
7542
  pathInputType()
7536
- ], exports.UI.prototype, "path", void 0);
7543
+ ], exports.UI.prototype, "path", undefined);
7537
7544
  __decorate([
7538
7545
  pathType()
7539
- ], exports.UI.prototype, "windingRule", void 0);
7546
+ ], exports.UI.prototype, "windingRule", undefined);
7540
7547
  __decorate([
7541
7548
  pathType(true)
7542
- ], exports.UI.prototype, "closed", void 0);
7549
+ ], exports.UI.prototype, "closed", undefined);
7543
7550
  __decorate([
7544
7551
  boundsType(0)
7545
- ], exports.UI.prototype, "padding", void 0);
7552
+ ], exports.UI.prototype, "padding", undefined);
7546
7553
  __decorate([
7547
7554
  boundsType(false)
7548
- ], exports.UI.prototype, "lockRatio", void 0);
7555
+ ], exports.UI.prototype, "lockRatio", undefined);
7549
7556
  __decorate([
7550
7557
  boundsType()
7551
- ], exports.UI.prototype, "widthRange", void 0);
7558
+ ], exports.UI.prototype, "widthRange", undefined);
7552
7559
  __decorate([
7553
7560
  boundsType()
7554
- ], exports.UI.prototype, "heightRange", void 0);
7561
+ ], exports.UI.prototype, "heightRange", undefined);
7555
7562
  __decorate([
7556
7563
  dataType(false)
7557
- ], exports.UI.prototype, "draggable", void 0);
7564
+ ], exports.UI.prototype, "draggable", undefined);
7558
7565
  __decorate([
7559
7566
  dataType()
7560
- ], exports.UI.prototype, "dragBounds", void 0);
7567
+ ], exports.UI.prototype, "dragBounds", undefined);
7561
7568
  __decorate([
7562
7569
  dataType(false)
7563
- ], exports.UI.prototype, "editable", void 0);
7570
+ ], exports.UI.prototype, "editable", undefined);
7564
7571
  __decorate([
7565
7572
  hitType(true)
7566
- ], exports.UI.prototype, "hittable", void 0);
7573
+ ], exports.UI.prototype, "hittable", undefined);
7567
7574
  __decorate([
7568
7575
  hitType('path')
7569
- ], exports.UI.prototype, "hitFill", void 0);
7576
+ ], exports.UI.prototype, "hitFill", undefined);
7570
7577
  __decorate([
7571
7578
  strokeType('path')
7572
- ], exports.UI.prototype, "hitStroke", void 0);
7579
+ ], exports.UI.prototype, "hitStroke", undefined);
7573
7580
  __decorate([
7574
7581
  hitType(false)
7575
- ], exports.UI.prototype, "hitBox", void 0);
7582
+ ], exports.UI.prototype, "hitBox", undefined);
7576
7583
  __decorate([
7577
7584
  hitType(true)
7578
- ], exports.UI.prototype, "hitChildren", void 0);
7585
+ ], exports.UI.prototype, "hitChildren", undefined);
7579
7586
  __decorate([
7580
7587
  hitType(true)
7581
- ], exports.UI.prototype, "hitSelf", void 0);
7588
+ ], exports.UI.prototype, "hitSelf", undefined);
7582
7589
  __decorate([
7583
7590
  hitType()
7584
- ], exports.UI.prototype, "hitRadius", void 0);
7591
+ ], exports.UI.prototype, "hitRadius", undefined);
7585
7592
  __decorate([
7586
7593
  cursorType('')
7587
- ], exports.UI.prototype, "cursor", void 0);
7594
+ ], exports.UI.prototype, "cursor", undefined);
7588
7595
  __decorate([
7589
7596
  surfaceType()
7590
- ], exports.UI.prototype, "fill", void 0);
7597
+ ], exports.UI.prototype, "fill", undefined);
7591
7598
  __decorate([
7592
7599
  strokeType()
7593
- ], exports.UI.prototype, "stroke", void 0);
7600
+ ], exports.UI.prototype, "stroke", undefined);
7594
7601
  __decorate([
7595
7602
  strokeType('inside')
7596
- ], exports.UI.prototype, "strokeAlign", void 0);
7603
+ ], exports.UI.prototype, "strokeAlign", undefined);
7597
7604
  __decorate([
7598
7605
  strokeType(1)
7599
- ], exports.UI.prototype, "strokeWidth", void 0);
7606
+ ], exports.UI.prototype, "strokeWidth", undefined);
7600
7607
  __decorate([
7601
7608
  strokeType(false)
7602
- ], exports.UI.prototype, "strokeWidthFixed", void 0);
7609
+ ], exports.UI.prototype, "strokeWidthFixed", undefined);
7603
7610
  __decorate([
7604
7611
  strokeType('none')
7605
- ], exports.UI.prototype, "strokeCap", void 0);
7612
+ ], exports.UI.prototype, "strokeCap", undefined);
7606
7613
  __decorate([
7607
7614
  strokeType('miter')
7608
- ], exports.UI.prototype, "strokeJoin", void 0);
7615
+ ], exports.UI.prototype, "strokeJoin", undefined);
7609
7616
  __decorate([
7610
7617
  strokeType()
7611
- ], exports.UI.prototype, "dashPattern", void 0);
7618
+ ], exports.UI.prototype, "dashPattern", undefined);
7612
7619
  __decorate([
7613
7620
  strokeType()
7614
- ], exports.UI.prototype, "dashOffset", void 0);
7621
+ ], exports.UI.prototype, "dashOffset", undefined);
7615
7622
  __decorate([
7616
7623
  strokeType(10)
7617
- ], exports.UI.prototype, "miterLimit", void 0);
7624
+ ], exports.UI.prototype, "miterLimit", undefined);
7618
7625
  __decorate([
7619
7626
  pathType(0)
7620
- ], exports.UI.prototype, "cornerRadius", void 0);
7627
+ ], exports.UI.prototype, "cornerRadius", undefined);
7621
7628
  __decorate([
7622
7629
  pathType()
7623
- ], exports.UI.prototype, "cornerSmoothing", void 0);
7630
+ ], exports.UI.prototype, "cornerSmoothing", undefined);
7624
7631
  __decorate([
7625
7632
  effectType()
7626
- ], exports.UI.prototype, "shadow", void 0);
7633
+ ], exports.UI.prototype, "shadow", undefined);
7627
7634
  __decorate([
7628
7635
  effectType()
7629
- ], exports.UI.prototype, "innerShadow", void 0);
7636
+ ], exports.UI.prototype, "innerShadow", undefined);
7630
7637
  __decorate([
7631
7638
  effectType()
7632
- ], exports.UI.prototype, "blur", void 0);
7639
+ ], exports.UI.prototype, "blur", undefined);
7633
7640
  __decorate([
7634
7641
  effectType()
7635
- ], exports.UI.prototype, "backgroundBlur", void 0);
7642
+ ], exports.UI.prototype, "backgroundBlur", undefined);
7636
7643
  __decorate([
7637
7644
  effectType()
7638
- ], exports.UI.prototype, "grayscale", void 0);
7645
+ ], exports.UI.prototype, "grayscale", undefined);
7639
7646
  __decorate([
7640
7647
  dataType({})
7641
- ], exports.UI.prototype, "data", void 0);
7648
+ ], exports.UI.prototype, "data", undefined);
7642
7649
  __decorate([
7643
7650
  rewrite(exports.Leaf.prototype.reset)
7644
7651
  ], exports.UI.prototype, "reset", null);
@@ -7699,7 +7706,7 @@ var LeaferUI = (function (exports) {
7699
7706
  };
7700
7707
  __decorate([
7701
7708
  dataProcessor(GroupData)
7702
- ], exports.Group.prototype, "__", void 0);
7709
+ ], exports.Group.prototype, "__", undefined);
7703
7710
  exports.Group = __decorate([
7704
7711
  useModule(exports.Branch),
7705
7712
  registerUI()
@@ -7870,8 +7877,6 @@ var LeaferUI = (function (exports) {
7870
7877
  __setAttr(attrName, newValue) {
7871
7878
  if (this.canvas) {
7872
7879
  if (canvasSizeAttrs.includes(attrName)) {
7873
- if (!newValue)
7874
- debug.warn(attrName + ' is 0');
7875
7880
  this.__changeCanvasSize(attrName, newValue);
7876
7881
  }
7877
7882
  else if (attrName === 'fill') {
@@ -7911,8 +7916,6 @@ var LeaferUI = (function (exports) {
7911
7916
  this.created = true;
7912
7917
  }
7913
7918
  __onReady() {
7914
- if (this.ready)
7915
- return;
7916
7919
  this.ready = true;
7917
7920
  this.emitLeafer(LeaferEvent.BEFORE_READY);
7918
7921
  this.emitLeafer(LeaferEvent.READY);
@@ -7926,6 +7929,20 @@ var LeaferUI = (function (exports) {
7926
7929
  this.emitLeafer(LeaferEvent.VIEW_READY);
7927
7930
  WaitHelper.run(this.__viewReadyWait);
7928
7931
  }
7932
+ __onLayoutEnd() {
7933
+ const { grow, growWidth, growHeight } = this.config;
7934
+ if (grow) {
7935
+ let { width, height, pixelRatio } = this;
7936
+ const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
7937
+ if (growWidth !== false)
7938
+ width = Math.max(1, bounds.x + bounds.width);
7939
+ if (growHeight !== false)
7940
+ height = Math.max(1, bounds.y + bounds.height);
7941
+ this.__doResize({ width, height, pixelRatio });
7942
+ }
7943
+ if (!this.ready)
7944
+ this.__onReady();
7945
+ }
7929
7946
  __onNextRender() {
7930
7947
  if (this.viewReady) {
7931
7948
  WaitHelper.run(this.__nextRenderWait);
@@ -8019,10 +8036,9 @@ var LeaferUI = (function (exports) {
8019
8036
  const runId = Run.start('FirstCreate ' + this.innerName);
8020
8037
  this.once(LeaferEvent.START, () => Run.end(runId));
8021
8038
  this.once(LayoutEvent.START, () => this.updateLazyBounds());
8022
- this.once(LayoutEvent.END, () => this.__onReady());
8023
8039
  this.once(RenderEvent.START, () => this.__onCreated());
8024
8040
  this.once(RenderEvent.END, () => this.__onViewReady());
8025
- this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
8041
+ this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(LayoutEvent.END, this.__onLayoutEnd, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
8026
8042
  }
8027
8043
  __removeListenEvents() {
8028
8044
  this.off_(this.__eventIds);
@@ -8063,10 +8079,10 @@ var LeaferUI = (function (exports) {
8063
8079
  exports.Leafer.list = new LeafList();
8064
8080
  __decorate([
8065
8081
  dataProcessor(LeaferData)
8066
- ], exports.Leafer.prototype, "__", void 0);
8082
+ ], exports.Leafer.prototype, "__", undefined);
8067
8083
  __decorate([
8068
8084
  boundsType()
8069
- ], exports.Leafer.prototype, "pixelRatio", void 0);
8085
+ ], exports.Leafer.prototype, "pixelRatio", undefined);
8070
8086
  exports.Leafer = Leafer_1 = __decorate([
8071
8087
  registerUI()
8072
8088
  ], exports.Leafer);
@@ -8079,7 +8095,7 @@ var LeaferUI = (function (exports) {
8079
8095
  };
8080
8096
  __decorate([
8081
8097
  dataProcessor(RectData)
8082
- ], exports.Rect.prototype, "__", void 0);
8098
+ ], exports.Rect.prototype, "__", undefined);
8083
8099
  exports.Rect = __decorate([
8084
8100
  useModule(RectRender),
8085
8101
  rewriteAble(),
@@ -8104,6 +8120,8 @@ var LeaferUI = (function (exports) {
8104
8120
  const data = this.__;
8105
8121
  if (this.children.length) {
8106
8122
  if (data.__autoSide) {
8123
+ if (data.__hasSurface)
8124
+ this.__extraUpdate();
8107
8125
  super.__updateBoxBounds();
8108
8126
  const { boxBounds } = this.__layout;
8109
8127
  if (!data.__autoSize) {
@@ -8168,13 +8186,13 @@ var LeaferUI = (function (exports) {
8168
8186
  };
8169
8187
  __decorate([
8170
8188
  dataProcessor(BoxData)
8171
- ], exports.Box.prototype, "__", void 0);
8189
+ ], exports.Box.prototype, "__", undefined);
8172
8190
  __decorate([
8173
8191
  dataType(false)
8174
- ], exports.Box.prototype, "resizeChildren", void 0);
8192
+ ], exports.Box.prototype, "resizeChildren", undefined);
8175
8193
  __decorate([
8176
8194
  affectRenderBoundsType('show')
8177
- ], exports.Box.prototype, "overflow", void 0);
8195
+ ], exports.Box.prototype, "overflow", undefined);
8178
8196
  __decorate([
8179
8197
  rewrite(rect.__updateStrokeSpread)
8180
8198
  ], exports.Box.prototype, "__updateStrokeSpread", null);
@@ -8213,13 +8231,13 @@ var LeaferUI = (function (exports) {
8213
8231
  };
8214
8232
  __decorate([
8215
8233
  dataProcessor(FrameData)
8216
- ], exports.Frame.prototype, "__", void 0);
8234
+ ], exports.Frame.prototype, "__", undefined);
8217
8235
  __decorate([
8218
8236
  surfaceType('#FFFFFF')
8219
- ], exports.Frame.prototype, "fill", void 0);
8237
+ ], exports.Frame.prototype, "fill", undefined);
8220
8238
  __decorate([
8221
8239
  affectRenderBoundsType('hide')
8222
- ], exports.Frame.prototype, "overflow", void 0);
8240
+ ], exports.Frame.prototype, "overflow", undefined);
8223
8241
  exports.Frame = __decorate([
8224
8242
  registerUI()
8225
8243
  ], exports.Frame);
@@ -8266,16 +8284,16 @@ var LeaferUI = (function (exports) {
8266
8284
  };
8267
8285
  __decorate([
8268
8286
  dataProcessor(EllipseData)
8269
- ], exports.Ellipse.prototype, "__", void 0);
8287
+ ], exports.Ellipse.prototype, "__", undefined);
8270
8288
  __decorate([
8271
8289
  pathType(0)
8272
- ], exports.Ellipse.prototype, "innerRadius", void 0);
8290
+ ], exports.Ellipse.prototype, "innerRadius", undefined);
8273
8291
  __decorate([
8274
8292
  pathType(0)
8275
- ], exports.Ellipse.prototype, "startAngle", void 0);
8293
+ ], exports.Ellipse.prototype, "startAngle", undefined);
8276
8294
  __decorate([
8277
8295
  pathType(0)
8278
- ], exports.Ellipse.prototype, "endAngle", void 0);
8296
+ ], exports.Ellipse.prototype, "endAngle", undefined);
8279
8297
  exports.Ellipse = __decorate([
8280
8298
  registerUI()
8281
8299
  ], exports.Ellipse);
@@ -8334,22 +8352,22 @@ var LeaferUI = (function (exports) {
8334
8352
  };
8335
8353
  __decorate([
8336
8354
  dataProcessor(LineData)
8337
- ], exports.Line.prototype, "__", void 0);
8355
+ ], exports.Line.prototype, "__", undefined);
8338
8356
  __decorate([
8339
8357
  affectStrokeBoundsType('center')
8340
- ], exports.Line.prototype, "strokeAlign", void 0);
8358
+ ], exports.Line.prototype, "strokeAlign", undefined);
8341
8359
  __decorate([
8342
8360
  boundsType(0)
8343
- ], exports.Line.prototype, "height", void 0);
8361
+ ], exports.Line.prototype, "height", undefined);
8344
8362
  __decorate([
8345
8363
  pathType()
8346
- ], exports.Line.prototype, "points", void 0);
8364
+ ], exports.Line.prototype, "points", undefined);
8347
8365
  __decorate([
8348
8366
  pathType(0)
8349
- ], exports.Line.prototype, "curve", void 0);
8367
+ ], exports.Line.prototype, "curve", undefined);
8350
8368
  __decorate([
8351
8369
  pathType(false)
8352
- ], exports.Line.prototype, "closed", void 0);
8370
+ ], exports.Line.prototype, "closed", undefined);
8353
8371
  exports.Line = __decorate([
8354
8372
  registerUI()
8355
8373
  ], exports.Line);
@@ -8382,16 +8400,16 @@ var LeaferUI = (function (exports) {
8382
8400
  };
8383
8401
  __decorate([
8384
8402
  dataProcessor(PolygonData)
8385
- ], exports.Polygon.prototype, "__", void 0);
8403
+ ], exports.Polygon.prototype, "__", undefined);
8386
8404
  __decorate([
8387
8405
  pathType(3)
8388
- ], exports.Polygon.prototype, "sides", void 0);
8406
+ ], exports.Polygon.prototype, "sides", undefined);
8389
8407
  __decorate([
8390
8408
  pathType()
8391
- ], exports.Polygon.prototype, "points", void 0);
8409
+ ], exports.Polygon.prototype, "points", undefined);
8392
8410
  __decorate([
8393
8411
  pathType(0)
8394
- ], exports.Polygon.prototype, "curve", void 0);
8412
+ ], exports.Polygon.prototype, "curve", undefined);
8395
8413
  __decorate([
8396
8414
  rewrite(line.__updateRenderPath)
8397
8415
  ], exports.Polygon.prototype, "__updateRenderPath", null);
@@ -8423,13 +8441,13 @@ var LeaferUI = (function (exports) {
8423
8441
  };
8424
8442
  __decorate([
8425
8443
  dataProcessor(StarData)
8426
- ], exports.Star.prototype, "__", void 0);
8444
+ ], exports.Star.prototype, "__", undefined);
8427
8445
  __decorate([
8428
8446
  pathType(5)
8429
- ], exports.Star.prototype, "corners", void 0);
8447
+ ], exports.Star.prototype, "corners", undefined);
8430
8448
  __decorate([
8431
8449
  pathType(0.382)
8432
- ], exports.Star.prototype, "innerRadius", void 0);
8450
+ ], exports.Star.prototype, "innerRadius", undefined);
8433
8451
  exports.Star = __decorate([
8434
8452
  registerUI()
8435
8453
  ], exports.Star);
@@ -8451,10 +8469,10 @@ var LeaferUI = (function (exports) {
8451
8469
  };
8452
8470
  __decorate([
8453
8471
  dataProcessor(ImageData)
8454
- ], exports.Image.prototype, "__", void 0);
8472
+ ], exports.Image.prototype, "__", undefined);
8455
8473
  __decorate([
8456
8474
  boundsType('')
8457
- ], exports.Image.prototype, "url", void 0);
8475
+ ], exports.Image.prototype, "url", undefined);
8458
8476
  exports.Image = __decorate([
8459
8477
  registerUI()
8460
8478
  ], exports.Image);
@@ -8517,25 +8535,25 @@ var LeaferUI = (function (exports) {
8517
8535
  };
8518
8536
  __decorate([
8519
8537
  dataProcessor(CanvasData)
8520
- ], exports.Canvas.prototype, "__", void 0);
8538
+ ], exports.Canvas.prototype, "__", undefined);
8521
8539
  __decorate([
8522
8540
  resizeType(100)
8523
- ], exports.Canvas.prototype, "width", void 0);
8541
+ ], exports.Canvas.prototype, "width", undefined);
8524
8542
  __decorate([
8525
8543
  resizeType(100)
8526
- ], exports.Canvas.prototype, "height", void 0);
8544
+ ], exports.Canvas.prototype, "height", undefined);
8527
8545
  __decorate([
8528
8546
  resizeType(1)
8529
- ], exports.Canvas.prototype, "pixelRatio", void 0);
8547
+ ], exports.Canvas.prototype, "pixelRatio", undefined);
8530
8548
  __decorate([
8531
8549
  resizeType(true)
8532
- ], exports.Canvas.prototype, "smooth", void 0);
8550
+ ], exports.Canvas.prototype, "smooth", undefined);
8533
8551
  __decorate([
8534
8552
  dataType(false)
8535
- ], exports.Canvas.prototype, "safeResize", void 0);
8553
+ ], exports.Canvas.prototype, "safeResize", undefined);
8536
8554
  __decorate([
8537
8555
  resizeType()
8538
- ], exports.Canvas.prototype, "contextSettings", void 0);
8556
+ ], exports.Canvas.prototype, "contextSettings", undefined);
8539
8557
  exports.Canvas = __decorate([
8540
8558
  registerUI()
8541
8559
  ], exports.Canvas);
@@ -8626,76 +8644,76 @@ var LeaferUI = (function (exports) {
8626
8644
  };
8627
8645
  __decorate([
8628
8646
  dataProcessor(TextData)
8629
- ], exports.Text.prototype, "__", void 0);
8647
+ ], exports.Text.prototype, "__", undefined);
8630
8648
  __decorate([
8631
8649
  boundsType(0)
8632
- ], exports.Text.prototype, "width", void 0);
8650
+ ], exports.Text.prototype, "width", undefined);
8633
8651
  __decorate([
8634
8652
  boundsType(0)
8635
- ], exports.Text.prototype, "height", void 0);
8653
+ ], exports.Text.prototype, "height", undefined);
8636
8654
  __decorate([
8637
8655
  dataType(false)
8638
- ], exports.Text.prototype, "resizeFontSize", void 0);
8656
+ ], exports.Text.prototype, "resizeFontSize", undefined);
8639
8657
  __decorate([
8640
8658
  surfaceType('#000000')
8641
- ], exports.Text.prototype, "fill", void 0);
8659
+ ], exports.Text.prototype, "fill", undefined);
8642
8660
  __decorate([
8643
8661
  affectStrokeBoundsType('outside')
8644
- ], exports.Text.prototype, "strokeAlign", void 0);
8662
+ ], exports.Text.prototype, "strokeAlign", undefined);
8645
8663
  __decorate([
8646
8664
  hitType('all')
8647
- ], exports.Text.prototype, "hitFill", void 0);
8665
+ ], exports.Text.prototype, "hitFill", undefined);
8648
8666
  __decorate([
8649
8667
  boundsType('')
8650
- ], exports.Text.prototype, "text", void 0);
8668
+ ], exports.Text.prototype, "text", undefined);
8651
8669
  __decorate([
8652
- boundsType('L')
8653
- ], exports.Text.prototype, "fontFamily", void 0);
8670
+ boundsType('caption')
8671
+ ], exports.Text.prototype, "fontFamily", undefined);
8654
8672
  __decorate([
8655
8673
  boundsType(12)
8656
- ], exports.Text.prototype, "fontSize", void 0);
8674
+ ], exports.Text.prototype, "fontSize", undefined);
8657
8675
  __decorate([
8658
8676
  boundsType('normal')
8659
- ], exports.Text.prototype, "fontWeight", void 0);
8677
+ ], exports.Text.prototype, "fontWeight", undefined);
8660
8678
  __decorate([
8661
8679
  boundsType(false)
8662
- ], exports.Text.prototype, "italic", void 0);
8680
+ ], exports.Text.prototype, "italic", undefined);
8663
8681
  __decorate([
8664
8682
  boundsType('none')
8665
- ], exports.Text.prototype, "textCase", void 0);
8683
+ ], exports.Text.prototype, "textCase", undefined);
8666
8684
  __decorate([
8667
8685
  boundsType('none')
8668
- ], exports.Text.prototype, "textDecoration", void 0);
8686
+ ], exports.Text.prototype, "textDecoration", undefined);
8669
8687
  __decorate([
8670
8688
  boundsType(0)
8671
- ], exports.Text.prototype, "letterSpacing", void 0);
8689
+ ], exports.Text.prototype, "letterSpacing", undefined);
8672
8690
  __decorate([
8673
8691
  boundsType({ type: 'percent', value: 1.5 })
8674
- ], exports.Text.prototype, "lineHeight", void 0);
8692
+ ], exports.Text.prototype, "lineHeight", undefined);
8675
8693
  __decorate([
8676
8694
  boundsType(0)
8677
- ], exports.Text.prototype, "paraIndent", void 0);
8695
+ ], exports.Text.prototype, "paraIndent", undefined);
8678
8696
  __decorate([
8679
8697
  boundsType(0)
8680
- ], exports.Text.prototype, "paraSpacing", void 0);
8698
+ ], exports.Text.prototype, "paraSpacing", undefined);
8681
8699
  __decorate([
8682
8700
  boundsType('x')
8683
- ], exports.Text.prototype, "writingMode", void 0);
8701
+ ], exports.Text.prototype, "writingMode", undefined);
8684
8702
  __decorate([
8685
8703
  boundsType('left')
8686
- ], exports.Text.prototype, "textAlign", void 0);
8704
+ ], exports.Text.prototype, "textAlign", undefined);
8687
8705
  __decorate([
8688
8706
  boundsType('top')
8689
- ], exports.Text.prototype, "verticalAlign", void 0);
8707
+ ], exports.Text.prototype, "verticalAlign", undefined);
8690
8708
  __decorate([
8691
8709
  boundsType(true)
8692
- ], exports.Text.prototype, "autoSizeAlign", void 0);
8710
+ ], exports.Text.prototype, "autoSizeAlign", undefined);
8693
8711
  __decorate([
8694
8712
  boundsType('normal')
8695
- ], exports.Text.prototype, "textWrap", void 0);
8713
+ ], exports.Text.prototype, "textWrap", undefined);
8696
8714
  __decorate([
8697
8715
  boundsType('show')
8698
- ], exports.Text.prototype, "textOverflow", void 0);
8716
+ ], exports.Text.prototype, "textOverflow", undefined);
8699
8717
  exports.Text = __decorate([
8700
8718
  registerUI()
8701
8719
  ], exports.Text);
@@ -8708,10 +8726,10 @@ var LeaferUI = (function (exports) {
8708
8726
  };
8709
8727
  __decorate([
8710
8728
  dataProcessor(PathData)
8711
- ], exports.Path.prototype, "__", void 0);
8729
+ ], exports.Path.prototype, "__", undefined);
8712
8730
  __decorate([
8713
8731
  affectStrokeBoundsType('center')
8714
- ], exports.Path.prototype, "strokeAlign", void 0);
8732
+ ], exports.Path.prototype, "strokeAlign", undefined);
8715
8733
  exports.Path = __decorate([
8716
8734
  registerUI()
8717
8735
  ], exports.Path);
@@ -8750,10 +8768,10 @@ var LeaferUI = (function (exports) {
8750
8768
  };
8751
8769
  __decorate([
8752
8770
  dataProcessor(PenData)
8753
- ], exports.Pen.prototype, "__", void 0);
8771
+ ], exports.Pen.prototype, "__", undefined);
8754
8772
  __decorate([
8755
8773
  penPathType()
8756
- ], exports.Pen.prototype, "path", void 0);
8774
+ ], exports.Pen.prototype, "path", undefined);
8757
8775
  exports.Pen = __decorate([
8758
8776
  useModule(PathCreator, ['set', 'path', 'paint']),
8759
8777
  registerUI()
@@ -9387,7 +9405,7 @@ var LeaferUI = (function (exports) {
9387
9405
  }
9388
9406
  else {
9389
9407
  if (!paint.patternTask) {
9390
- paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
9408
+ paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
9391
9409
  paint.patternTask = null;
9392
9410
  if (canvas.bounds.hit(ui.__nowWorld))
9393
9411
  createPattern(ui, paint, pixelRatio);
@@ -9543,7 +9561,7 @@ var LeaferUI = (function (exports) {
9543
9561
  const end = shadow.length - 1;
9544
9562
  toOffsetOutBounds$1(bounds, offsetOutBounds$1);
9545
9563
  shadow.forEach((item, index) => {
9546
- other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, item.color);
9564
+ other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, ColorConvert.string(item.color));
9547
9565
  spreadScale = item.spread ? 1 + item.spread * 2 / (__layout.boxBounds.width + (__layout.strokeBoxSpread || 0) * 2) : 0;
9548
9566
  drawWorldShadow(other, offsetOutBounds$1, spreadScale, shape);
9549
9567
  copyBounds = bounds;
@@ -9619,7 +9637,7 @@ var LeaferUI = (function (exports) {
9619
9637
  other.copyWorld(shape.canvas, shapeBounds, bounds, 'source-out');
9620
9638
  copyBounds = bounds;
9621
9639
  }
9622
- other.fillWorld(copyBounds, item.color, 'source-in');
9640
+ other.fillWorld(copyBounds, ColorConvert.string(item.color), 'source-in');
9623
9641
  if (ui.__worldFlipped) {
9624
9642
  current.copyWorldByReset(other, copyBounds, nowWorld, item.blendMode);
9625
9643
  }
@@ -9981,7 +9999,7 @@ var LeaferUI = (function (exports) {
9981
9999
  rows.forEach(row => {
9982
10000
  if (row.words) {
9983
10001
  indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
9984
- addWordWidth = (width && textAlign === 'justify' && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
10002
+ addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
9985
10003
  mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
9986
10004
  if (row.isOverflow && !letterSpacing)
9987
10005
  row.textMode = true;
@@ -10003,7 +10021,7 @@ var LeaferUI = (function (exports) {
10003
10021
  else {
10004
10022
  charX = toChar(word.data, charX, row.data, row.isOverflow);
10005
10023
  }
10006
- if (!row.paraEnd && addWordWidth) {
10024
+ if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
10007
10025
  charX += addWordWidth;
10008
10026
  row.width += addWordWidth;
10009
10027
  }