@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.
@@ -1533,10 +1533,10 @@ const DataHelper = {
1533
1533
  Object.keys(merge).forEach(key => {
1534
1534
  var _a, _b;
1535
1535
  value = merge[key];
1536
- if ((value === null || value === void 0 ? void 0 : value.constructor) === Object && ((_a = t[key]) === null || _a === void 0 ? void 0 : _a.constructor) === Object)
1536
+ if ((value === null || value === undefined ? undefined : value.constructor) === Object && ((_a = t[key]) === null || _a === undefined ? undefined : _a.constructor) === Object)
1537
1537
  return assign(t[key], merge[key], exclude && exclude[key]);
1538
1538
  if (exclude && (key in exclude)) {
1539
- if (((_b = exclude[key]) === null || _b === void 0 ? void 0 : _b.constructor) === Object)
1539
+ if (((_b = exclude[key]) === null || _b === undefined ? undefined : _b.constructor) === Object)
1540
1540
  assign(t[key] = {}, merge[key], exclude[key]);
1541
1541
  return;
1542
1542
  }
@@ -1705,7 +1705,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1705
1705
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1706
1706
  PERFORMANCE OF THIS SOFTWARE.
1707
1707
  ***************************************************************************** */
1708
- /* global Reflect, Promise, SuppressedError, Symbol */
1708
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
1709
1709
 
1710
1710
 
1711
1711
  function __decorate(decorators, target, key, desc) {
@@ -1773,7 +1773,7 @@ let Canvas$1 = class Canvas {
1773
1773
  }
1774
1774
  setTransform(_a, _b, _c, _d, _e, _f) { }
1775
1775
  resetTransform() { }
1776
- getTransform() { return void 0; }
1776
+ getTransform() { return undefined; }
1777
1777
  save() { }
1778
1778
  restore() { }
1779
1779
  transform(a, b, c, d, e, f) {
@@ -1830,12 +1830,12 @@ let Canvas$1 = class Canvas {
1830
1830
  ellipse(_x, _y, _radiusX, _radiusY, _rotation, _startAngle, _endAngle, _anticlockwise) { }
1831
1831
  rect(_x, _y, _width, _height) { }
1832
1832
  roundRect(_x, _y, _width, _height, _radius) { }
1833
- createConicGradient(_startAngle, _x, _y) { return void 0; }
1834
- createLinearGradient(_x0, _y0, _x1, _y1) { return void 0; }
1835
- createPattern(_image, _repetition) { return void 0; }
1836
- createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return void 0; }
1833
+ createConicGradient(_startAngle, _x, _y) { return undefined; }
1834
+ createLinearGradient(_x0, _y0, _x1, _y1) { return undefined; }
1835
+ createPattern(_image, _repetition) { return undefined; }
1836
+ createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return undefined; }
1837
1837
  fillText(_text, _x, _y, _maxWidth) { }
1838
- measureText(_text) { return void 0; }
1838
+ measureText(_text) { return undefined; }
1839
1839
  strokeText(_text, _x, _y, _maxWidth) { }
1840
1840
  destroy() {
1841
1841
  this.context = null;
@@ -1843,79 +1843,79 @@ let Canvas$1 = class Canvas {
1843
1843
  };
1844
1844
  __decorate([
1845
1845
  contextAttr('imageSmoothingEnabled')
1846
- ], Canvas$1.prototype, "smooth", void 0);
1846
+ ], Canvas$1.prototype, "smooth", undefined);
1847
1847
  __decorate([
1848
1848
  contextAttr('imageSmoothingQuality')
1849
- ], Canvas$1.prototype, "smoothLevel", void 0);
1849
+ ], Canvas$1.prototype, "smoothLevel", undefined);
1850
1850
  __decorate([
1851
1851
  contextAttr('globalAlpha')
1852
- ], Canvas$1.prototype, "opacity", void 0);
1852
+ ], Canvas$1.prototype, "opacity", undefined);
1853
1853
  __decorate([
1854
1854
  contextAttr()
1855
- ], Canvas$1.prototype, "fillStyle", void 0);
1855
+ ], Canvas$1.prototype, "fillStyle", undefined);
1856
1856
  __decorate([
1857
1857
  contextAttr()
1858
- ], Canvas$1.prototype, "strokeStyle", void 0);
1858
+ ], Canvas$1.prototype, "strokeStyle", undefined);
1859
1859
  __decorate([
1860
1860
  contextAttr('lineWidth')
1861
- ], Canvas$1.prototype, "strokeWidth", void 0);
1861
+ ], Canvas$1.prototype, "strokeWidth", undefined);
1862
1862
  __decorate([
1863
1863
  contextAttr('lineCap')
1864
- ], Canvas$1.prototype, "strokeCap", void 0);
1864
+ ], Canvas$1.prototype, "strokeCap", undefined);
1865
1865
  __decorate([
1866
1866
  contextAttr('lineJoin')
1867
- ], Canvas$1.prototype, "strokeJoin", void 0);
1867
+ ], Canvas$1.prototype, "strokeJoin", undefined);
1868
1868
  __decorate([
1869
1869
  contextAttr('lineDashOffset')
1870
- ], Canvas$1.prototype, "dashOffset", void 0);
1870
+ ], Canvas$1.prototype, "dashOffset", undefined);
1871
1871
  __decorate([
1872
1872
  contextAttr()
1873
- ], Canvas$1.prototype, "miterLimit", void 0);
1873
+ ], Canvas$1.prototype, "miterLimit", undefined);
1874
1874
  __decorate([
1875
1875
  contextAttr()
1876
- ], Canvas$1.prototype, "shadowBlur", void 0);
1876
+ ], Canvas$1.prototype, "shadowBlur", undefined);
1877
1877
  __decorate([
1878
1878
  contextAttr()
1879
- ], Canvas$1.prototype, "shadowColor", void 0);
1879
+ ], Canvas$1.prototype, "shadowColor", undefined);
1880
1880
  __decorate([
1881
1881
  contextAttr()
1882
- ], Canvas$1.prototype, "shadowOffsetX", void 0);
1882
+ ], Canvas$1.prototype, "shadowOffsetX", undefined);
1883
1883
  __decorate([
1884
1884
  contextAttr()
1885
- ], Canvas$1.prototype, "shadowOffsetY", void 0);
1885
+ ], Canvas$1.prototype, "shadowOffsetY", undefined);
1886
1886
  __decorate([
1887
1887
  contextAttr()
1888
- ], Canvas$1.prototype, "filter", void 0);
1888
+ ], Canvas$1.prototype, "filter", undefined);
1889
1889
  __decorate([
1890
1890
  contextAttr()
1891
- ], Canvas$1.prototype, "font", void 0);
1891
+ ], Canvas$1.prototype, "font", undefined);
1892
1892
  __decorate([
1893
1893
  contextAttr()
1894
- ], Canvas$1.prototype, "fontKerning", void 0);
1894
+ ], Canvas$1.prototype, "fontKerning", undefined);
1895
1895
  __decorate([
1896
1896
  contextAttr()
1897
- ], Canvas$1.prototype, "fontStretch", void 0);
1897
+ ], Canvas$1.prototype, "fontStretch", undefined);
1898
1898
  __decorate([
1899
1899
  contextAttr()
1900
- ], Canvas$1.prototype, "fontVariantCaps", void 0);
1900
+ ], Canvas$1.prototype, "fontVariantCaps", undefined);
1901
1901
  __decorate([
1902
1902
  contextAttr()
1903
- ], Canvas$1.prototype, "textAlign", void 0);
1903
+ ], Canvas$1.prototype, "textAlign", undefined);
1904
1904
  __decorate([
1905
1905
  contextAttr()
1906
- ], Canvas$1.prototype, "textBaseline", void 0);
1906
+ ], Canvas$1.prototype, "textBaseline", undefined);
1907
1907
  __decorate([
1908
1908
  contextAttr()
1909
- ], Canvas$1.prototype, "textRendering", void 0);
1909
+ ], Canvas$1.prototype, "textRendering", undefined);
1910
1910
  __decorate([
1911
1911
  contextAttr()
1912
- ], Canvas$1.prototype, "wordSpacing", void 0);
1912
+ ], Canvas$1.prototype, "wordSpacing", undefined);
1913
1913
  __decorate([
1914
1914
  contextAttr()
1915
- ], Canvas$1.prototype, "letterSpacing", void 0);
1915
+ ], Canvas$1.prototype, "letterSpacing", undefined);
1916
1916
  __decorate([
1917
1917
  contextAttr()
1918
- ], Canvas$1.prototype, "direction", void 0);
1918
+ ], Canvas$1.prototype, "direction", undefined);
1919
1919
  __decorate([
1920
1920
  contextMethod()
1921
1921
  ], Canvas$1.prototype, "setTransform", null);
@@ -3384,7 +3384,7 @@ class TaskItem {
3384
3384
  this.task = task;
3385
3385
  }
3386
3386
  run() {
3387
- return __awaiter(this, void 0, void 0, function* () {
3387
+ return __awaiter(this, undefined, undefined, function* () {
3388
3388
  try {
3389
3389
  if (this.task && !this.isComplete && this.parent.running)
3390
3390
  yield this.task();
@@ -3696,7 +3696,7 @@ class LeaferImage {
3696
3696
  load(onSuccess, onError) {
3697
3697
  if (!this.loading) {
3698
3698
  this.loading = true;
3699
- ImageManager.tasker.add(() => __awaiter(this, void 0, void 0, function* () {
3699
+ ImageManager.tasker.add(() => __awaiter(this, undefined, undefined, function* () {
3700
3700
  return yield Platform.origin.loadImage(this.url).then((img) => {
3701
3701
  this.ready = true;
3702
3702
  this.width = img.naturalWidth || img.width;
@@ -5175,8 +5175,7 @@ const LeafBounds = {
5175
5175
  __updateAutoLayout() {
5176
5176
  this.__layout.matrixChanged = true;
5177
5177
  if (this.isBranch) {
5178
- if (this.leaferIsReady)
5179
- this.leafer.layouter.addExtra(this);
5178
+ this.__extraUpdate();
5180
5179
  if (this.__.flow) {
5181
5180
  if (this.__layout.boxChanged)
5182
5181
  this.__updateFlowLayout();
@@ -5329,7 +5328,7 @@ let Leaf = class Leaf {
5329
5328
  get __worldFlipped() { return this.__world.scaleX < 0 || this.__world.scaleY < 0; }
5330
5329
  get __onlyHitMask() { return this.__hasMask && !this.__.hitChildren; }
5331
5330
  get __ignoreHitWorld() { return (this.__hasMask || this.__hasEraser) && this.__.hitChildren; }
5332
- get __inLazyBounds() { const { leafer } = this; return leafer && leafer.created && leafer.lazyBounds.hit(this.__world); }
5331
+ get __inLazyBounds() { return this.leaferIsCreated && this.leafer.lazyBounds.hit(this.__world); }
5333
5332
  get pathInputed() { return this.__.__pathInputed; }
5334
5333
  set event(map) { this.on(map); }
5335
5334
  constructor(data) {
@@ -5440,6 +5439,10 @@ let Leaf = class Leaf {
5440
5439
  forceRender(_bounds, _sync) {
5441
5440
  this.forceUpdate('surface');
5442
5441
  }
5442
+ __extraUpdate() {
5443
+ if (this.leaferIsReady)
5444
+ this.leafer.layouter.addExtra(this);
5445
+ }
5443
5446
  __updateWorldMatrix() { }
5444
5447
  __updateLocalMatrix() { }
5445
5448
  __updateWorldBounds() { }
@@ -6007,7 +6010,7 @@ class LeafLevelList {
6007
6010
  }
6008
6011
  }
6009
6012
 
6010
- const version = "1.3.1";
6013
+ const version = "1.3.3";
6011
6014
 
6012
6015
  class LeaferCanvas extends LeaferCanvasBase {
6013
6016
  get allowBackgroundColor() { return true; }
@@ -6352,7 +6355,7 @@ class Layouter {
6352
6355
  }
6353
6356
  partLayout() {
6354
6357
  var _a;
6355
- if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
6358
+ if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
6356
6359
  return;
6357
6360
  const t = Run.start('PartLayout');
6358
6361
  const { target, __updatedList: updateList } = this;
@@ -6539,7 +6542,7 @@ class Renderer {
6539
6542
  partRender() {
6540
6543
  const { canvas, updateBlocks: list } = this;
6541
6544
  if (!list)
6542
- return debug$3.warn('PartRender: need update attr');
6545
+ return;
6543
6546
  this.mergeBlocks();
6544
6547
  list.forEach(block => { if (canvas.bounds.hit(block) && !block.isEmpty())
6545
6548
  this.clipRender(block); });
@@ -6923,6 +6926,7 @@ class UIData extends LeafData {
6923
6926
  return t.fill && this.__hasStroke;
6924
6927
  }
6925
6928
  get __clipAfterFill() { const t = this; return (t.cornerRadius || t.innerShadow || t.__pathInputed); }
6929
+ get __hasSurface() { const t = this; return (t.fill || t.stroke); }
6926
6930
  get __autoWidth() { return !this._width; }
6927
6931
  get __autoHeight() { return !this._height; }
6928
6932
  get __autoSide() { return !this._width || !this._height; }
@@ -7395,7 +7399,7 @@ let UI = UI_1 = class UI extends Leaf {
7395
7399
  animate(_keyframe, _options, _type, _isTemp) {
7396
7400
  return Plugin.need('animate');
7397
7401
  }
7398
- killAnimate(_type, _killStyle) { }
7402
+ killAnimate(_type, _nextStyle) { }
7399
7403
  export(_filename, _options) {
7400
7404
  return Plugin.need('export');
7401
7405
  }
@@ -7426,199 +7430,199 @@ let UI = UI_1 = class UI extends Leaf {
7426
7430
  };
7427
7431
  __decorate([
7428
7432
  dataProcessor(UIData)
7429
- ], UI.prototype, "__", void 0);
7433
+ ], UI.prototype, "__", undefined);
7430
7434
  __decorate([
7431
7435
  zoomLayerType()
7432
- ], UI.prototype, "zoomLayer", void 0);
7436
+ ], UI.prototype, "zoomLayer", undefined);
7433
7437
  __decorate([
7434
7438
  dataType('')
7435
- ], UI.prototype, "id", void 0);
7439
+ ], UI.prototype, "id", undefined);
7436
7440
  __decorate([
7437
7441
  dataType('')
7438
- ], UI.prototype, "name", void 0);
7442
+ ], UI.prototype, "name", undefined);
7439
7443
  __decorate([
7440
7444
  dataType('')
7441
- ], UI.prototype, "className", void 0);
7445
+ ], UI.prototype, "className", undefined);
7442
7446
  __decorate([
7443
7447
  surfaceType('pass-through')
7444
- ], UI.prototype, "blendMode", void 0);
7448
+ ], UI.prototype, "blendMode", undefined);
7445
7449
  __decorate([
7446
7450
  opacityType(1)
7447
- ], UI.prototype, "opacity", void 0);
7451
+ ], UI.prototype, "opacity", undefined);
7448
7452
  __decorate([
7449
7453
  visibleType(true)
7450
- ], UI.prototype, "visible", void 0);
7454
+ ], UI.prototype, "visible", undefined);
7451
7455
  __decorate([
7452
7456
  surfaceType(false)
7453
- ], UI.prototype, "locked", void 0);
7457
+ ], UI.prototype, "locked", undefined);
7454
7458
  __decorate([
7455
7459
  sortType(0)
7456
- ], UI.prototype, "zIndex", void 0);
7460
+ ], UI.prototype, "zIndex", undefined);
7457
7461
  __decorate([
7458
7462
  maskType(false)
7459
- ], UI.prototype, "mask", void 0);
7463
+ ], UI.prototype, "mask", undefined);
7460
7464
  __decorate([
7461
7465
  eraserType(false)
7462
- ], UI.prototype, "eraser", void 0);
7466
+ ], UI.prototype, "eraser", undefined);
7463
7467
  __decorate([
7464
7468
  positionType(0, true)
7465
- ], UI.prototype, "x", void 0);
7469
+ ], UI.prototype, "x", undefined);
7466
7470
  __decorate([
7467
7471
  positionType(0, true)
7468
- ], UI.prototype, "y", void 0);
7472
+ ], UI.prototype, "y", undefined);
7469
7473
  __decorate([
7470
7474
  boundsType(100, true)
7471
- ], UI.prototype, "width", void 0);
7475
+ ], UI.prototype, "width", undefined);
7472
7476
  __decorate([
7473
7477
  boundsType(100, true)
7474
- ], UI.prototype, "height", void 0);
7478
+ ], UI.prototype, "height", undefined);
7475
7479
  __decorate([
7476
7480
  scaleType(1, true)
7477
- ], UI.prototype, "scaleX", void 0);
7481
+ ], UI.prototype, "scaleX", undefined);
7478
7482
  __decorate([
7479
7483
  scaleType(1, true)
7480
- ], UI.prototype, "scaleY", void 0);
7484
+ ], UI.prototype, "scaleY", undefined);
7481
7485
  __decorate([
7482
7486
  rotationType(0, true)
7483
- ], UI.prototype, "rotation", void 0);
7487
+ ], UI.prototype, "rotation", undefined);
7484
7488
  __decorate([
7485
7489
  rotationType(0, true)
7486
- ], UI.prototype, "skewX", void 0);
7490
+ ], UI.prototype, "skewX", undefined);
7487
7491
  __decorate([
7488
7492
  rotationType(0, true)
7489
- ], UI.prototype, "skewY", void 0);
7493
+ ], UI.prototype, "skewY", undefined);
7490
7494
  __decorate([
7491
7495
  positionType(0, true)
7492
- ], UI.prototype, "offsetX", void 0);
7496
+ ], UI.prototype, "offsetX", undefined);
7493
7497
  __decorate([
7494
7498
  positionType(0, true)
7495
- ], UI.prototype, "offsetY", void 0);
7499
+ ], UI.prototype, "offsetY", undefined);
7496
7500
  __decorate([
7497
7501
  positionType(0, true)
7498
- ], UI.prototype, "scrollX", void 0);
7502
+ ], UI.prototype, "scrollX", undefined);
7499
7503
  __decorate([
7500
7504
  positionType(0, true)
7501
- ], UI.prototype, "scrollY", void 0);
7505
+ ], UI.prototype, "scrollY", undefined);
7502
7506
  __decorate([
7503
7507
  autoLayoutType()
7504
- ], UI.prototype, "origin", void 0);
7508
+ ], UI.prototype, "origin", undefined);
7505
7509
  __decorate([
7506
7510
  autoLayoutType()
7507
- ], UI.prototype, "around", void 0);
7511
+ ], UI.prototype, "around", undefined);
7508
7512
  __decorate([
7509
7513
  dataType(false)
7510
- ], UI.prototype, "lazy", void 0);
7514
+ ], UI.prototype, "lazy", undefined);
7511
7515
  __decorate([
7512
7516
  naturalBoundsType(1)
7513
- ], UI.prototype, "pixelRatio", void 0);
7517
+ ], UI.prototype, "pixelRatio", undefined);
7514
7518
  __decorate([
7515
7519
  pathInputType()
7516
- ], UI.prototype, "path", void 0);
7520
+ ], UI.prototype, "path", undefined);
7517
7521
  __decorate([
7518
7522
  pathType()
7519
- ], UI.prototype, "windingRule", void 0);
7523
+ ], UI.prototype, "windingRule", undefined);
7520
7524
  __decorate([
7521
7525
  pathType(true)
7522
- ], UI.prototype, "closed", void 0);
7526
+ ], UI.prototype, "closed", undefined);
7523
7527
  __decorate([
7524
7528
  boundsType(0)
7525
- ], UI.prototype, "padding", void 0);
7529
+ ], UI.prototype, "padding", undefined);
7526
7530
  __decorate([
7527
7531
  boundsType(false)
7528
- ], UI.prototype, "lockRatio", void 0);
7532
+ ], UI.prototype, "lockRatio", undefined);
7529
7533
  __decorate([
7530
7534
  boundsType()
7531
- ], UI.prototype, "widthRange", void 0);
7535
+ ], UI.prototype, "widthRange", undefined);
7532
7536
  __decorate([
7533
7537
  boundsType()
7534
- ], UI.prototype, "heightRange", void 0);
7538
+ ], UI.prototype, "heightRange", undefined);
7535
7539
  __decorate([
7536
7540
  dataType(false)
7537
- ], UI.prototype, "draggable", void 0);
7541
+ ], UI.prototype, "draggable", undefined);
7538
7542
  __decorate([
7539
7543
  dataType()
7540
- ], UI.prototype, "dragBounds", void 0);
7544
+ ], UI.prototype, "dragBounds", undefined);
7541
7545
  __decorate([
7542
7546
  dataType(false)
7543
- ], UI.prototype, "editable", void 0);
7547
+ ], UI.prototype, "editable", undefined);
7544
7548
  __decorate([
7545
7549
  hitType(true)
7546
- ], UI.prototype, "hittable", void 0);
7550
+ ], UI.prototype, "hittable", undefined);
7547
7551
  __decorate([
7548
7552
  hitType('path')
7549
- ], UI.prototype, "hitFill", void 0);
7553
+ ], UI.prototype, "hitFill", undefined);
7550
7554
  __decorate([
7551
7555
  strokeType('path')
7552
- ], UI.prototype, "hitStroke", void 0);
7556
+ ], UI.prototype, "hitStroke", undefined);
7553
7557
  __decorate([
7554
7558
  hitType(false)
7555
- ], UI.prototype, "hitBox", void 0);
7559
+ ], UI.prototype, "hitBox", undefined);
7556
7560
  __decorate([
7557
7561
  hitType(true)
7558
- ], UI.prototype, "hitChildren", void 0);
7562
+ ], UI.prototype, "hitChildren", undefined);
7559
7563
  __decorate([
7560
7564
  hitType(true)
7561
- ], UI.prototype, "hitSelf", void 0);
7565
+ ], UI.prototype, "hitSelf", undefined);
7562
7566
  __decorate([
7563
7567
  hitType()
7564
- ], UI.prototype, "hitRadius", void 0);
7568
+ ], UI.prototype, "hitRadius", undefined);
7565
7569
  __decorate([
7566
7570
  cursorType('')
7567
- ], UI.prototype, "cursor", void 0);
7571
+ ], UI.prototype, "cursor", undefined);
7568
7572
  __decorate([
7569
7573
  surfaceType()
7570
- ], UI.prototype, "fill", void 0);
7574
+ ], UI.prototype, "fill", undefined);
7571
7575
  __decorate([
7572
7576
  strokeType()
7573
- ], UI.prototype, "stroke", void 0);
7577
+ ], UI.prototype, "stroke", undefined);
7574
7578
  __decorate([
7575
7579
  strokeType('inside')
7576
- ], UI.prototype, "strokeAlign", void 0);
7580
+ ], UI.prototype, "strokeAlign", undefined);
7577
7581
  __decorate([
7578
7582
  strokeType(1)
7579
- ], UI.prototype, "strokeWidth", void 0);
7583
+ ], UI.prototype, "strokeWidth", undefined);
7580
7584
  __decorate([
7581
7585
  strokeType(false)
7582
- ], UI.prototype, "strokeWidthFixed", void 0);
7586
+ ], UI.prototype, "strokeWidthFixed", undefined);
7583
7587
  __decorate([
7584
7588
  strokeType('none')
7585
- ], UI.prototype, "strokeCap", void 0);
7589
+ ], UI.prototype, "strokeCap", undefined);
7586
7590
  __decorate([
7587
7591
  strokeType('miter')
7588
- ], UI.prototype, "strokeJoin", void 0);
7592
+ ], UI.prototype, "strokeJoin", undefined);
7589
7593
  __decorate([
7590
7594
  strokeType()
7591
- ], UI.prototype, "dashPattern", void 0);
7595
+ ], UI.prototype, "dashPattern", undefined);
7592
7596
  __decorate([
7593
7597
  strokeType()
7594
- ], UI.prototype, "dashOffset", void 0);
7598
+ ], UI.prototype, "dashOffset", undefined);
7595
7599
  __decorate([
7596
7600
  strokeType(10)
7597
- ], UI.prototype, "miterLimit", void 0);
7601
+ ], UI.prototype, "miterLimit", undefined);
7598
7602
  __decorate([
7599
7603
  pathType(0)
7600
- ], UI.prototype, "cornerRadius", void 0);
7604
+ ], UI.prototype, "cornerRadius", undefined);
7601
7605
  __decorate([
7602
7606
  pathType()
7603
- ], UI.prototype, "cornerSmoothing", void 0);
7607
+ ], UI.prototype, "cornerSmoothing", undefined);
7604
7608
  __decorate([
7605
7609
  effectType()
7606
- ], UI.prototype, "shadow", void 0);
7610
+ ], UI.prototype, "shadow", undefined);
7607
7611
  __decorate([
7608
7612
  effectType()
7609
- ], UI.prototype, "innerShadow", void 0);
7613
+ ], UI.prototype, "innerShadow", undefined);
7610
7614
  __decorate([
7611
7615
  effectType()
7612
- ], UI.prototype, "blur", void 0);
7616
+ ], UI.prototype, "blur", undefined);
7613
7617
  __decorate([
7614
7618
  effectType()
7615
- ], UI.prototype, "backgroundBlur", void 0);
7619
+ ], UI.prototype, "backgroundBlur", undefined);
7616
7620
  __decorate([
7617
7621
  effectType()
7618
- ], UI.prototype, "grayscale", void 0);
7622
+ ], UI.prototype, "grayscale", undefined);
7619
7623
  __decorate([
7620
7624
  dataType({})
7621
- ], UI.prototype, "data", void 0);
7625
+ ], UI.prototype, "data", undefined);
7622
7626
  __decorate([
7623
7627
  rewrite(Leaf.prototype.reset)
7624
7628
  ], UI.prototype, "reset", null);
@@ -7679,7 +7683,7 @@ let Group = class Group extends UI {
7679
7683
  };
7680
7684
  __decorate([
7681
7685
  dataProcessor(GroupData)
7682
- ], Group.prototype, "__", void 0);
7686
+ ], Group.prototype, "__", undefined);
7683
7687
  Group = __decorate([
7684
7688
  useModule(Branch),
7685
7689
  registerUI()
@@ -7850,8 +7854,6 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7850
7854
  __setAttr(attrName, newValue) {
7851
7855
  if (this.canvas) {
7852
7856
  if (canvasSizeAttrs.includes(attrName)) {
7853
- if (!newValue)
7854
- debug$1.warn(attrName + ' is 0');
7855
7857
  this.__changeCanvasSize(attrName, newValue);
7856
7858
  }
7857
7859
  else if (attrName === 'fill') {
@@ -7891,8 +7893,6 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7891
7893
  this.created = true;
7892
7894
  }
7893
7895
  __onReady() {
7894
- if (this.ready)
7895
- return;
7896
7896
  this.ready = true;
7897
7897
  this.emitLeafer(LeaferEvent.BEFORE_READY);
7898
7898
  this.emitLeafer(LeaferEvent.READY);
@@ -7906,6 +7906,20 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7906
7906
  this.emitLeafer(LeaferEvent.VIEW_READY);
7907
7907
  WaitHelper.run(this.__viewReadyWait);
7908
7908
  }
7909
+ __onLayoutEnd() {
7910
+ const { grow, growWidth, growHeight } = this.config;
7911
+ if (grow) {
7912
+ let { width, height, pixelRatio } = this;
7913
+ const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
7914
+ if (growWidth !== false)
7915
+ width = Math.max(1, bounds.x + bounds.width);
7916
+ if (growHeight !== false)
7917
+ height = Math.max(1, bounds.y + bounds.height);
7918
+ this.__doResize({ width, height, pixelRatio });
7919
+ }
7920
+ if (!this.ready)
7921
+ this.__onReady();
7922
+ }
7909
7923
  __onNextRender() {
7910
7924
  if (this.viewReady) {
7911
7925
  WaitHelper.run(this.__nextRenderWait);
@@ -7999,10 +8013,9 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7999
8013
  const runId = Run.start('FirstCreate ' + this.innerName);
8000
8014
  this.once(LeaferEvent.START, () => Run.end(runId));
8001
8015
  this.once(LayoutEvent.START, () => this.updateLazyBounds());
8002
- this.once(LayoutEvent.END, () => this.__onReady());
8003
8016
  this.once(RenderEvent.START, () => this.__onCreated());
8004
8017
  this.once(RenderEvent.END, () => this.__onViewReady());
8005
- this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
8018
+ this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(LayoutEvent.END, this.__onLayoutEnd, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
8006
8019
  }
8007
8020
  __removeListenEvents() {
8008
8021
  this.off_(this.__eventIds);
@@ -8043,10 +8056,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
8043
8056
  Leafer.list = new LeafList();
8044
8057
  __decorate([
8045
8058
  dataProcessor(LeaferData)
8046
- ], Leafer.prototype, "__", void 0);
8059
+ ], Leafer.prototype, "__", undefined);
8047
8060
  __decorate([
8048
8061
  boundsType()
8049
- ], Leafer.prototype, "pixelRatio", void 0);
8062
+ ], Leafer.prototype, "pixelRatio", undefined);
8050
8063
  Leafer = Leafer_1 = __decorate([
8051
8064
  registerUI()
8052
8065
  ], Leafer);
@@ -8059,7 +8072,7 @@ let Rect = class Rect extends UI {
8059
8072
  };
8060
8073
  __decorate([
8061
8074
  dataProcessor(RectData)
8062
- ], Rect.prototype, "__", void 0);
8075
+ ], Rect.prototype, "__", undefined);
8063
8076
  Rect = __decorate([
8064
8077
  useModule(RectRender),
8065
8078
  rewriteAble(),
@@ -8084,6 +8097,8 @@ let Box = class Box extends Group {
8084
8097
  const data = this.__;
8085
8098
  if (this.children.length) {
8086
8099
  if (data.__autoSide) {
8100
+ if (data.__hasSurface)
8101
+ this.__extraUpdate();
8087
8102
  super.__updateBoxBounds();
8088
8103
  const { boxBounds } = this.__layout;
8089
8104
  if (!data.__autoSize) {
@@ -8148,13 +8163,13 @@ let Box = class Box extends Group {
8148
8163
  };
8149
8164
  __decorate([
8150
8165
  dataProcessor(BoxData)
8151
- ], Box.prototype, "__", void 0);
8166
+ ], Box.prototype, "__", undefined);
8152
8167
  __decorate([
8153
8168
  dataType(false)
8154
- ], Box.prototype, "resizeChildren", void 0);
8169
+ ], Box.prototype, "resizeChildren", undefined);
8155
8170
  __decorate([
8156
8171
  affectRenderBoundsType('show')
8157
- ], Box.prototype, "overflow", void 0);
8172
+ ], Box.prototype, "overflow", undefined);
8158
8173
  __decorate([
8159
8174
  rewrite(rect$1.__updateStrokeSpread)
8160
8175
  ], Box.prototype, "__updateStrokeSpread", null);
@@ -8193,13 +8208,13 @@ let Frame = class Frame extends Box {
8193
8208
  };
8194
8209
  __decorate([
8195
8210
  dataProcessor(FrameData)
8196
- ], Frame.prototype, "__", void 0);
8211
+ ], Frame.prototype, "__", undefined);
8197
8212
  __decorate([
8198
8213
  surfaceType('#FFFFFF')
8199
- ], Frame.prototype, "fill", void 0);
8214
+ ], Frame.prototype, "fill", undefined);
8200
8215
  __decorate([
8201
8216
  affectRenderBoundsType('hide')
8202
- ], Frame.prototype, "overflow", void 0);
8217
+ ], Frame.prototype, "overflow", undefined);
8203
8218
  Frame = __decorate([
8204
8219
  registerUI()
8205
8220
  ], Frame);
@@ -8246,16 +8261,16 @@ let Ellipse = class Ellipse extends UI {
8246
8261
  };
8247
8262
  __decorate([
8248
8263
  dataProcessor(EllipseData)
8249
- ], Ellipse.prototype, "__", void 0);
8264
+ ], Ellipse.prototype, "__", undefined);
8250
8265
  __decorate([
8251
8266
  pathType(0)
8252
- ], Ellipse.prototype, "innerRadius", void 0);
8267
+ ], Ellipse.prototype, "innerRadius", undefined);
8253
8268
  __decorate([
8254
8269
  pathType(0)
8255
- ], Ellipse.prototype, "startAngle", void 0);
8270
+ ], Ellipse.prototype, "startAngle", undefined);
8256
8271
  __decorate([
8257
8272
  pathType(0)
8258
- ], Ellipse.prototype, "endAngle", void 0);
8273
+ ], Ellipse.prototype, "endAngle", undefined);
8259
8274
  Ellipse = __decorate([
8260
8275
  registerUI()
8261
8276
  ], Ellipse);
@@ -8314,22 +8329,22 @@ let Line = class Line extends UI {
8314
8329
  };
8315
8330
  __decorate([
8316
8331
  dataProcessor(LineData)
8317
- ], Line.prototype, "__", void 0);
8332
+ ], Line.prototype, "__", undefined);
8318
8333
  __decorate([
8319
8334
  affectStrokeBoundsType('center')
8320
- ], Line.prototype, "strokeAlign", void 0);
8335
+ ], Line.prototype, "strokeAlign", undefined);
8321
8336
  __decorate([
8322
8337
  boundsType(0)
8323
- ], Line.prototype, "height", void 0);
8338
+ ], Line.prototype, "height", undefined);
8324
8339
  __decorate([
8325
8340
  pathType()
8326
- ], Line.prototype, "points", void 0);
8341
+ ], Line.prototype, "points", undefined);
8327
8342
  __decorate([
8328
8343
  pathType(0)
8329
- ], Line.prototype, "curve", void 0);
8344
+ ], Line.prototype, "curve", undefined);
8330
8345
  __decorate([
8331
8346
  pathType(false)
8332
- ], Line.prototype, "closed", void 0);
8347
+ ], Line.prototype, "closed", undefined);
8333
8348
  Line = __decorate([
8334
8349
  registerUI()
8335
8350
  ], Line);
@@ -8362,16 +8377,16 @@ let Polygon = class Polygon extends UI {
8362
8377
  };
8363
8378
  __decorate([
8364
8379
  dataProcessor(PolygonData)
8365
- ], Polygon.prototype, "__", void 0);
8380
+ ], Polygon.prototype, "__", undefined);
8366
8381
  __decorate([
8367
8382
  pathType(3)
8368
- ], Polygon.prototype, "sides", void 0);
8383
+ ], Polygon.prototype, "sides", undefined);
8369
8384
  __decorate([
8370
8385
  pathType()
8371
- ], Polygon.prototype, "points", void 0);
8386
+ ], Polygon.prototype, "points", undefined);
8372
8387
  __decorate([
8373
8388
  pathType(0)
8374
- ], Polygon.prototype, "curve", void 0);
8389
+ ], Polygon.prototype, "curve", undefined);
8375
8390
  __decorate([
8376
8391
  rewrite(line.__updateRenderPath)
8377
8392
  ], Polygon.prototype, "__updateRenderPath", null);
@@ -8403,13 +8418,13 @@ let Star = class Star extends UI {
8403
8418
  };
8404
8419
  __decorate([
8405
8420
  dataProcessor(StarData)
8406
- ], Star.prototype, "__", void 0);
8421
+ ], Star.prototype, "__", undefined);
8407
8422
  __decorate([
8408
8423
  pathType(5)
8409
- ], Star.prototype, "corners", void 0);
8424
+ ], Star.prototype, "corners", undefined);
8410
8425
  __decorate([
8411
8426
  pathType(0.382)
8412
- ], Star.prototype, "innerRadius", void 0);
8427
+ ], Star.prototype, "innerRadius", undefined);
8413
8428
  Star = __decorate([
8414
8429
  registerUI()
8415
8430
  ], Star);
@@ -8431,10 +8446,10 @@ let Image = class Image extends Rect {
8431
8446
  };
8432
8447
  __decorate([
8433
8448
  dataProcessor(ImageData)
8434
- ], Image.prototype, "__", void 0);
8449
+ ], Image.prototype, "__", undefined);
8435
8450
  __decorate([
8436
8451
  boundsType('')
8437
- ], Image.prototype, "url", void 0);
8452
+ ], Image.prototype, "url", undefined);
8438
8453
  Image = __decorate([
8439
8454
  registerUI()
8440
8455
  ], Image);
@@ -8497,25 +8512,25 @@ let Canvas = class Canvas extends Rect {
8497
8512
  };
8498
8513
  __decorate([
8499
8514
  dataProcessor(CanvasData)
8500
- ], Canvas.prototype, "__", void 0);
8515
+ ], Canvas.prototype, "__", undefined);
8501
8516
  __decorate([
8502
8517
  resizeType(100)
8503
- ], Canvas.prototype, "width", void 0);
8518
+ ], Canvas.prototype, "width", undefined);
8504
8519
  __decorate([
8505
8520
  resizeType(100)
8506
- ], Canvas.prototype, "height", void 0);
8521
+ ], Canvas.prototype, "height", undefined);
8507
8522
  __decorate([
8508
8523
  resizeType(1)
8509
- ], Canvas.prototype, "pixelRatio", void 0);
8524
+ ], Canvas.prototype, "pixelRatio", undefined);
8510
8525
  __decorate([
8511
8526
  resizeType(true)
8512
- ], Canvas.prototype, "smooth", void 0);
8527
+ ], Canvas.prototype, "smooth", undefined);
8513
8528
  __decorate([
8514
8529
  dataType(false)
8515
- ], Canvas.prototype, "safeResize", void 0);
8530
+ ], Canvas.prototype, "safeResize", undefined);
8516
8531
  __decorate([
8517
8532
  resizeType()
8518
- ], Canvas.prototype, "contextSettings", void 0);
8533
+ ], Canvas.prototype, "contextSettings", undefined);
8519
8534
  Canvas = __decorate([
8520
8535
  registerUI()
8521
8536
  ], Canvas);
@@ -8606,76 +8621,76 @@ let Text = class Text extends UI {
8606
8621
  };
8607
8622
  __decorate([
8608
8623
  dataProcessor(TextData)
8609
- ], Text.prototype, "__", void 0);
8624
+ ], Text.prototype, "__", undefined);
8610
8625
  __decorate([
8611
8626
  boundsType(0)
8612
- ], Text.prototype, "width", void 0);
8627
+ ], Text.prototype, "width", undefined);
8613
8628
  __decorate([
8614
8629
  boundsType(0)
8615
- ], Text.prototype, "height", void 0);
8630
+ ], Text.prototype, "height", undefined);
8616
8631
  __decorate([
8617
8632
  dataType(false)
8618
- ], Text.prototype, "resizeFontSize", void 0);
8633
+ ], Text.prototype, "resizeFontSize", undefined);
8619
8634
  __decorate([
8620
8635
  surfaceType('#000000')
8621
- ], Text.prototype, "fill", void 0);
8636
+ ], Text.prototype, "fill", undefined);
8622
8637
  __decorate([
8623
8638
  affectStrokeBoundsType('outside')
8624
- ], Text.prototype, "strokeAlign", void 0);
8639
+ ], Text.prototype, "strokeAlign", undefined);
8625
8640
  __decorate([
8626
8641
  hitType('all')
8627
- ], Text.prototype, "hitFill", void 0);
8642
+ ], Text.prototype, "hitFill", undefined);
8628
8643
  __decorate([
8629
8644
  boundsType('')
8630
- ], Text.prototype, "text", void 0);
8645
+ ], Text.prototype, "text", undefined);
8631
8646
  __decorate([
8632
- boundsType('L')
8633
- ], Text.prototype, "fontFamily", void 0);
8647
+ boundsType('caption')
8648
+ ], Text.prototype, "fontFamily", undefined);
8634
8649
  __decorate([
8635
8650
  boundsType(12)
8636
- ], Text.prototype, "fontSize", void 0);
8651
+ ], Text.prototype, "fontSize", undefined);
8637
8652
  __decorate([
8638
8653
  boundsType('normal')
8639
- ], Text.prototype, "fontWeight", void 0);
8654
+ ], Text.prototype, "fontWeight", undefined);
8640
8655
  __decorate([
8641
8656
  boundsType(false)
8642
- ], Text.prototype, "italic", void 0);
8657
+ ], Text.prototype, "italic", undefined);
8643
8658
  __decorate([
8644
8659
  boundsType('none')
8645
- ], Text.prototype, "textCase", void 0);
8660
+ ], Text.prototype, "textCase", undefined);
8646
8661
  __decorate([
8647
8662
  boundsType('none')
8648
- ], Text.prototype, "textDecoration", void 0);
8663
+ ], Text.prototype, "textDecoration", undefined);
8649
8664
  __decorate([
8650
8665
  boundsType(0)
8651
- ], Text.prototype, "letterSpacing", void 0);
8666
+ ], Text.prototype, "letterSpacing", undefined);
8652
8667
  __decorate([
8653
8668
  boundsType({ type: 'percent', value: 1.5 })
8654
- ], Text.prototype, "lineHeight", void 0);
8669
+ ], Text.prototype, "lineHeight", undefined);
8655
8670
  __decorate([
8656
8671
  boundsType(0)
8657
- ], Text.prototype, "paraIndent", void 0);
8672
+ ], Text.prototype, "paraIndent", undefined);
8658
8673
  __decorate([
8659
8674
  boundsType(0)
8660
- ], Text.prototype, "paraSpacing", void 0);
8675
+ ], Text.prototype, "paraSpacing", undefined);
8661
8676
  __decorate([
8662
8677
  boundsType('x')
8663
- ], Text.prototype, "writingMode", void 0);
8678
+ ], Text.prototype, "writingMode", undefined);
8664
8679
  __decorate([
8665
8680
  boundsType('left')
8666
- ], Text.prototype, "textAlign", void 0);
8681
+ ], Text.prototype, "textAlign", undefined);
8667
8682
  __decorate([
8668
8683
  boundsType('top')
8669
- ], Text.prototype, "verticalAlign", void 0);
8684
+ ], Text.prototype, "verticalAlign", undefined);
8670
8685
  __decorate([
8671
8686
  boundsType(true)
8672
- ], Text.prototype, "autoSizeAlign", void 0);
8687
+ ], Text.prototype, "autoSizeAlign", undefined);
8673
8688
  __decorate([
8674
8689
  boundsType('normal')
8675
- ], Text.prototype, "textWrap", void 0);
8690
+ ], Text.prototype, "textWrap", undefined);
8676
8691
  __decorate([
8677
8692
  boundsType('show')
8678
- ], Text.prototype, "textOverflow", void 0);
8693
+ ], Text.prototype, "textOverflow", undefined);
8679
8694
  Text = __decorate([
8680
8695
  registerUI()
8681
8696
  ], Text);
@@ -8688,10 +8703,10 @@ let Path = class Path extends UI {
8688
8703
  };
8689
8704
  __decorate([
8690
8705
  dataProcessor(PathData)
8691
- ], Path.prototype, "__", void 0);
8706
+ ], Path.prototype, "__", undefined);
8692
8707
  __decorate([
8693
8708
  affectStrokeBoundsType('center')
8694
- ], Path.prototype, "strokeAlign", void 0);
8709
+ ], Path.prototype, "strokeAlign", undefined);
8695
8710
  Path = __decorate([
8696
8711
  registerUI()
8697
8712
  ], Path);
@@ -8730,10 +8745,10 @@ let Pen = class Pen extends Group {
8730
8745
  };
8731
8746
  __decorate([
8732
8747
  dataProcessor(PenData)
8733
- ], Pen.prototype, "__", void 0);
8748
+ ], Pen.prototype, "__", undefined);
8734
8749
  __decorate([
8735
8750
  penPathType()
8736
- ], Pen.prototype, "path", void 0);
8751
+ ], Pen.prototype, "path", undefined);
8737
8752
  Pen = __decorate([
8738
8753
  useModule(PathCreator, ['set', 'path', 'paint']),
8739
8754
  registerUI()
@@ -9918,9 +9933,9 @@ leaf.__hitWorld = function (point) {
9918
9933
  }
9919
9934
  return this.__hit(inner);
9920
9935
  };
9921
- leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitFill(inner, this.__.windingRule); };
9922
- leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === void 0 ? void 0 : _a.hitStroke(inner, strokeWidth); };
9923
- 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); };
9936
+ leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitFill(inner, this.__.windingRule); };
9937
+ leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitStroke(inner, strokeWidth); };
9938
+ leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitPixel(inner, this.__layout.renderBounds, this.__hitCanvas.hitScale); };
9924
9939
  leaf.__drawHitPath = function (canvas) { if (canvas)
9925
9940
  this.__drawRenderPath(canvas); };
9926
9941
 
@@ -10655,7 +10670,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
10655
10670
  }
10656
10671
  else {
10657
10672
  if (!paint.patternTask) {
10658
- paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
10673
+ paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
10659
10674
  paint.patternTask = null;
10660
10675
  if (canvas.bounds.hit(ui.__nowWorld))
10661
10676
  createPattern(ui, paint, pixelRatio);
@@ -10811,7 +10826,7 @@ function shadow(ui, current, shape) {
10811
10826
  const end = shadow.length - 1;
10812
10827
  toOffsetOutBounds$1(bounds, offsetOutBounds$1);
10813
10828
  shadow.forEach((item, index) => {
10814
- other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, item.color);
10829
+ other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, ColorConvert.string(item.color));
10815
10830
  spreadScale = item.spread ? 1 + item.spread * 2 / (__layout.boxBounds.width + (__layout.strokeBoxSpread || 0) * 2) : 0;
10816
10831
  drawWorldShadow(other, offsetOutBounds$1, spreadScale, shape);
10817
10832
  copyBounds = bounds;
@@ -10887,7 +10902,7 @@ function innerShadow(ui, current, shape) {
10887
10902
  other.copyWorld(shape.canvas, shapeBounds, bounds, 'source-out');
10888
10903
  copyBounds = bounds;
10889
10904
  }
10890
- other.fillWorld(copyBounds, item.color, 'source-in');
10905
+ other.fillWorld(copyBounds, ColorConvert.string(item.color), 'source-in');
10891
10906
  if (ui.__worldFlipped) {
10892
10907
  current.copyWorldByReset(other, copyBounds, nowWorld, item.blendMode);
10893
10908
  }
@@ -11249,7 +11264,7 @@ function layoutChar(drawData, style, width, _height) {
11249
11264
  rows.forEach(row => {
11250
11265
  if (row.words) {
11251
11266
  indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
11252
- addWordWidth = (width && textAlign === 'justify' && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
11267
+ addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
11253
11268
  mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
11254
11269
  if (row.isOverflow && !letterSpacing)
11255
11270
  row.textMode = true;
@@ -11271,7 +11286,7 @@ function layoutChar(drawData, style, width, _height) {
11271
11286
  else {
11272
11287
  charX = toChar(word.data, charX, row.data, row.isOverflow);
11273
11288
  }
11274
- if (!row.paraEnd && addWordWidth) {
11289
+ if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
11275
11290
  charX += addWordWidth;
11276
11291
  row.width += addWordWidth;
11277
11292
  }