@leafer/core 1.9.1 → 1.9.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/lib/core.esm.js CHANGED
@@ -476,9 +476,8 @@ const MatrixHelper = {
476
476
  t.e = child.e * a + child.f * c + e;
477
477
  t.f = child.e * b + child.f * d + f;
478
478
  },
479
- multiplyParent(t, parent, to, abcdChanged, childScaleData, scrollData) {
480
- let {e: e, f: f} = t;
481
- if (scrollData) e += scrollData.scrollX, f += scrollData.scrollY;
479
+ multiplyParent(t, parent, to, abcdChanged, childScaleData) {
480
+ const {e: e, f: f} = t;
482
481
  to || (to = t);
483
482
  if (isUndefined(abcdChanged)) abcdChanged = t.a !== 1 || t.b || t.c || t.d !== 1;
484
483
  if (abcdChanged) {
@@ -1191,6 +1190,10 @@ const BoundsHelper = {
1191
1190
  t.x += x;
1192
1191
  t.y += y;
1193
1192
  },
1193
+ scroll(t, data) {
1194
+ t.x += data.scrollX;
1195
+ t.y += data.scrollY;
1196
+ },
1194
1197
  getByMove(t, x, y) {
1195
1198
  t = Object.assign({}, t);
1196
1199
  B.move(t, x, y);
@@ -2137,7 +2140,7 @@ __decorate([ contextMethod() ], Canvas.prototype, "measureText", null);
2137
2140
 
2138
2141
  __decorate([ contextMethod() ], Canvas.prototype, "strokeText", null);
2139
2142
 
2140
- const {copy: copy$5, multiplyParent: multiplyParent$3} = MatrixHelper, {round: round$1} = Math;
2143
+ const {copy: copy$5, multiplyParent: multiplyParent$3} = MatrixHelper, {round: round$1} = Math, tempPixelBounds = new Bounds, tempPixelBounds2 = new Bounds;
2141
2144
 
2142
2145
  const minSize = {
2143
2146
  width: 1,
@@ -2302,44 +2305,44 @@ class LeaferCanvasBase extends Canvas {
2302
2305
  const {pixelRatio: pixelRatio} = this;
2303
2306
  this.filter = `blur(${blur * pixelRatio}px)`;
2304
2307
  }
2305
- copyWorld(canvas, from, to, blendMode) {
2308
+ copyWorld(canvas, from, to, blendMode, ceilPixel = true) {
2306
2309
  if (blendMode) this.blendMode = blendMode;
2307
2310
  if (from) {
2308
- const {pixelRatio: pixelRatio} = this;
2309
- if (!to) to = from;
2310
- this.drawImage(canvas.view, from.x * pixelRatio, from.y * pixelRatio, from.width * pixelRatio, from.height * pixelRatio, to.x * pixelRatio, to.y * pixelRatio, to.width * pixelRatio, to.height * pixelRatio);
2311
+ this.setTempPixelBounds(from, ceilPixel);
2312
+ if (!to) to = tempPixelBounds; else this.setTempPixelBounds2(to, ceilPixel), to = tempPixelBounds2;
2313
+ this.drawImage(canvas.view, tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height, to.x, to.y, to.width, to.height);
2311
2314
  } else {
2312
2315
  this.drawImage(canvas.view, 0, 0);
2313
2316
  }
2314
2317
  if (blendMode) this.blendMode = "source-over";
2315
2318
  }
2316
- copyWorldToInner(canvas, fromWorld, toInnerBounds, blendMode) {
2317
- if (blendMode) this.blendMode = blendMode;
2319
+ copyWorldToInner(canvas, fromWorld, toInnerBounds, blendMode, ceilPixel = true) {
2318
2320
  if (fromWorld.b || fromWorld.c) {
2319
2321
  this.save();
2320
2322
  this.resetTransform();
2321
- this.copyWorld(canvas, fromWorld, BoundsHelper.tempToOuterOf(toInnerBounds, fromWorld));
2323
+ this.copyWorld(canvas, fromWorld, BoundsHelper.tempToOuterOf(toInnerBounds, fromWorld), blendMode, ceilPixel);
2322
2324
  this.restore();
2323
2325
  } else {
2324
- const {pixelRatio: pixelRatio} = this;
2325
- this.drawImage(canvas.view, fromWorld.x * pixelRatio, fromWorld.y * pixelRatio, fromWorld.width * pixelRatio, fromWorld.height * pixelRatio, toInnerBounds.x, toInnerBounds.y, toInnerBounds.width, toInnerBounds.height);
2326
+ if (blendMode) this.blendMode = blendMode;
2327
+ this.setTempPixelBounds(fromWorld, ceilPixel);
2328
+ this.drawImage(canvas.view, tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height, toInnerBounds.x, toInnerBounds.y, toInnerBounds.width, toInnerBounds.height);
2329
+ if (blendMode) this.blendMode = "source-over";
2326
2330
  }
2327
- if (blendMode) this.blendMode = "source-over";
2328
2331
  }
2329
- copyWorldByReset(canvas, from, to, blendMode, onlyResetTransform) {
2332
+ copyWorldByReset(canvas, from, to, blendMode, onlyResetTransform, ceilPixel = true) {
2330
2333
  this.resetTransform();
2331
- this.copyWorld(canvas, from, to, blendMode);
2334
+ this.copyWorld(canvas, from, to, blendMode, ceilPixel);
2332
2335
  if (!onlyResetTransform) this.useWorldTransform();
2333
2336
  }
2334
2337
  useGrayscaleAlpha(bounds) {
2335
- this.setTempBounds(bounds, true, true);
2338
+ this.setTempPixelBounds(bounds, true, true);
2336
2339
  let alpha, pixel;
2337
- const {context: context} = this, imageData = context.getImageData(tempBounds.x, tempBounds.y, tempBounds.width, tempBounds.height), {data: data} = imageData;
2340
+ const {context: context} = this, imageData = context.getImageData(tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height), {data: data} = imageData;
2338
2341
  for (let i = 0, len = data.length; i < len; i += 4) {
2339
2342
  pixel = data[i] * .299 + data[i + 1] * .587 + data[i + 2] * .114;
2340
2343
  if (alpha = data[i + 3]) data[i + 3] = alpha === 255 ? pixel : alpha * (pixel / 255);
2341
2344
  }
2342
- context.putImageData(imageData, tempBounds.x, tempBounds.y);
2345
+ context.putImageData(imageData, tempPixelBounds.x, tempPixelBounds.y);
2343
2346
  }
2344
2347
  useMask(maskCanvas, fromBounds, toBounds) {
2345
2348
  this.copyWorld(maskCanvas, fromBounds, toBounds, "destination-in");
@@ -2347,42 +2350,48 @@ class LeaferCanvasBase extends Canvas {
2347
2350
  useEraser(eraserCanvas, fromBounds, toBounds) {
2348
2351
  this.copyWorld(eraserCanvas, fromBounds, toBounds, "destination-out");
2349
2352
  }
2350
- fillWorld(bounds, color, blendMode) {
2353
+ fillWorld(bounds, color, blendMode, ceilPixel) {
2351
2354
  if (blendMode) this.blendMode = blendMode;
2352
2355
  this.fillStyle = color;
2353
- this.setTempBounds(bounds);
2354
- this.fillRect(tempBounds.x, tempBounds.y, tempBounds.width, tempBounds.height);
2356
+ this.setTempPixelBounds(bounds, ceilPixel);
2357
+ this.fillRect(tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height);
2355
2358
  if (blendMode) this.blendMode = "source-over";
2356
2359
  }
2357
- strokeWorld(bounds, color, blendMode) {
2360
+ strokeWorld(bounds, color, blendMode, ceilPixel) {
2358
2361
  if (blendMode) this.blendMode = blendMode;
2359
2362
  this.strokeStyle = color;
2360
- this.setTempBounds(bounds);
2361
- this.strokeRect(tempBounds.x, tempBounds.y, tempBounds.width, tempBounds.height);
2363
+ this.setTempPixelBounds(bounds, ceilPixel);
2364
+ this.strokeRect(tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height);
2362
2365
  if (blendMode) this.blendMode = "source-over";
2363
2366
  }
2364
- clipWorld(bounds, ceilPixel) {
2367
+ clipWorld(bounds, ceilPixel = true) {
2365
2368
  this.beginPath();
2366
- this.setTempBounds(bounds, ceilPixel);
2367
- this.rect(tempBounds.x, tempBounds.y, tempBounds.width, tempBounds.height);
2369
+ this.setTempPixelBounds(bounds, ceilPixel);
2370
+ this.rect(tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height);
2368
2371
  this.clip();
2369
2372
  }
2370
2373
  clipUI(ruleData) {
2371
2374
  ruleData.windingRule ? this.clip(ruleData.windingRule) : this.clip();
2372
2375
  }
2373
- clearWorld(bounds, ceilPixel) {
2374
- this.setTempBounds(bounds, ceilPixel);
2375
- this.clearRect(tempBounds.x, tempBounds.y, tempBounds.width, tempBounds.height);
2376
+ clearWorld(bounds, ceilPixel = true) {
2377
+ this.setTempPixelBounds(bounds, ceilPixel);
2378
+ this.clearRect(tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height);
2376
2379
  }
2377
2380
  clear() {
2378
2381
  const {pixelRatio: pixelRatio} = this;
2379
2382
  this.clearRect(0, 0, this.width * pixelRatio + 2, this.height * pixelRatio + 2);
2380
2383
  }
2381
- setTempBounds(bounds, ceil, intersect) {
2382
- tempBounds.set(bounds);
2383
- if (intersect) tempBounds.intersect(this.bounds);
2384
- tempBounds.scale(this.pixelRatio);
2385
- if (ceil) tempBounds.ceil();
2384
+ setTempPixelBounds(bounds, ceil, intersect) {
2385
+ this.copyToPixelBounds(tempPixelBounds, bounds, ceil, intersect);
2386
+ }
2387
+ setTempPixelBounds2(bounds, ceil, intersect) {
2388
+ this.copyToPixelBounds(tempPixelBounds2, bounds, ceil, intersect);
2389
+ }
2390
+ copyToPixelBounds(pixelBounds, bounds, ceil, intersect) {
2391
+ pixelBounds.set(bounds);
2392
+ if (intersect) pixelBounds.intersect(this.bounds);
2393
+ pixelBounds.scale(this.pixelRatio);
2394
+ if (ceil) pixelBounds.ceil();
2386
2395
  }
2387
2396
  isSameSize(size) {
2388
2397
  return this.width === size.width && this.height === size.height && (!size.pixelRatio || this.pixelRatio === size.pixelRatio);
@@ -2398,7 +2407,7 @@ class LeaferCanvasBase extends Canvas {
2398
2407
  recycle(clearBounds) {
2399
2408
  if (!this.recycled) {
2400
2409
  this.restore();
2401
- clearBounds ? this.clearWorld(clearBounds, true) : this.clear();
2410
+ clearBounds ? this.clearWorld(clearBounds) : this.clear();
2402
2411
  this.manager ? this.manager.recycle(this) : this.destroy();
2403
2412
  }
2404
2413
  }
@@ -4138,6 +4147,17 @@ function positionType(defaultValue, checkFiniteNumber) {
4138
4147
  }));
4139
4148
  }
4140
4149
 
4150
+ function scrollType(defaultValue, checkFiniteNumber) {
4151
+ return decorateLeafAttr(defaultValue, key => attr({
4152
+ set(value) {
4153
+ if (this.__setAttr(key, value, checkFiniteNumber)) {
4154
+ this.__layout.matrixChanged || this.__layout.matrixChange();
4155
+ this.__scrollWorld || (this.__scrollWorld = {});
4156
+ }
4157
+ }
4158
+ }));
4159
+ }
4160
+
4141
4161
  function autoLayoutType(defaultValue) {
4142
4162
  return decorateLeafAttr(defaultValue, key => attr({
4143
4163
  set(value) {
@@ -4552,7 +4572,7 @@ const LeafHelper = {
4552
4572
  x: x,
4553
4573
  y: y
4554
4574
  };
4555
- isInnerPoint ? toOuterPoint$1(t.localTransform, local, local, true) : t.parent && toInnerPoint$1(t.parent.worldTransform, local, local, true);
4575
+ isInnerPoint ? toOuterPoint$1(t.localTransform, local, local, true) : t.parent && toInnerPoint$1(t.parent.scrollWorldTransform, local, local, true);
4556
4576
  L.moveLocal(t, local.x, local.y, transition);
4557
4577
  },
4558
4578
  moveLocal(t, x, y = 0, transition) {
@@ -4576,7 +4596,7 @@ const LeafHelper = {
4576
4596
  }
4577
4597
  copy$3(matrix, o);
4578
4598
  scaleOfOuter(matrix, origin, scaleX, scaleY);
4579
- if (t.origin || t.around) {
4599
+ if (L.hasHighPosition(t)) {
4580
4600
  L.setTransform(t, matrix, resize, transition);
4581
4601
  } else {
4582
4602
  const x = t.x + matrix.e - o.e, y = t.y + matrix.f - o.f;
@@ -4595,7 +4615,7 @@ const LeafHelper = {
4595
4615
  const o = t.__localMatrix;
4596
4616
  copy$3(matrix, o);
4597
4617
  rotateOfOuter(matrix, origin, angle);
4598
- if (t.origin || t.around) L.setTransform(t, matrix, false, transition); else t.set({
4618
+ if (L.hasHighPosition(t)) L.setTransform(t, matrix, false, transition); else t.set({
4599
4619
  x: t.x + matrix.e - o.e,
4600
4620
  y: t.y + matrix.f - o.f,
4601
4621
  rotation: MathHelper.formatRotation(t.rotation + angle)
@@ -4612,7 +4632,7 @@ const LeafHelper = {
4612
4632
  transformWorld(t, transform, resize, transition) {
4613
4633
  copy$3(matrix, t.worldTransform);
4614
4634
  multiplyParent$2(matrix, transform);
4615
- if (t.parent) divideParent(matrix, t.parent.worldTransform);
4635
+ if (t.parent) divideParent(matrix, t.parent.scrollWorldTransform);
4616
4636
  L.setTransform(t, matrix, resize, transition);
4617
4637
  },
4618
4638
  transform(t, transform, resize, transition) {
@@ -4623,6 +4643,10 @@ const LeafHelper = {
4623
4643
  setTransform(t, transform, resize, transition) {
4624
4644
  const data = t.__, originPoint = data.origin && L.getInnerOrigin(t, data.origin);
4625
4645
  const layout = getLayout(transform, originPoint, data.around && L.getInnerOrigin(t, data.around));
4646
+ if (L.hasOffset(t)) {
4647
+ layout.x -= data.offsetX;
4648
+ layout.y -= data.offsetY;
4649
+ }
4626
4650
  if (resize) {
4627
4651
  const scaleX = layout.scaleX / t.scaleX, scaleY = layout.scaleY / t.scaleY;
4628
4652
  delete layout.scaleX, delete layout.scaleY;
@@ -4651,13 +4675,19 @@ const LeafHelper = {
4651
4675
  },
4652
4676
  getRelativeWorld(t, relative, temp) {
4653
4677
  copy$3(matrix, t.worldTransform);
4654
- divideParent(matrix, relative.worldTransform);
4678
+ divideParent(matrix, relative.scrollWorldTransform);
4655
4679
  return temp ? matrix : Object.assign({}, matrix);
4656
4680
  },
4657
4681
  drop(t, parent, index, resize) {
4658
4682
  t.setTransform(L.getRelativeWorld(t, parent, true), resize);
4659
4683
  parent.add(t, index);
4660
4684
  },
4685
+ hasHighPosition(t) {
4686
+ return t.origin || t.around || L.hasOffset(t);
4687
+ },
4688
+ hasOffset(t) {
4689
+ return t.offsetX || t.offsetY;
4690
+ },
4661
4691
  hasParent(p, parent) {
4662
4692
  if (!parent) return false;
4663
4693
  while (p) {
@@ -4683,8 +4713,7 @@ const L = LeafHelper;
4683
4713
  const {updateAllMatrix: updateAllMatrix$1, updateMatrix: updateMatrix$1, updateAllWorldOpacity: updateAllWorldOpacity, updateAllChange: updateAllChange, updateChange: updateChange} = L;
4684
4714
 
4685
4715
  function getTempLocal(t, world) {
4686
- t.__layout.update();
4687
- return t.parent ? PointHelper.tempToInnerOf(world, t.parent.__world) : world;
4716
+ return t.parent ? PointHelper.tempToInnerOf(world, t.parent.scrollWorldTransform) : world;
4688
4717
  }
4689
4718
 
4690
4719
  const LeafBoundsHelper = {
@@ -5236,6 +5265,8 @@ ChildEvent.UNMOUNTED = "unmounted";
5236
5265
 
5237
5266
  ChildEvent.DESTROY = "destroy";
5238
5267
 
5268
+ const SCROLL = "property.scroll";
5269
+
5239
5270
  class PropertyEvent extends Event {
5240
5271
  constructor(type, target, attrName, oldValue, newValue) {
5241
5272
  super(type, target);
@@ -5249,6 +5280,13 @@ PropertyEvent.CHANGE = "property.change";
5249
5280
 
5250
5281
  PropertyEvent.LEAFER_CHANGE = "property.leafer_change";
5251
5282
 
5283
+ PropertyEvent.SCROLL = SCROLL;
5284
+
5285
+ const extraPropertyEventMap = {
5286
+ scrollX: SCROLL,
5287
+ scrollY: SCROLL
5288
+ };
5289
+
5252
5290
  class ImageEvent extends Event {
5253
5291
  constructor(type, data) {
5254
5292
  super(type);
@@ -5524,7 +5562,9 @@ class Eventer {
5524
5562
  if (!id) return;
5525
5563
  const list = isArray(id) ? id : [ id ];
5526
5564
  list.forEach(item => {
5527
- if (!item.listener) isArray(item.type) && item.type.forEach(v => item.current.off(v[0], v[1], v[3])); else item.current.off(item.type, item.listener, item.options);
5565
+ if (item) {
5566
+ if (!item.listener) isArray(item.type) && item.type.forEach(v => item.current.off(v[0], v[1], v[3])); else item.current.off(item.type, item.listener, item.options);
5567
+ }
5528
5568
  });
5529
5569
  list.length = 0;
5530
5570
  }
@@ -5618,8 +5658,6 @@ const LeafDataProxy = {
5618
5658
  }
5619
5659
  if (isObject(newValue) || oldValue !== newValue) {
5620
5660
  this.__realSetAttr(name, newValue);
5621
- const {CHANGE: CHANGE} = PropertyEvent;
5622
- const event = new PropertyEvent(CHANGE, this, name, oldValue, newValue);
5623
5661
  if (this.isLeafer) {
5624
5662
  this.emitEvent(new PropertyEvent(PropertyEvent.LEAFER_CHANGE, this, name, oldValue, newValue));
5625
5663
  const transformEventName = leaferTransformAttrMap[name];
@@ -5627,10 +5665,10 @@ const LeafDataProxy = {
5627
5665
  this.emitEvent(new LeaferEvent(transformEventName, this));
5628
5666
  this.emitEvent(new LeaferEvent(LeaferEvent.TRANSFORM, this));
5629
5667
  }
5630
- } else {
5631
- if (this.hasEvent(CHANGE)) this.emitEvent(event);
5632
5668
  }
5633
- this.leafer.emitEvent(event);
5669
+ this.emitPropertyEvent(PropertyEvent.CHANGE, name, oldValue, newValue);
5670
+ const extraPropertyEvent = extraPropertyEventMap[name];
5671
+ if (extraPropertyEvent) this.emitPropertyEvent(extraPropertyEvent, name, oldValue, newValue);
5634
5672
  return true;
5635
5673
  } else {
5636
5674
  return false;
@@ -5640,6 +5678,11 @@ const LeafDataProxy = {
5640
5678
  return true;
5641
5679
  }
5642
5680
  },
5681
+ emitPropertyEvent(type, name, oldValue, newValue) {
5682
+ const event = new PropertyEvent(type, this, name, oldValue, newValue);
5683
+ this.isLeafer || this.hasEvent(type) && this.emitEvent(event);
5684
+ this.leafer.emitEvent(event);
5685
+ },
5643
5686
  __realSetAttr(name, newValue) {
5644
5687
  const data = this.__;
5645
5688
  data[name] = newValue;
@@ -5658,8 +5701,9 @@ const {toPoint: toPoint, tempPoint: tempPoint} = AroundHelper;
5658
5701
 
5659
5702
  const LeafMatrix = {
5660
5703
  __updateWorldMatrix() {
5661
- const {parent: parent, __layout: __layout} = this;
5662
- multiplyParent$1(this.__local || __layout, parent ? parent.__world : defaultWorld, this.__world, !!__layout.affectScaleOrRotation, this.__, parent && (parent.scrollY || parent.scrollX) && parent.__);
5704
+ const {parent: parent, __layout: __layout, __world: __world, __scrollWorld: __scrollWorld, __: __} = this;
5705
+ multiplyParent$1(this.__local || __layout, parent ? parent.__scrollWorld || parent.__world : defaultWorld, __world, !!__layout.affectScaleOrRotation, __);
5706
+ if (__scrollWorld) translateInner(Object.assign(__scrollWorld, __world), __.scrollX, __.scrollY);
5663
5707
  },
5664
5708
  __updateLocalMatrix() {
5665
5709
  if (this.__local) {
@@ -5756,7 +5800,7 @@ const LeafBounds = {
5756
5800
  __updateLocalRenderBounds() {
5757
5801
  toOuterOf$1(this.__layout.renderBounds, this.__localMatrix, this.__layout.localRenderBounds);
5758
5802
  },
5759
- __updateBoxBounds() {
5803
+ __updateBoxBounds(_secondLayout, _bounds) {
5760
5804
  const b = this.__layout.boxBounds;
5761
5805
  const data = this.__;
5762
5806
  if (data.__pathInputed) {
@@ -5790,11 +5834,11 @@ const LeafBounds = {
5790
5834
  data.__naturalWidth = layout.boxBounds.width;
5791
5835
  data.__naturalHeight = layout.boxBounds.height;
5792
5836
  },
5793
- __updateStrokeBounds() {
5837
+ __updateStrokeBounds(_bounds) {
5794
5838
  const layout = this.__layout;
5795
5839
  copyAndSpread(layout.strokeBounds, layout.boxBounds, layout.strokeBoxSpread);
5796
5840
  },
5797
- __updateRenderBounds() {
5841
+ __updateRenderBounds(_bounds) {
5798
5842
  const layout = this.__layout;
5799
5843
  layout.renderSpread > 0 ? copyAndSpread(layout.renderBounds, layout.boxBounds, layout.renderSpread) : copy$1(layout.renderBounds, layout.strokeBounds);
5800
5844
  }
@@ -5943,6 +5987,10 @@ let Leaf = class Leaf {
5943
5987
  get localTransform() {
5944
5988
  return this.__layout.getTransform("local");
5945
5989
  }
5990
+ get scrollWorldTransform() {
5991
+ this.updateLayout();
5992
+ return this.__scrollWorld || this.__world;
5993
+ }
5946
5994
  get boxBounds() {
5947
5995
  return this.getBounds("box", "inner");
5948
5996
  }
@@ -5959,7 +6007,7 @@ let Leaf = class Leaf {
5959
6007
  return this.getBounds("render");
5960
6008
  }
5961
6009
  get worldOpacity() {
5962
- this.__layout.update();
6010
+ this.updateLayout();
5963
6011
  return this.__worldOpacity;
5964
6012
  }
5965
6013
  get __worldFlipped() {
@@ -6134,10 +6182,10 @@ let Leaf = class Leaf {
6134
6182
  __updateLocalBoxBounds() {}
6135
6183
  __updateLocalStrokeBounds() {}
6136
6184
  __updateLocalRenderBounds() {}
6137
- __updateBoxBounds() {}
6185
+ __updateBoxBounds(_secondLayout, _bounds) {}
6138
6186
  __updateContentBounds() {}
6139
- __updateStrokeBounds() {}
6140
- __updateRenderBounds() {}
6187
+ __updateStrokeBounds(_bounds) {}
6188
+ __updateRenderBounds(_bounds) {}
6141
6189
  __updateAutoLayout() {}
6142
6190
  __updateFlowLayout() {}
6143
6191
  __updateNaturalSize() {}
@@ -6437,14 +6485,14 @@ let Branch = class Branch extends Leaf {
6437
6485
  }
6438
6486
  return 0;
6439
6487
  }
6440
- __updateBoxBounds() {
6441
- setListWithFn(this.__layout.boxBounds, this.children, this.__hasMask ? maskLocalBoxBounds : localBoxBounds);
6488
+ __updateBoxBounds(_secondLayout, bounds) {
6489
+ setListWithFn(bounds || this.__layout.boxBounds, this.children, this.__hasMask ? maskLocalBoxBounds : localBoxBounds);
6442
6490
  }
6443
- __updateStrokeBounds() {
6444
- setListWithFn(this.__layout.strokeBounds, this.children, this.__hasMask ? maskLocalStrokeBounds : localStrokeBounds);
6491
+ __updateStrokeBounds(bounds) {
6492
+ setListWithFn(bounds || this.__layout.strokeBounds, this.children, this.__hasMask ? maskLocalStrokeBounds : localStrokeBounds);
6445
6493
  }
6446
- __updateRenderBounds() {
6447
- setListWithFn(this.__layout.renderBounds, this.children, this.__hasMask ? maskLocalRenderBounds : localRenderBounds);
6494
+ __updateRenderBounds(bounds) {
6495
+ setListWithFn(bounds || this.__layout.renderBounds, this.children, this.__hasMask ? maskLocalRenderBounds : localRenderBounds);
6448
6496
  }
6449
6497
  __updateSortChildren() {
6450
6498
  let affectSort;
@@ -6691,6 +6739,6 @@ class LeafLevelList {
6691
6739
  }
6692
6740
  }
6693
6741
 
6694
- const version = "1.9.1";
6742
+ const version = "1.9.3";
6695
6743
 
6696
- export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Branch, BranchHelper, BranchRender, CanvasManager, ChildEvent, Creator, DataHelper, Debug, Direction4, Direction9, EllipseHelper, Event, EventCreator, Eventer, FileHelper, ImageEvent, ImageManager, IncrementId, LayoutEvent, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, LeaferCanvasBase, LeaferEvent, LeaferImage, MathHelper, Matrix, MatrixHelper, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Platform, Plugin, Point, PointHelper, PropertyEvent, RectHelper, RenderEvent, ResizeEvent, Resource, Run, StringNumberMap, TaskItem, TaskProcessor, TwoPointBoundsHelper, UICreator, WaitHelper, WatchEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, tempBounds, tempMatrix, tempPoint$2 as tempPoint, tryToNumber, useModule, version, visibleType };
6744
+ export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Branch, BranchHelper, BranchRender, CanvasManager, ChildEvent, Creator, DataHelper, Debug, Direction4, Direction9, EllipseHelper, Event, EventCreator, Eventer, FileHelper, ImageEvent, ImageManager, IncrementId, LayoutEvent, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, LeaferCanvasBase, LeaferEvent, LeaferImage, MathHelper, Matrix, MatrixHelper, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Platform, Plugin, Point, PointHelper, PropertyEvent, RectHelper, RenderEvent, ResizeEvent, Resource, Run, StringNumberMap, TaskItem, TaskProcessor, TwoPointBoundsHelper, UICreator, WaitHelper, WatchEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, tempBounds, tempMatrix, tempPoint$2 as tempPoint, tryToNumber, useModule, version, visibleType };