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