@leafer/miniapp 2.1.8 → 2.1.9

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.
@@ -784,24 +784,24 @@ const PointHelper = {
784
784
  },
785
785
  tempToInnerOf(t, matrix) {
786
786
  const {tempPoint: temp} = P$7;
787
- copy$c(temp, t);
787
+ copy$d(temp, t);
788
788
  toInnerPoint$2(matrix, temp, temp);
789
789
  return temp;
790
790
  },
791
791
  tempToOuterOf(t, matrix) {
792
792
  const {tempPoint: temp} = P$7;
793
- copy$c(temp, t);
793
+ copy$d(temp, t);
794
794
  toOuterPoint$4(matrix, temp, temp);
795
795
  return temp;
796
796
  },
797
797
  tempToInnerRadiusPointOf(t, matrix) {
798
798
  const {tempRadiusPoint: temp} = P$7;
799
- copy$c(temp, t);
799
+ copy$d(temp, t);
800
800
  P$7.toInnerRadiusPointOf(t, matrix, temp);
801
801
  return temp;
802
802
  },
803
803
  copyRadiusPoint(t, point, x, y) {
804
- copy$c(t, point);
804
+ copy$d(t, point);
805
805
  setRadius(t, x, y);
806
806
  return t;
807
807
  },
@@ -881,7 +881,7 @@ const PointHelper = {
881
881
 
882
882
  const P$7 = PointHelper;
883
883
 
884
- const {getDistanceFrom: getDistanceFrom, copy: copy$c, setRadius: setRadius, getAtan2: getAtan2} = P$7;
884
+ const {getDistanceFrom: getDistanceFrom, copy: copy$d, setRadius: setRadius, getAtan2: getAtan2} = P$7;
885
885
 
886
886
  class Point {
887
887
  constructor(x, y) {
@@ -1088,7 +1088,7 @@ class Matrix {
1088
1088
  }
1089
1089
  }
1090
1090
 
1091
- const tempMatrix$2 = new Matrix;
1091
+ const tempMatrix$3 = new Matrix;
1092
1092
 
1093
1093
  const TwoPointBoundsHelper = {
1094
1094
  tempPointBounds: {},
@@ -1293,7 +1293,7 @@ const BoundsHelper = {
1293
1293
  return t;
1294
1294
  },
1295
1295
  toOffsetOutBounds(t, to, offsetBounds) {
1296
- if (!to) to = t; else copy$b(to, t);
1296
+ if (!to) to = t; else copy$c(to, t);
1297
1297
  if (!offsetBounds) offsetBounds = t;
1298
1298
  to.offsetX = B.maxX(offsetBounds);
1299
1299
  to.offsetY = B.maxY(offsetBounds);
@@ -1440,7 +1440,7 @@ const BoundsHelper = {
1440
1440
  if (bounds && (bounds.width || bounds.height)) {
1441
1441
  if (first) {
1442
1442
  first = false;
1443
- if (!addMode) copy$b(t, bounds);
1443
+ if (!addMode) copy$c(t, bounds);
1444
1444
  } else {
1445
1445
  add$2(t, bounds);
1446
1446
  }
@@ -1533,7 +1533,7 @@ const BoundsHelper = {
1533
1533
 
1534
1534
  const B = BoundsHelper;
1535
1535
 
1536
- const {add: add$2, copy: copy$b} = B;
1536
+ const {add: add$2, copy: copy$c} = B;
1537
1537
 
1538
1538
  class Bounds {
1539
1539
  get minX() {
@@ -2306,7 +2306,7 @@ __decorate([ contextMethod() ], Canvas$1.prototype, "measureText", null);
2306
2306
 
2307
2307
  __decorate([ contextMethod() ], Canvas$1.prototype, "strokeText", null);
2308
2308
 
2309
- const {copy: copy$a, multiplyParent: multiplyParent$4, pixelScale: pixelScale} = MatrixHelper, {round: round$4} = Math, tempPixelBounds = new Bounds, tempPixelBounds2 = new Bounds;
2309
+ const {copy: copy$b, multiplyParent: multiplyParent$4, pixelScale: pixelScale} = MatrixHelper, {round: round$4} = Math, tempPixelBounds = new Bounds, tempPixelBounds2 = new Bounds;
2310
2310
 
2311
2311
  const minSize = {
2312
2312
  width: 1,
@@ -2561,7 +2561,7 @@ class LeaferCanvasBase extends Canvas$1 {
2561
2561
  getSameCanvas(useSameWorldTransform, useSameSmooth) {
2562
2562
  const {size: size, pixelSnap: pixelSnap} = this, canvas = this.manager ? this.manager.get(size) : Creator.canvas(Object.assign({}, size));
2563
2563
  canvas.save();
2564
- if (useSameWorldTransform) copy$a(canvas.worldTransform, this.worldTransform), canvas.useWorldTransform();
2564
+ if (useSameWorldTransform) copy$b(canvas.worldTransform, this.worldTransform), canvas.useWorldTransform();
2565
2565
  if (useSameSmooth) canvas.smooth = this.smooth;
2566
2566
  canvas.pixelSnap !== pixelSnap && (canvas.pixelSnap = pixelSnap);
2567
2567
  return canvas;
@@ -3583,7 +3583,7 @@ const {M: M$7, L: L$7, C: C$5, Q: Q$3, Z: Z$5, N: N$2, D: D$3, X: X$2, G: G$2, F
3583
3583
 
3584
3584
  const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$2, arc: arc, ellipse: ellipse$2} = BezierHelper;
3585
3585
 
3586
- const {addPointBounds: addPointBounds, copy: copy$9, addPoint: addPoint$1, setPoint: setPoint$3, addBounds: addBounds, toBounds: toBounds$2} = TwoPointBoundsHelper;
3586
+ const {addPointBounds: addPointBounds, copy: copy$a, addPoint: addPoint$1, setPoint: setPoint$3, addBounds: addBounds, toBounds: toBounds$2} = TwoPointBoundsHelper;
3587
3587
 
3588
3588
  const debug$d = Debug.get("PathBounds");
3589
3589
 
@@ -3665,7 +3665,7 @@ const PathBounds = {
3665
3665
 
3666
3666
  case G$2:
3667
3667
  ellipse$2(null, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], data[i + 7], data[i + 8], tempPointBounds, setEndPoint);
3668
- i === 0 ? copy$9(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
3668
+ i === 0 ? copy$a(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
3669
3669
  x = setEndPoint.x;
3670
3670
  y = setEndPoint.y;
3671
3671
  i += 9;
@@ -3683,7 +3683,7 @@ const PathBounds = {
3683
3683
 
3684
3684
  case O$3:
3685
3685
  arc(null, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], tempPointBounds, setEndPoint);
3686
- i === 0 ? copy$9(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
3686
+ i === 0 ? copy$a(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
3687
3687
  x = setEndPoint.x;
3688
3688
  y = setEndPoint.y;
3689
3689
  i += 7;
@@ -3700,7 +3700,7 @@ const PathBounds = {
3700
3700
 
3701
3701
  case U$2:
3702
3702
  arcTo$2(null, x, y, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], tempPointBounds, setEndPoint);
3703
- i === 0 ? copy$9(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
3703
+ i === 0 ? copy$a(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
3704
3704
  x = setEndPoint.x;
3705
3705
  y = setEndPoint.y;
3706
3706
  i += 6;
@@ -4781,7 +4781,7 @@ function registerUIEvent() {
4781
4781
  };
4782
4782
  }
4783
4783
 
4784
- const {copy: copy$8, toInnerPoint: toInnerPoint$1, toOuterPoint: toOuterPoint$2, scaleOfOuter: scaleOfOuter$2, rotateOfOuter: rotateOfOuter$2, skewOfOuter: skewOfOuter, multiplyParent: multiplyParent$3, divideParent: divideParent, getLayout: getLayout} = MatrixHelper;
4784
+ const {copy: copy$9, toInnerPoint: toInnerPoint$1, toOuterPoint: toOuterPoint$2, scaleOfOuter: scaleOfOuter$2, rotateOfOuter: rotateOfOuter$2, skewOfOuter: skewOfOuter, multiplyParent: multiplyParent$3, divideParent: divideParent, getLayout: getLayout} = MatrixHelper;
4785
4785
 
4786
4786
  const matrix$3 = {}, {round: round$3} = Math;
4787
4787
 
@@ -4886,7 +4886,7 @@ const LeafHelper = {
4886
4886
  if (scaleY) transition = scaleY;
4887
4887
  scaleY = scaleX;
4888
4888
  }
4889
- copy$8(matrix$3, o);
4889
+ copy$9(matrix$3, o);
4890
4890
  scaleOfOuter$2(matrix$3, origin, scaleX, scaleY);
4891
4891
  if (L$5.hasHighPosition(t)) {
4892
4892
  L$5.setTransform(t, matrix$3, resize, transition, boundsType);
@@ -4905,7 +4905,7 @@ const LeafHelper = {
4905
4905
  },
4906
4906
  rotateOfLocal(t, origin, angle, transition) {
4907
4907
  const o = t.__localMatrix;
4908
- copy$8(matrix$3, o);
4908
+ copy$9(matrix$3, o);
4909
4909
  rotateOfOuter$2(matrix$3, origin, angle);
4910
4910
  if (L$5.hasHighPosition(t)) L$5.setTransform(t, matrix$3, false, transition); else t.set({
4911
4911
  x: t.x + matrix$3.e - o.e,
@@ -4917,18 +4917,18 @@ const LeafHelper = {
4917
4917
  L$5.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize, transition);
4918
4918
  },
4919
4919
  skewOfLocal(t, origin, skewX, skewY = 0, resize, transition) {
4920
- copy$8(matrix$3, t.__localMatrix);
4920
+ copy$9(matrix$3, t.__localMatrix);
4921
4921
  skewOfOuter(matrix$3, origin, skewX, skewY);
4922
4922
  L$5.setTransform(t, matrix$3, resize, transition);
4923
4923
  },
4924
4924
  transformWorld(t, transform, resize, transition, boundsType) {
4925
- copy$8(matrix$3, t.worldTransform);
4925
+ copy$9(matrix$3, t.worldTransform);
4926
4926
  multiplyParent$3(matrix$3, transform);
4927
4927
  if (t.parent) divideParent(matrix$3, t.parent.scrollWorldTransform);
4928
4928
  L$5.setTransform(t, matrix$3, resize, transition, boundsType);
4929
4929
  },
4930
4930
  transform(t, transform, resize, transition, boundsType) {
4931
- copy$8(matrix$3, t.localTransform);
4931
+ copy$9(matrix$3, t.localTransform);
4932
4932
  multiplyParent$3(matrix$3, transform);
4933
4933
  L$5.setTransform(t, matrix$3, resize, transition, boundsType);
4934
4934
  },
@@ -4966,7 +4966,7 @@ const LeafHelper = {
4966
4966
  return innerOrigin;
4967
4967
  },
4968
4968
  getRelativeWorld(t, relative, temp) {
4969
- copy$8(matrix$3, t.worldTransform);
4969
+ copy$9(matrix$3, t.worldTransform);
4970
4970
  divideParent(matrix$3, relative.scrollWorldTransform);
4971
4971
  return temp ? matrix$3 : Object.assign({}, matrix$3);
4972
4972
  },
@@ -5180,7 +5180,7 @@ const WaitHelper = {
5180
5180
 
5181
5181
  const {getRelativeWorld: getRelativeWorld$1, updateBounds: updateBounds$3} = LeafHelper;
5182
5182
 
5183
- const {toOuterOf: toOuterOf$3, getPoints: getPoints, copy: copy$7} = BoundsHelper;
5183
+ const {toOuterOf: toOuterOf$3, getPoints: getPoints, copy: copy$8} = BoundsHelper;
5184
5184
 
5185
5185
  const localContent = "_localContentBounds";
5186
5186
 
@@ -5419,7 +5419,7 @@ class LeafLayout {
5419
5419
  matrix = getRelativeWorld$1(leaf, relative, true);
5420
5420
  }
5421
5421
  if (!layoutBounds) layoutBounds = MatrixHelper.getLayout(matrix);
5422
- copy$7(layoutBounds, bounds);
5422
+ copy$8(layoutBounds, bounds);
5423
5423
  PointHelper.copy(layoutBounds, point);
5424
5424
  if (unscale) {
5425
5425
  const {scaleX: scaleX, scaleY: scaleY} = layoutBounds;
@@ -6074,7 +6074,7 @@ const {updateMatrix: updateMatrix$3, updateAllMatrix: updateAllMatrix$3} = LeafH
6074
6074
 
6075
6075
  const {updateBounds: updateBounds$2} = BranchHelper;
6076
6076
 
6077
- const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$4, copy: copy$6} = BoundsHelper;
6077
+ const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$4, copy: copy$7} = BoundsHelper;
6078
6078
 
6079
6079
  const {toBounds: toBounds$1} = PathBounds;
6080
6080
 
@@ -6196,7 +6196,7 @@ const LeafBounds = {
6196
6196
  },
6197
6197
  __updateRenderBounds(_bounds) {
6198
6198
  const layout = this.__layout, {renderSpread: renderSpread} = layout;
6199
- isNumber(renderSpread) && renderSpread <= 0 ? copy$6(layout.renderBounds, layout.strokeBounds) : copyAndSpread$4(layout.renderBounds, layout.boxBounds, renderSpread);
6199
+ isNumber(renderSpread) && renderSpread <= 0 ? copy$7(layout.renderBounds, layout.strokeBounds) : copyAndSpread$4(layout.renderBounds, layout.boxBounds, renderSpread);
6200
6200
  }
6201
6201
  };
6202
6202
 
@@ -6296,7 +6296,7 @@ const {toInnerPoint: toInnerPoint, toOuterPoint: toOuterPoint$1, multiplyParent:
6296
6296
 
6297
6297
  const {toOuterOf: toOuterOf$1} = BoundsHelper;
6298
6298
 
6299
- const {copy: copy$5, move: move$8} = PointHelper;
6299
+ const {copy: copy$6, move: move$8} = PointHelper;
6300
6300
 
6301
6301
  const {getScaleFixedData: getScaleFixedData$1} = MathHelper;
6302
6302
 
@@ -6560,14 +6560,14 @@ let Leaf = class Leaf {
6560
6560
  if (this.parent) {
6561
6561
  this.parent.worldToInner(world, to, distance, relative);
6562
6562
  } else {
6563
- if (to) copy$5(to, world);
6563
+ if (to) copy$6(to, world);
6564
6564
  }
6565
6565
  }
6566
6566
  localToWorld(local, to, distance, relative) {
6567
6567
  if (this.parent) {
6568
6568
  this.parent.innerToWorld(local, to, distance, relative);
6569
6569
  } else {
6570
- if (to) copy$5(to, local);
6570
+ if (to) copy$6(to, local);
6571
6571
  }
6572
6572
  }
6573
6573
  worldToInner(world, to, distance, relative) {
@@ -6984,7 +6984,7 @@ class LeafLevelList {
6984
6984
  }
6985
6985
  }
6986
6986
 
6987
- const version = "2.1.8";
6987
+ const version = "2.1.9";
6988
6988
 
6989
6989
  class LeaferCanvas extends LeaferCanvasBase {
6990
6990
  get allowBackgroundColor() {
@@ -7300,7 +7300,10 @@ class Watcher {
7300
7300
  if (this.running) this.target.emit(RenderEvent.REQUEST);
7301
7301
  }
7302
7302
  __onAttrChange(event) {
7303
- if (this.config.usePartLayout) this.__updatedList.add(event.target);
7303
+ this.add(event.target);
7304
+ }
7305
+ add(leaf) {
7306
+ if (this.config.usePartLayout) this.__updatedList.add(leaf);
7304
7307
  this.update();
7305
7308
  }
7306
7309
  __onChildEvent(event) {
@@ -8339,11 +8342,7 @@ class PolygonData extends UIData {
8339
8342
  }
8340
8343
  }
8341
8344
 
8342
- class StarData extends UIData {
8343
- get __boxStroke() {
8344
- return !this.__pathInputed;
8345
- }
8346
- }
8345
+ class StarData extends UIData {}
8347
8346
 
8348
8347
  class PathData extends UIData {
8349
8348
  get __pathInputed() {
@@ -12174,7 +12173,7 @@ function getGapValue(gap, size, totalSize, rows) {
12174
12173
  return gap === "auto" ? value < 0 ? 0 : value : value;
12175
12174
  }
12176
12175
 
12177
- let origin$1 = {}, tempMatrix$1 = getMatrixData();
12176
+ let origin$1 = {}, tempMatrix$2 = getMatrixData();
12178
12177
 
12179
12178
  const {get: get$2, set: set, rotateOfOuter: rotateOfOuter$1, translate: translate, scaleOfOuter: scaleOfOuter$1, multiplyParent: multiplyParent, scale: scaleHelper, rotate: rotate$2, skew: skewHelper} = MatrixHelper;
12180
12179
 
@@ -12201,9 +12200,9 @@ function clipMode(data, box, x, y, scaleX, scaleY, rotation, skew, clipScaleX, c
12201
12200
  layout$3(transform, box, x, y, scaleX, scaleY, rotation, skew);
12202
12201
  if (clipScaleX) {
12203
12202
  if (rotation || skew) {
12204
- set(tempMatrix$1);
12205
- scaleOfOuter$1(tempMatrix$1, box, clipScaleX, clipScaleY);
12206
- multiplyParent(transform, tempMatrix$1);
12203
+ set(tempMatrix$2);
12204
+ scaleOfOuter$1(tempMatrix$2, box, clipScaleX, clipScaleY);
12205
+ multiplyParent(transform, tempMatrix$2);
12207
12206
  } else scaleOfOuter$1(transform, box, clipScaleX, clipScaleY);
12208
12207
  }
12209
12208
  data.transform = transform;
@@ -12252,7 +12251,7 @@ function layout$3(transform, box, x, y, scaleX, scaleY, rotation, skew) {
12252
12251
  translate(transform, box.x + x, box.y + y);
12253
12252
  }
12254
12253
 
12255
- const {get: get$1, scale: scale$3, copy: copy$4} = MatrixHelper;
12254
+ const {get: get$1, scale: scale$3, copy: copy$5} = MatrixHelper;
12256
12255
 
12257
12256
  const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$7} = Math;
12258
12257
 
@@ -12278,19 +12277,15 @@ function createPattern(paint, ui, canvas, renderOptions) {
12278
12277
  if (fixScale) scaleX *= fixScale, scaleY *= fixScale;
12279
12278
  width *= scaleX;
12280
12279
  height *= scaleY;
12281
- if (gap) {
12280
+ if (gap && !brush) {
12282
12281
  xGap = gap.x * scaleX / abs$7(data.scaleX || 1);
12283
12282
  yGap = gap.y * scaleY / abs$7(data.scaleY || 1);
12284
- if (brush) {
12285
- const brushScale = PaintImage.getBrushScale(paint, ui);
12286
- xGap /= brushScale, yGap /= brushScale;
12287
- }
12288
12283
  }
12289
12284
  if (transform || scaleX !== 1 || scaleY !== 1) {
12290
12285
  scaleX *= getFloorScale(width + (xGap || 0));
12291
12286
  scaleY *= getFloorScale(height + (yGap || 0));
12292
12287
  imageMatrix = get$1();
12293
- if (transform) copy$4(imageMatrix, transform);
12288
+ if (transform) copy$5(imageMatrix, transform);
12294
12289
  scale$3(imageMatrix, 1 / scaleX, 1 / scaleY);
12295
12290
  }
12296
12291
  const imageCanvas = image.getCanvas(width, height, opacity, undefined, xGap, yGap, ui.leafer && ui.leafer.config.smooth, data.interlace);
@@ -12528,9 +12523,9 @@ const PaintGradientModule = {
12528
12523
  getTransform: getTransform
12529
12524
  };
12530
12525
 
12531
- const {copy: copy$3, move: move$6, toOffsetOutBounds: toOffsetOutBounds$1} = BoundsHelper, {max: max$2, abs: abs$6} = Math;
12526
+ const {copy: copy$4, move: move$6, toOffsetOutBounds: toOffsetOutBounds$1} = BoundsHelper, {max: max$2, abs: abs$6} = Math;
12532
12527
 
12533
- const tempBounds$1 = {}, tempMatrix = new Matrix;
12528
+ const tempBounds$1 = {}, tempMatrix$1 = new Matrix;
12534
12529
 
12535
12530
  const offsetOutBounds$1 = {};
12536
12531
 
@@ -12584,11 +12579,11 @@ function getShadowRenderSpread(_ui, shadow) {
12584
12579
  function getShadowTransform(ui, canvas, _shape, shadow, outBounds, otherScale, isInnerShaodw) {
12585
12580
  if (shadow.spread) {
12586
12581
  const spread = shadow.spread * 2 * otherScale * (isInnerShaodw ? -1 : 1), {width: width, height: height} = ui.__layout.strokeBounds;
12587
- tempMatrix.set().scaleOfOuter({
12582
+ tempMatrix$1.set().scaleOfOuter({
12588
12583
  x: (outBounds.x + outBounds.width / 2) * canvas.pixelRatio,
12589
12584
  y: (outBounds.y + outBounds.height / 2) * canvas.pixelRatio
12590
12585
  }, 1 + spread / width, 1 + spread / height);
12591
- return tempMatrix;
12586
+ return tempMatrix$1;
12592
12587
  }
12593
12588
  return undefined;
12594
12589
  }
@@ -12597,7 +12592,7 @@ function drawWorldShadow(canvas, outBounds, shape) {
12597
12592
  const {shapeBounds: shapeBounds} = shape;
12598
12593
  let from, to;
12599
12594
  if (Platform.fullImageShadow) {
12600
- copy$3(tempBounds$1, canvas.bounds);
12595
+ copy$4(tempBounds$1, canvas.bounds);
12601
12596
  move$6(tempBounds$1, outBounds.x - shapeBounds.x, outBounds.y - shapeBounds.y);
12602
12597
  from = canvas.bounds, to = tempBounds$1;
12603
12598
  } else {
@@ -13416,7 +13411,7 @@ function mergeConfigAttr() {
13416
13411
 
13417
13412
  const {abs: abs$5} = Math;
13418
13413
 
13419
- const {copy: copy$2} = MatrixHelper;
13414
+ const {copy: copy$3} = MatrixHelper;
13420
13415
 
13421
13416
  const {setListWithFn: setListWithFn} = BoundsHelper;
13422
13417
 
@@ -13458,7 +13453,7 @@ class Stroker extends UI {
13458
13453
  const {worldTransform: worldTransform, worldRenderBounds: worldRenderBounds} = leaf;
13459
13454
  if (worldRenderBounds.width && worldRenderBounds.height && (!bounds || bounds.hit(worldRenderBounds, options.matrix))) {
13460
13455
  const aScaleX = abs$5(worldTransform.scaleX), aScaleY = abs$5(worldTransform.scaleY);
13461
- copy$2(matrix$1, worldTransform);
13456
+ copy$3(matrix$1, worldTransform);
13462
13457
  matrix$1.half = strokeWidth % 2;
13463
13458
  canvas.setWorld(matrix$1, options.matrix);
13464
13459
  canvas.beginPath();
@@ -13790,7 +13785,7 @@ const EditDataHelper = {
13790
13785
  getScaleData(target, startBounds, direction, totalMoveOrScale, lockRatio, around, flipable, scaleMode, boundsType) {
13791
13786
  let align, origin = {}, scaleX = 1, scaleY = 1, lockScale;
13792
13787
  const {widthRange: widthRange, heightRange: heightRange, dragBounds: dragBounds, worldTransform: worldTransform, boxBounds: boxBounds} = target;
13793
- const {width: width, height: height} = startBounds;
13788
+ const {width: width, height: height} = startBounds, worldScaleX = abs$4(worldTransform.scaleX), worldScaleY = abs$4(worldTransform.scaleY);
13794
13789
  const innerBounds = target.getBounds(boundsType, "inner");
13795
13790
  const originChangedScaleX = target.scaleX / startBounds.scaleX;
13796
13791
  const originChangedScaleY = target.scaleY / startBounds.scaleY;
@@ -13882,9 +13877,8 @@ const EditDataHelper = {
13882
13877
  if (useScaleX) scaleX /= changedScaleX;
13883
13878
  if (useScaleY) scaleY /= changedScaleY;
13884
13879
  if (!flipable) {
13885
- const {worldTransform: worldTransform} = target;
13886
- if (scaleX < 0) scaleX = 1 / innerBounds.width / worldTransform.scaleX;
13887
- if (scaleY < 0) scaleY = 1 / innerBounds.height / worldTransform.scaleY;
13880
+ if (scaleX < 0) scaleX = 1 / innerBounds.width / worldScaleX;
13881
+ if (scaleY < 0) scaleY = 1 / innerBounds.height / worldScaleY;
13888
13882
  }
13889
13883
  toPoint(around || align, innerBounds, origin, true);
13890
13884
  this.checkOrigin(target, origin, boundsType);
@@ -13905,13 +13899,14 @@ const EditDataHelper = {
13905
13899
  const nowHeight = innerBounds.height * target.scaleY;
13906
13900
  scaleY = within$3(nowHeight * scaleY, heightRange) / nowHeight;
13907
13901
  }
13908
- let minWidth = 1 * abs$4(worldTransform.scaleX), minHeight = 1 * abs$4(worldTransform.scaleY);
13902
+ let minWidth = 1, minHeight = 1;
13909
13903
  if (boundsType !== "box") {
13910
- minWidth += innerBounds.width - boxBounds.width;
13911
- minHeight += innerBounds.height - boxBounds.height;
13904
+ minWidth += (innerBounds.width - boxBounds.width) * worldScaleX;
13905
+ minHeight += (innerBounds.height - boxBounds.height) * worldScaleY;
13912
13906
  }
13913
- if (useScaleX && abs$4(scaleX * innerBounds.width) < minWidth) scaleX = sign$1(scaleX) * minWidth / innerBounds.width;
13914
- if (useScaleY && abs$4(scaleY * innerBounds.height) < minHeight) scaleY = sign$1(scaleY) * minHeight / innerBounds.height;
13907
+ const worldWidth = worldScaleX * innerBounds.width, worldHeight = worldScaleY * innerBounds.height;
13908
+ if (useScaleX && abs$4(scaleX * worldWidth) < minWidth) scaleX = sign$1(scaleX) * minWidth / worldWidth;
13909
+ if (useScaleY && abs$4(scaleY * worldHeight) < minHeight) scaleY = sign$1(scaleY) * minHeight / worldHeight;
13915
13910
  if (lockRatio && scaleX !== scaleY) {
13916
13911
  lockScale = Math.min(abs$4(scaleX), abs$4(scaleY));
13917
13912
  scaleX = sign$1(scaleX) * lockScale;
@@ -14294,8 +14289,8 @@ class EditBox extends Group {
14294
14289
  updateMoveCursor(this);
14295
14290
  }
14296
14291
  update() {
14297
- const {editor: editor, mergeConfig: mergeConfig} = this;
14298
- const {x: x, y: y, scaleX: scaleX, scaleY: scaleY, rotation: rotation, skewX: skewX, skewY: skewY, width: width, height: height} = this.target.getLayoutBounds(mergeConfig.editBoxType, editor, true);
14292
+ const {editor: editor} = this;
14293
+ const {x: x, y: y, scaleX: scaleX, scaleY: scaleY, rotation: rotation, skewX: skewX, skewY: skewY, width: width, height: height} = this.target.getLayoutBounds("box", editor, true);
14299
14294
  this.visible = !this.target.locked;
14300
14295
  this.set({
14301
14296
  x: x,
@@ -14318,9 +14313,9 @@ class EditBox extends Group {
14318
14313
  if (this.app) this.rect.syncEventer = this.app.interaction.bottomList = null;
14319
14314
  }
14320
14315
  updateBounds(bounds) {
14321
- const {editor: editor, mergedConfig: mergedConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
14316
+ const {editor: editor, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
14322
14317
  const {editMask: editMask} = editor;
14323
- const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergedConfig;
14318
+ const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, editBoxType: editBoxType, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergeConfig;
14324
14319
  editMask.visible = mask ? true : 0;
14325
14320
  if (!isUndefined(dimOthers) || !isUndefined(bright)) {
14326
14321
  editor.setDimOthers(dimOthers);
@@ -14329,6 +14324,7 @@ class EditBox extends Group {
14329
14324
  } else if (editor.hasDimOthers) {
14330
14325
  editor.cancelDimOthers();
14331
14326
  }
14327
+ if (editBoxType === "stroke") BoundsHelper.spread(bounds, editor.element.__layout.strokeBoxSpread);
14332
14328
  if (spread) BoundsHelper.spread(bounds, spread);
14333
14329
  if (this.view.worldOpacity) {
14334
14330
  const {width: width, height: height} = bounds;
@@ -14358,7 +14354,7 @@ class EditBox extends Group {
14358
14354
  }
14359
14355
  }
14360
14356
  }
14361
- circle.visible = showPoints && rotateable && !!(mergedConfig.circle || mergedConfig.rotatePoint);
14357
+ circle.visible = showPoints && rotateable && !!(mergeConfig.circle || mergeConfig.rotatePoint);
14362
14358
  if (circle.visible) this.layoutCircle();
14363
14359
  if (rect.path) rect.path = null;
14364
14360
  rect.set(Object.assign(Object.assign({}, bounds), {
@@ -15409,17 +15405,21 @@ let Editor = class Editor extends Group {
15409
15405
  if (EditToolCreator.list[name]) {
15410
15406
  const tool = this.editTool = this.getEditTool(name);
15411
15407
  this.editBox.load();
15408
+ tool.editTarget = target;
15412
15409
  tool.load();
15413
15410
  this.update();
15414
15411
  }
15415
15412
  }
15416
15413
  }
15417
- unloadEditTool() {
15414
+ unloadEditTool(onlyTool) {
15418
15415
  let tool = this.editTool;
15419
15416
  if (tool) {
15420
- this.editBox.unload();
15417
+ if (!onlyTool) {
15418
+ this.editBox.unload();
15419
+ this.editTool = null;
15420
+ }
15421
15421
  tool.unload();
15422
- this.editTool = null;
15422
+ tool.editTarget = null;
15423
15423
  }
15424
15424
  }
15425
15425
  getEditSize(_ui) {
@@ -15518,7 +15518,7 @@ let Editor = class Editor extends Group {
15518
15518
  if (isString(check)) name = check; else if (check === false) return;
15519
15519
  }
15520
15520
  if (EditToolCreator.list[name]) {
15521
- this.editTool.unload();
15521
+ this.unloadEditTool(true);
15522
15522
  this.innerEditing = true;
15523
15523
  this.innerEditor = this.getInnerEditor(name);
15524
15524
  this.innerEditor.editTarget = target;
@@ -15535,7 +15535,7 @@ let Editor = class Editor extends Group {
15535
15535
  this.innerEditor.unload();
15536
15536
  this.emitInnerEvent(InnerEditorEvent.CLOSE);
15537
15537
  if (!onlyInnerEditor) this.updateEditTool();
15538
- this.innerEditor = null;
15538
+ this.innerEditor = this.innerEditor.editTarget = null;
15539
15539
  }
15540
15540
  }
15541
15541
  emitInnerEvent(type) {
@@ -15670,8 +15670,13 @@ class InnerEditor {
15670
15670
  }
15671
15671
 
15672
15672
  let EditTool = class EditTool extends InnerEditor {
15673
- static registerEditTool(name) {
15673
+ static registerEditTool(name, changeTag) {
15674
15674
  EditToolCreator.register(this, name);
15675
+ if (changeTag) defineKey(this.prototype, "tag", {
15676
+ get() {
15677
+ return name;
15678
+ }
15679
+ });
15675
15680
  }
15676
15681
  get tag() {
15677
15682
  return "EditTool";
@@ -15733,7 +15738,7 @@ EditTool = __decorate([ registerEditTool() ], EditTool);
15733
15738
 
15734
15739
  const {left: left$1, right: right$1} = Direction9;
15735
15740
 
15736
- const {move: move$5, copy: copy$1, toNumberPoints: toNumberPoints} = PointHelper;
15741
+ const {move: move$5, copy: copy$2, toNumberPoints: toNumberPoints} = PointHelper;
15737
15742
 
15738
15743
  let LineEditTool = class LineEditTool extends EditTool {
15739
15744
  constructor() {
@@ -15825,10 +15830,10 @@ let LineEditTool = class LineEditTool extends EditTool {
15825
15830
  line.innerToWorld(from, from, false, editBox);
15826
15831
  line.innerToWorld(to, to, false, editBox);
15827
15832
  rect.pen.clearPath().moveTo(from.x, from.y).lineTo(to.x, to.y);
15828
- copy$1(resizePoints[7], from);
15829
- copy$1(rotatePoints[7], from);
15830
- copy$1(resizePoints[3], to);
15831
- copy$1(rotatePoints[3], to);
15833
+ copy$2(resizePoints[7], from);
15834
+ copy$2(rotatePoints[7], from);
15835
+ copy$2(resizePoints[3], to);
15836
+ copy$2(rotatePoints[3], to);
15832
15837
  }
15833
15838
  for (let i = 0; i < 8; i++) {
15834
15839
  if (i < 4) resizeLines[i].visible = false;
@@ -16008,7 +16013,7 @@ function scaleResizeGroup(group, scaleX, scaleY) {
16008
16013
  }
16009
16014
  }
16010
16015
 
16011
- const leaf = Leaf.prototype, tempPoint$1 = {}, {scale: scale$2, toOuterPoint: toOuterPoint} = MatrixHelper;
16016
+ const leaf = Leaf.prototype, tempPoint$1 = {}, tempMatrix = {}, {copy: copy$1, scale: scale$2, toOuterPoint: toOuterPoint} = MatrixHelper;
16012
16017
 
16013
16018
  leaf.scaleResize = function(scaleX, scaleY = scaleX, noResize, boundsType) {
16014
16019
  const data = this;
@@ -16016,14 +16021,16 @@ leaf.scaleResize = function(scaleX, scaleY = scaleX, noResize, boundsType) {
16016
16021
  data.scaleX *= scaleX;
16017
16022
  data.scaleY *= scaleY;
16018
16023
  } else {
16019
- const local = this.__localMatrix;
16020
- if (scaleX < 0) data.scaleX *= -1, scaleX = -scaleX, scale$2(local, -1, 1);
16021
- if (scaleY < 0) data.scaleY *= -1, scaleY = -scaleY, scale$2(local, 1, -1);
16024
+ if (scaleX < 0) data.scaleX *= -1, scaleX = -scaleX;
16025
+ if (scaleY < 0) data.scaleY *= -1, scaleY = -scaleY;
16022
16026
  if (boundsType === "stroke") {
16027
+ copy$1(tempMatrix, this.__localMatrix);
16028
+ if (scaleX < 0) scale$2(tempMatrix, -1, 1);
16029
+ if (scaleY < 0) scale$2(tempMatrix, 1, -1);
16023
16030
  const {boxBounds: boxBounds, strokeBounds: strokeBounds} = this.__layout, {x: x, y: y, width: width, height: height} = strokeBounds;
16024
16031
  tempPoint$1.x = (x - boxBounds.x) * (scaleX - 1);
16025
16032
  tempPoint$1.y = (y - boxBounds.y) * (scaleY - 1);
16026
- toOuterPoint(local, tempPoint$1, tempPoint$1, true);
16033
+ toOuterPoint(tempMatrix, tempPoint$1, tempPoint$1, true);
16027
16034
  this.x += tempPoint$1.x;
16028
16035
  this.y += tempPoint$1.y;
16029
16036
  scaleX = (width * scaleX - (width - boxBounds.width)) / boxBounds.width;
@@ -21065,4 +21072,4 @@ function isSame(a, b) {
21065
21072
 
21066
21073
  Plugin.add("corner");
21067
21074
 
21068
- export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, DragEvent, Dragger, DropEvent, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseBox, EllipseBoxData, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageBox, ImageBoxData, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferFilm, LeaferImage, LeaferTypeCreator, LeaferVideo, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathBox, PathBoxData, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonBox, PolygonBoxData, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, Scroller, SelectArea, Selector, Star, StarBox, StarBoxData, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, UnitConvertHelper, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$3 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$6 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
21075
+ export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, DragEvent, Dragger, DropEvent, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseBox, EllipseBoxData, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageBox, ImageBoxData, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferFilm, LeaferImage, LeaferTypeCreator, LeaferVideo, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathBox, PathBoxData, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonBox, PolygonBoxData, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, Scroller, SelectArea, Selector, Star, StarBox, StarBoxData, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, UnitConvertHelper, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$3 as tempBounds, tempMatrix$3 as tempMatrix, tempPoint$6 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };