@leafer/miniapp 2.1.2 → 2.1.4

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.
@@ -433,7 +433,7 @@ const {sin: sin$6, cos: cos$6, acos: acos, sqrt: sqrt$5} = Math;
433
433
 
434
434
  const {float: float$6} = MathHelper;
435
435
 
436
- const tempPoint$5 = {};
436
+ const tempPoint$6 = {};
437
437
 
438
438
  function getWorld() {
439
439
  return Object.assign(Object.assign(Object.assign({}, getMatrixData()), getBoundsData()), {
@@ -492,8 +492,8 @@ const MatrixHelper = {
492
492
  to.f = t.f * pixelRatio;
493
493
  },
494
494
  scaleOfOuter(t, origin, scaleX, scaleY) {
495
- M$c.toInnerPoint(t, origin, tempPoint$5);
496
- M$c.scaleOfInner(t, tempPoint$5, scaleX, scaleY);
495
+ M$c.toInnerPoint(t, origin, tempPoint$6);
496
+ M$c.scaleOfInner(t, tempPoint$6, scaleX, scaleY);
497
497
  },
498
498
  scaleOfInner(t, origin, scaleX, scaleY = scaleX) {
499
499
  M$c.translateInner(t, origin.x, origin.y);
@@ -511,8 +511,8 @@ const MatrixHelper = {
511
511
  t.d = c * sinR + d * cosR;
512
512
  },
513
513
  rotateOfOuter(t, origin, rotation) {
514
- M$c.toInnerPoint(t, origin, tempPoint$5);
515
- M$c.rotateOfInner(t, tempPoint$5, rotation);
514
+ M$c.toInnerPoint(t, origin, tempPoint$6);
515
+ M$c.rotateOfInner(t, tempPoint$6, rotation);
516
516
  },
517
517
  rotateOfInner(t, origin, rotation) {
518
518
  M$c.translateInner(t, origin.x, origin.y);
@@ -533,8 +533,8 @@ const MatrixHelper = {
533
533
  }
534
534
  },
535
535
  skewOfOuter(t, origin, skewX, skewY) {
536
- M$c.toInnerPoint(t, origin, tempPoint$5);
537
- M$c.skewOfInner(t, tempPoint$5, skewX, skewY);
536
+ M$c.toInnerPoint(t, origin, tempPoint$6);
537
+ M$c.skewOfInner(t, tempPoint$6, skewX, skewY);
538
538
  },
539
539
  skewOfInner(t, origin, skewX, skewY = 0) {
540
540
  M$c.translateInner(t, origin.x, origin.y);
@@ -733,7 +733,7 @@ const M$c = MatrixHelper;
733
733
 
734
734
  const {float: float$5} = MathHelper;
735
735
 
736
- const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
736
+ const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$4} = MatrixHelper;
737
737
 
738
738
  const {sin: sin$5, cos: cos$5, abs: abs$b, sqrt: sqrt$4, atan2: atan2$2, min: min$3, round: round$5} = Math;
739
739
 
@@ -791,7 +791,7 @@ const PointHelper = {
791
791
  tempToOuterOf(t, matrix) {
792
792
  const {tempPoint: temp} = P$7;
793
793
  copy$c(temp, t);
794
- toOuterPoint$3(matrix, temp, temp);
794
+ toOuterPoint$4(matrix, temp, temp);
795
795
  return temp;
796
796
  },
797
797
  tempToInnerRadiusPointOf(t, matrix) {
@@ -815,7 +815,7 @@ const PointHelper = {
815
815
  toInnerPoint$2(matrix, t, to);
816
816
  },
817
817
  toOuterOf(t, matrix, to) {
818
- toOuterPoint$3(matrix, t, to);
818
+ toOuterPoint$4(matrix, t, to);
819
819
  },
820
820
  getCenter(t, to) {
821
821
  return {
@@ -956,7 +956,7 @@ class Point {
956
956
  }
957
957
  }
958
958
 
959
- const tempPoint$4 = new Point;
959
+ const tempPoint$5 = new Point;
960
960
 
961
961
  class Matrix {
962
962
  constructor(a, b, c, d, e, f) {
@@ -1225,7 +1225,7 @@ const AlignHelper = {
1225
1225
 
1226
1226
  const {tempPointBounds: tempPointBounds$1, setPoint: setPoint$5, addPoint: addPoint$3, toBounds: toBounds$3} = TwoPointBoundsHelper;
1227
1227
 
1228
- const {toOuterPoint: toOuterPoint$2} = MatrixHelper;
1228
+ const {toOuterPoint: toOuterPoint$3} = MatrixHelper;
1229
1229
 
1230
1230
  const {float: float$4, fourNumber: fourNumber$1} = MathHelper;
1231
1231
 
@@ -1339,16 +1339,16 @@ const BoundsHelper = {
1339
1339
  } else {
1340
1340
  point$2.x = t.x;
1341
1341
  point$2.y = t.y;
1342
- toOuterPoint$2(matrix, point$2, toPoint$5);
1342
+ toOuterPoint$3(matrix, point$2, toPoint$5);
1343
1343
  setPoint$5(tempPointBounds$1, toPoint$5.x, toPoint$5.y);
1344
1344
  point$2.x = t.x + t.width;
1345
- toOuterPoint$2(matrix, point$2, toPoint$5);
1345
+ toOuterPoint$3(matrix, point$2, toPoint$5);
1346
1346
  addPoint$3(tempPointBounds$1, toPoint$5.x, toPoint$5.y);
1347
1347
  point$2.y = t.y + t.height;
1348
- toOuterPoint$2(matrix, point$2, toPoint$5);
1348
+ toOuterPoint$3(matrix, point$2, toPoint$5);
1349
1349
  addPoint$3(tempPointBounds$1, toPoint$5.x, toPoint$5.y);
1350
1350
  point$2.x = t.x;
1351
- toOuterPoint$2(matrix, point$2, toPoint$5);
1351
+ toOuterPoint$3(matrix, point$2, toPoint$5);
1352
1352
  addPoint$3(tempPointBounds$1, toPoint$5.x, toPoint$5.y);
1353
1353
  toBounds$3(tempPointBounds$1, to);
1354
1354
  }
@@ -2708,7 +2708,7 @@ const {set: set$1, toNumberPoints: toNumberPoints$1} = PointHelper;
2708
2708
 
2709
2709
  const {M: M$b, L: L$b, C: C$9, Q: Q$7, Z: Z$9} = PathCommandMap;
2710
2710
 
2711
- const tempPoint$3 = {};
2711
+ const tempPoint$4 = {};
2712
2712
 
2713
2713
  const BezierHelper = {
2714
2714
  points(data, originPoints, curve, close) {
@@ -2879,8 +2879,8 @@ const BezierHelper = {
2879
2879
  addMode ? addPoint$2(pointBounds, fromX, fromY) : setPoint$4(pointBounds, fromX, fromY);
2880
2880
  addPoint$2(pointBounds, toX, toY);
2881
2881
  for (let i = 0, len = tList.length; i < len; i++) {
2882
- getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$3);
2883
- addPoint$2(pointBounds, tempPoint$3.x, tempPoint$3.y);
2882
+ getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$4);
2883
+ addPoint$2(pointBounds, tempPoint$4.x, tempPoint$4.y);
2884
2884
  }
2885
2885
  },
2886
2886
  getPointAndSet(t, fromX, fromY, x1, y1, x2, y2, toX, toY, setPoint) {
@@ -3048,6 +3048,7 @@ const PathConvert = {
3048
3048
  current.length = PathCommandLengthMap[char];
3049
3049
  current.index = 0;
3050
3050
  pushData(data, current.name);
3051
+ if (char === "m") current.name = PathCommandMap["l"]; else if (char === "M") current.name = PathCommandMap["L"];
3051
3052
  if (!needConvert && convertCommand[char]) needConvert = true;
3052
3053
  } else {
3053
3054
  if (char === "-" || char === "+") {
@@ -3080,10 +3081,9 @@ const PathConvert = {
3080
3081
  old[i + 2] += y;
3081
3082
 
3082
3083
  case M$a:
3083
- x = old[i + 1];
3084
- y = old[i + 2];
3085
- if (lastCommand === command) data.push(L$a, x, y); else data.push(M$a, x, y), startX = x,
3086
- startY = y;
3084
+ x = startX = old[i + 1];
3085
+ y = startY = old[i + 2];
3086
+ data.push(M$a, x, y);
3087
3087
  i += 3;
3088
3088
  break;
3089
3089
 
@@ -3125,8 +3125,8 @@ const PathConvert = {
3125
3125
 
3126
3126
  case S$1:
3127
3127
  smooth = lastCommand === C$8 || lastCommand === S$1;
3128
- x1 = smooth ? x * 2 - controlX : old[i + 1];
3129
- y1 = smooth ? y * 2 - controlY : old[i + 2];
3128
+ x1 = smooth ? x * 2 - controlX : x;
3129
+ y1 = smooth ? y * 2 - controlY : y;
3130
3130
  controlX = old[i + 1];
3131
3131
  controlY = old[i + 2];
3132
3132
  x = old[i + 3];
@@ -3160,8 +3160,8 @@ const PathConvert = {
3160
3160
 
3161
3161
  case T:
3162
3162
  smooth = lastCommand === Q$6 || lastCommand === T;
3163
- controlX = smooth ? x * 2 - controlX : old[i + 1];
3164
- controlY = smooth ? y * 2 - controlY : old[i + 2];
3163
+ controlX = smooth ? x * 2 - controlX : x;
3164
+ controlY = smooth ? y * 2 - controlY : y;
3165
3165
  curveMode ? quadraticCurveTo$1(data, x, y, controlX, controlY, old[i + 1], old[i + 2]) : data.push(Q$6, controlX, controlY, old[i + 1], old[i + 2]);
3166
3166
  x = old[i + 1];
3167
3167
  y = old[i + 2];
@@ -4770,7 +4770,7 @@ function registerUIEvent() {
4770
4770
  };
4771
4771
  }
4772
4772
 
4773
- const {copy: copy$8, toInnerPoint: toInnerPoint$1, toOuterPoint: toOuterPoint$1, scaleOfOuter: scaleOfOuter$2, rotateOfOuter: rotateOfOuter$2, skewOfOuter: skewOfOuter, multiplyParent: multiplyParent$3, divideParent: divideParent, getLayout: getLayout} = MatrixHelper;
4773
+ 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;
4774
4774
 
4775
4775
  const matrix$3 = {}, {round: round$3} = Math;
4776
4776
 
@@ -4853,7 +4853,7 @@ const LeafHelper = {
4853
4853
  x: x,
4854
4854
  y: y
4855
4855
  };
4856
- isInnerPoint ? toOuterPoint$1(t.localTransform, local, local, true) : t.parent && toInnerPoint$1(t.parent.scrollWorldTransform, local, local, true);
4856
+ isInnerPoint ? toOuterPoint$2(t.localTransform, local, local, true) : t.parent && toInnerPoint$1(t.parent.scrollWorldTransform, local, local, true);
4857
4857
  L$5.moveLocal(t, local.x, local.y, transition);
4858
4858
  },
4859
4859
  moveLocal(t, x, y = 0, transition) {
@@ -4866,10 +4866,10 @@ const LeafHelper = {
4866
4866
  y: y
4867
4867
  }, transition) : (t.x = x, t.y = y);
4868
4868
  },
4869
- zoomOfWorld(t, origin, scaleX, scaleY, resize, transition) {
4870
- L$5.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize, transition);
4869
+ zoomOfWorld(t, origin, scaleX, scaleY, resize, transition, boundsType) {
4870
+ L$5.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize, transition, boundsType);
4871
4871
  },
4872
- zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize, transition) {
4872
+ zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize, transition, boundsType) {
4873
4873
  const o = t.__localMatrix;
4874
4874
  if (!isNumber(scaleY)) {
4875
4875
  if (scaleY) transition = scaleY;
@@ -4878,7 +4878,7 @@ const LeafHelper = {
4878
4878
  copy$8(matrix$3, o);
4879
4879
  scaleOfOuter$2(matrix$3, origin, scaleX, scaleY);
4880
4880
  if (L$5.hasHighPosition(t)) {
4881
- L$5.setTransform(t, matrix$3, resize, transition);
4881
+ L$5.setTransform(t, matrix$3, resize, transition, boundsType);
4882
4882
  } else {
4883
4883
  const x = t.x + matrix$3.e - o.e, y = t.y + matrix$3.f - o.f;
4884
4884
  if (transition && !resize) t.animate({
@@ -4886,7 +4886,7 @@ const LeafHelper = {
4886
4886
  y: y,
4887
4887
  scaleX: t.scaleX * scaleX,
4888
4888
  scaleY: t.scaleY * scaleY
4889
- }, transition); else t.x = x, t.y = y, t.scaleResize(scaleX, scaleY, resize !== true);
4889
+ }, transition); else t.x = x, t.y = y, t.scaleResize(scaleX, scaleY, resize !== true, boundsType);
4890
4890
  }
4891
4891
  },
4892
4892
  rotateOfWorld(t, origin, angle, transition) {
@@ -4910,18 +4910,18 @@ const LeafHelper = {
4910
4910
  skewOfOuter(matrix$3, origin, skewX, skewY);
4911
4911
  L$5.setTransform(t, matrix$3, resize, transition);
4912
4912
  },
4913
- transformWorld(t, transform, resize, transition) {
4913
+ transformWorld(t, transform, resize, transition, boundsType) {
4914
4914
  copy$8(matrix$3, t.worldTransform);
4915
4915
  multiplyParent$3(matrix$3, transform);
4916
4916
  if (t.parent) divideParent(matrix$3, t.parent.scrollWorldTransform);
4917
- L$5.setTransform(t, matrix$3, resize, transition);
4917
+ L$5.setTransform(t, matrix$3, resize, transition, boundsType);
4918
4918
  },
4919
- transform(t, transform, resize, transition) {
4919
+ transform(t, transform, resize, transition, boundsType) {
4920
4920
  copy$8(matrix$3, t.localTransform);
4921
4921
  multiplyParent$3(matrix$3, transform);
4922
- L$5.setTransform(t, matrix$3, resize, transition);
4922
+ L$5.setTransform(t, matrix$3, resize, transition, boundsType);
4923
4923
  },
4924
- setTransform(t, transform, resize, transition) {
4924
+ setTransform(t, transform, resize, transition, boundsType) {
4925
4925
  const data = t.__, originPoint = data.origin && L$5.getInnerOrigin(t, data.origin);
4926
4926
  const layout = getLayout(transform, originPoint, data.around && L$5.getInnerOrigin(t, data.around));
4927
4927
  if (L$5.hasOffset(t)) {
@@ -4937,7 +4937,7 @@ const LeafHelper = {
4937
4937
  PointHelper.move(layout, originPoint.x - changedPoint.x, originPoint.y - changedPoint.y);
4938
4938
  }
4939
4939
  t.set(layout);
4940
- t.scaleResize(scaleX, scaleY, false);
4940
+ t.scaleResize(scaleX, scaleY, false, boundsType);
4941
4941
  } else t.set(layout, transition);
4942
4942
  },
4943
4943
  getFlipTransform(t, axis) {
@@ -5147,12 +5147,12 @@ const BranchHelper = {
5147
5147
  w.height *= scaleY;
5148
5148
  w.scaleX *= scaleX;
5149
5149
  w.scaleY *= scaleY;
5150
- if (branch.isBranch) scale$3(branch, x, y, scaleX, scaleY, a, b);
5150
+ if (branch.isBranch) scale$4(branch, x, y, scaleX, scaleY, a, b);
5151
5151
  }
5152
5152
  }
5153
5153
  };
5154
5154
 
5155
- const {pushAllChildBranch: pushAllChildBranch$1, pushAllBranchStack: pushAllBranchStack, updateBoundsByBranchStack: updateBoundsByBranchStack, move: move$9, scale: scale$3} = BranchHelper;
5155
+ const {pushAllChildBranch: pushAllChildBranch$1, pushAllBranchStack: pushAllBranchStack, updateBoundsByBranchStack: updateBoundsByBranchStack, move: move$9, scale: scale$4} = BranchHelper;
5156
5156
 
5157
5157
  const WaitHelper = {
5158
5158
  run(wait) {
@@ -6028,7 +6028,7 @@ const LeafDataProxy = {
6028
6028
 
6029
6029
  const {setLayout: setLayout, multiplyParent: multiplyParent$2, translateInner: translateInner, defaultWorld: defaultWorld} = MatrixHelper;
6030
6030
 
6031
- const {toPoint: toPoint$4, tempPoint: tempPoint$2} = AroundHelper;
6031
+ const {toPoint: toPoint$4, tempPoint: tempPoint$3} = AroundHelper;
6032
6032
 
6033
6033
  const LeafMatrix = {
6034
6034
  __updateWorldMatrix() {
@@ -6049,8 +6049,8 @@ const LeafMatrix = {
6049
6049
  local.e = data.x + data.offsetX;
6050
6050
  local.f = data.y + data.offsetY;
6051
6051
  if (data.around || data.origin) {
6052
- toPoint$4(data.around || data.origin, layout.boxBounds, tempPoint$2);
6053
- translateInner(local, -tempPoint$2.x, -tempPoint$2.y, !data.around);
6052
+ toPoint$4(data.around || data.origin, layout.boxBounds, tempPoint$3);
6053
+ translateInner(local, -tempPoint$3.x, -tempPoint$3.y, !data.around);
6054
6054
  }
6055
6055
  }
6056
6056
  this.__layout.matrixChanged = undefined;
@@ -6084,39 +6084,45 @@ const LeafBounds = {
6084
6084
  this.__updateRenderPath();
6085
6085
  this.__updateBoxBounds();
6086
6086
  layout.resized = "inner";
6087
- if (data.__strokeGeometry) data.__strokeGeometry = undefined;
6088
6087
  }
6089
6088
  if (layout.localBoxChanged) {
6090
6089
  if (this.__local) this.__updateLocalBoxBounds();
6091
6090
  layout.localBoxChanged = undefined;
6092
- if (layout.strokeSpread) layout.strokeChanged = true;
6093
- if (layout.renderSpread) layout.renderChanged = true;
6091
+ if (layout.strokeSpread && !layout.strokeChanged) layout.strokeChanged = layout.boxChanged ? true : 2;
6092
+ if (layout.renderSpread && !layout.renderChanged) layout.renderChanged = layout.boxChanged ? true : 2;
6094
6093
  if (this.parent) this.parent.__layout.boxChange();
6095
6094
  }
6096
6095
  layout.boxChanged = undefined;
6097
6096
  if (layout.strokeChanged) {
6098
- layout.strokeSpread = this.__updateStrokeSpread();
6099
- if (layout.strokeSpread) {
6100
- if (layout.strokeBounds === layout.boxBounds) layout.spreadStroke();
6101
- this.__updateStrokeBounds();
6097
+ if (layout.strokeChanged === 2) {
6102
6098
  this.__updateLocalStrokeBounds();
6103
6099
  } else {
6104
- layout.spreadStrokeCancel();
6100
+ layout.strokeSpread = this.__updateStrokeSpread();
6101
+ if (layout.strokeSpread) {
6102
+ if (layout.strokeBounds === layout.boxBounds) layout.spreadStroke();
6103
+ this.__updateStrokeBounds();
6104
+ this.__updateLocalStrokeBounds();
6105
+ } else {
6106
+ layout.spreadStrokeCancel();
6107
+ }
6108
+ layout.resized = "inner";
6109
+ if (layout.renderSpread || layout.strokeSpread !== layout.strokeBoxSpread) layout.renderChanged = true;
6105
6110
  }
6106
6111
  layout.strokeChanged = undefined;
6107
- if (layout.renderSpread || layout.strokeSpread !== layout.strokeBoxSpread) layout.renderChanged = true;
6108
6112
  if (this.parent) this.parent.__layout.strokeChange();
6109
- layout.resized = "inner";
6110
- if (data.__strokeGeometry) data.__strokeGeometry = undefined;
6111
6113
  }
6112
6114
  if (layout.renderChanged) {
6113
- layout.renderSpread = this.__updateRenderSpread();
6114
- if (layout.renderSpread) {
6115
- if (layout.renderBounds === layout.boxBounds || layout.renderBounds === layout.strokeBounds) layout.spreadRender();
6116
- this.__updateRenderBounds();
6115
+ if (layout.renderChanged === 2) {
6117
6116
  this.__updateLocalRenderBounds();
6118
6117
  } else {
6119
- layout.spreadRenderCancel();
6118
+ layout.renderSpread = this.__updateRenderSpread();
6119
+ if (layout.renderSpread) {
6120
+ if (layout.renderBounds === layout.boxBounds || layout.renderBounds === layout.strokeBounds) layout.spreadRender();
6121
+ this.__updateRenderBounds();
6122
+ this.__updateLocalRenderBounds();
6123
+ } else {
6124
+ layout.spreadRenderCancel();
6125
+ }
6120
6126
  }
6121
6127
  layout.renderChanged = undefined;
6122
6128
  if (this.parent) this.parent.__layout.renderChange();
@@ -6276,7 +6282,7 @@ const {LEAF: LEAF, create: create} = IncrementId;
6276
6282
 
6277
6283
  const {stintSet: stintSet$6} = DataHelper;
6278
6284
 
6279
- const {toInnerPoint: toInnerPoint, toOuterPoint: toOuterPoint, multiplyParent: multiplyParent$1} = MatrixHelper;
6285
+ const {toInnerPoint: toInnerPoint, toOuterPoint: toOuterPoint$1, multiplyParent: multiplyParent$1} = MatrixHelper;
6280
6286
 
6281
6287
  const {toOuterOf: toOuterOf$1} = BoundsHelper;
6282
6288
 
@@ -6615,7 +6621,7 @@ let Leaf = class Leaf {
6615
6621
  toInnerPoint(this.worldTransform, world, to, distance);
6616
6622
  }
6617
6623
  innerToWorld(inner, to, distance, relative) {
6618
- toOuterPoint(this.worldTransform, inner, to, distance);
6624
+ toOuterPoint$1(this.worldTransform, inner, to, distance);
6619
6625
  if (relative) relative.worldToInner(to ? to : inner, null, distance);
6620
6626
  }
6621
6627
  getBoxPoint(world, relative, distance, change) {
@@ -6670,11 +6676,11 @@ let Leaf = class Leaf {
6670
6676
  const layer = this.leafer ? this.leafer.zoomLayer : this;
6671
6677
  return layer.getWorldPoint(page, relative, distance, change);
6672
6678
  }
6673
- setTransform(matrix, resize, transition) {
6674
- setTransform(this, matrix, resize, transition);
6679
+ setTransform(matrix, resize, transition, boundsType) {
6680
+ setTransform(this, matrix, resize, transition, boundsType);
6675
6681
  }
6676
- transform(matrix, resize, transition) {
6677
- transform(this, matrix, resize, transition);
6682
+ transform(matrix, resize, transition, boundsType) {
6683
+ transform(this, matrix, resize, transition, boundsType);
6678
6684
  }
6679
6685
  move(x, y, transition) {
6680
6686
  moveLocal(this, x, y, transition);
@@ -6682,8 +6688,8 @@ let Leaf = class Leaf {
6682
6688
  moveInner(x, y, transition) {
6683
6689
  moveWorld(this, x, y, true, transition);
6684
6690
  }
6685
- scaleOf(origin, scaleX, scaleY, resize, transition) {
6686
- zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize, transition);
6691
+ scaleOf(origin, scaleX, scaleY, resize, transition, boundsType) {
6692
+ zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize, transition, boundsType);
6687
6693
  }
6688
6694
  rotateOf(origin, rotation, transition) {
6689
6695
  rotateOfLocal(this, getLocalOrigin(this, origin), rotation, transition);
@@ -6691,14 +6697,14 @@ let Leaf = class Leaf {
6691
6697
  skewOf(origin, skewX, skewY, resize, transition) {
6692
6698
  skewOfLocal(this, getLocalOrigin(this, origin), skewX, skewY, resize, transition);
6693
6699
  }
6694
- transformWorld(worldTransform, resize, transition) {
6695
- transformWorld(this, worldTransform, resize, transition);
6700
+ transformWorld(worldTransform, resize, transition, boundsType) {
6701
+ transformWorld(this, worldTransform, resize, transition, boundsType);
6696
6702
  }
6697
6703
  moveWorld(x, y, transition) {
6698
6704
  moveWorld(this, x, y, false, transition);
6699
6705
  }
6700
- scaleOfWorld(worldOrigin, scaleX, scaleY, resize, transition) {
6701
- zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize, transition);
6706
+ scaleOfWorld(worldOrigin, scaleX, scaleY, resize, transition, boundsType) {
6707
+ zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize, transition, boundsType);
6702
6708
  }
6703
6709
  rotateOfWorld(worldOrigin, rotation) {
6704
6710
  rotateOfWorld(this, worldOrigin, rotation);
@@ -6709,7 +6715,7 @@ let Leaf = class Leaf {
6709
6715
  flip(axis, transition) {
6710
6716
  transform(this, getFlipTransform(this, axis), false, transition);
6711
6717
  }
6712
- scaleResize(scaleX, scaleY = scaleX, _noResize) {
6718
+ scaleResize(scaleX, scaleY = scaleX, _noResize, _boundsType) {
6713
6719
  this.scaleX *= scaleX;
6714
6720
  this.scaleY *= scaleY;
6715
6721
  }
@@ -7084,7 +7090,7 @@ class LeafLevelList {
7084
7090
  }
7085
7091
  }
7086
7092
 
7087
- const version = "2.1.2";
7093
+ const version = "2.1.4";
7088
7094
 
7089
7095
  class LeaferCanvas extends LeaferCanvasBase {
7090
7096
  get allowBackgroundColor() {
@@ -7900,7 +7906,7 @@ class Renderer {
7900
7906
 
7901
7907
  Renderer.clipSpread = 10;
7902
7908
 
7903
- const tempPoint$1 = {};
7909
+ const tempPoint$2 = {};
7904
7910
 
7905
7911
  const {copyRadiusPoint: copyRadiusPoint$1} = PointHelper;
7906
7912
 
@@ -8035,7 +8041,7 @@ class Picker {
8035
8041
  for (let i = len - 1; i > -1; i--) {
8036
8042
  child = children[i], data = child.__;
8037
8043
  if (!data.visible || hitMask && !data.mask) continue;
8038
- hit = hitRadiusPoint$1(child.__world, data.hitRadius ? copyRadiusPoint$1(tempPoint$1, point, data.hitRadius) : point);
8044
+ hit = hitRadiusPoint$1(child.__world, data.hitRadius ? copyRadiusPoint$1(tempPoint$2, point, data.hitRadius) : point);
8039
8045
  if (child.isBranch) {
8040
8046
  if (hit || child.__ignoreHitWorld) {
8041
8047
  if (child.isBranchLeaf && data.__clipAfterFill && !child.__hitWorld(point, true)) continue;
@@ -12155,7 +12161,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
12155
12161
  needUpdate = false;
12156
12162
  }
12157
12163
  }
12158
- if (paint.mode === "brush") PaintImage.brush(leafPaint);
12164
+ if (paint.mode === "brush") PaintImage.brush(leafPaint, ui);
12159
12165
  if (!leafPaint.data) {
12160
12166
  PaintImage.createData(leafPaint, image, paint, boxBounds);
12161
12167
  const {transform: transform} = leafPaint.data, {opacity: opacity} = paint;
@@ -12371,7 +12377,7 @@ function layout$3(transform, box, x, y, scaleX, scaleY, rotation, skew) {
12371
12377
  translate(transform, box.x + x, box.y + y);
12372
12378
  }
12373
12379
 
12374
- const {get: get$1, scale: scale$2, copy: copy$4} = MatrixHelper;
12380
+ const {get: get$1, scale: scale$3, copy: copy$4} = MatrixHelper;
12375
12381
 
12376
12382
  const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$7} = Math;
12377
12383
 
@@ -12409,11 +12415,15 @@ function createPattern(paint, ui, canvas, renderOptions) {
12409
12415
  scaleY *= getFloorScale(height + (yGap || 0));
12410
12416
  imageMatrix = get$1();
12411
12417
  if (transform) copy$4(imageMatrix, transform);
12412
- scale$2(imageMatrix, 1 / scaleX, 1 / scaleY);
12418
+ scale$3(imageMatrix, 1 / scaleX, 1 / scaleY);
12413
12419
  }
12414
12420
  const imageCanvas = image.getCanvas(width, height, opacity, undefined, xGap, yGap, ui.leafer && ui.leafer.config.smooth, data.interlace);
12415
- const pattern = brush ? imageCanvas : image.getPattern(imageCanvas, data.repeat || (Platform.origin.noRepeat || "no-repeat"), imageMatrix, paint);
12416
- paint.style = pattern;
12421
+ if (brush) {
12422
+ paint.style = imageCanvas;
12423
+ PaintImage.cacheBrush(paint, ui, canvas, renderOptions);
12424
+ } else {
12425
+ paint.style = image.getPattern(imageCanvas, data.repeat || (Platform.origin.noRepeat || "no-repeat"), imageMatrix, paint);
12426
+ }
12417
12427
  paint.patternId = id;
12418
12428
  }
12419
12429
  }
@@ -13504,10 +13514,11 @@ function mergeConfigAttr() {
13504
13514
  if (innerEditor) innerEditor.editConfig && Object.assign(mergeConfig, innerEditor.editConfig); else if (editTool) editTool.editConfig && Object.assign(mergeConfig, editTool.editConfig);
13505
13515
  if (element && element.editConfig) {
13506
13516
  let {editConfig: editConfig} = element;
13507
- if (editConfig.hover || editConfig.hoverStyle) {
13517
+ if (editConfig.hover || editConfig.hoverStyle || editConfig.hoverPathType) {
13508
13518
  editConfig = Object.assign({}, editConfig);
13509
13519
  delete editConfig.hover;
13510
13520
  delete editConfig.hoverStyle;
13521
+ delete editConfig.hoverPathType;
13511
13522
  }
13512
13523
  Object.assign(mergeConfig, editConfig);
13513
13524
  }
@@ -13575,9 +13586,22 @@ class Stroker extends UI {
13575
13586
  matrix$1.half = strokeWidth % 2;
13576
13587
  canvas.setWorld(matrix$1, options.matrix);
13577
13588
  canvas.beginPath();
13578
- if (this.strokePathType === "path") {
13589
+ switch (this.strokePathType) {
13590
+ case "box":
13591
+ const {boxBounds: boxBounds} = leaf.__layout;
13592
+ canvas.rect(boxBounds.x, boxBounds.y, boxBounds.width, boxBounds.height);
13593
+ break;
13594
+
13595
+ case "stroke":
13596
+ const {strokeBounds: strokeBounds} = leaf.__layout;
13597
+ canvas.rect(strokeBounds.x, strokeBounds.y, strokeBounds.width, strokeBounds.height);
13598
+ break;
13599
+
13600
+ case "path":
13579
13601
  leaf.__drawPath(canvas);
13580
- } else {
13602
+ break;
13603
+
13604
+ default:
13581
13605
  if (leaf.__.__useArrow) leaf.__drawPath(canvas); else leaf.__.__pathForRender ? leaf.__drawRenderPath(canvas) : leaf.__drawPathByBox(canvas);
13582
13606
  }
13583
13607
  data.strokeWidth = strokeWidth / Math.max(aScaleX, aScaleY);
@@ -13700,10 +13724,11 @@ class EditSelect extends Group {
13700
13724
  if (this.running && !this.dragging && !editor.dragging) {
13701
13725
  const {hoverTarget: hoverTarget, mergeConfig: mergeConfig} = editor, config = Object.assign({}, mergeConfig);
13702
13726
  if (hoverTarget && hoverTarget.editConfig) Object.assign(config, hoverTarget.editConfig);
13703
- const {stroke: stroke, strokeWidth: strokeWidth, hover: hover, hoverStyle: hoverStyle} = config;
13727
+ const {stroke: stroke, strokeWidth: strokeWidth, hover: hover, hoverStyle: hoverStyle, hoverPathType: hoverPathType} = config;
13704
13728
  this.hoverStroker.setTarget(hover ? hoverTarget : null, Object.assign({
13705
13729
  stroke: stroke,
13706
- strokeWidth: strokeWidth
13730
+ strokeWidth: strokeWidth,
13731
+ strokePathType: hoverPathType
13707
13732
  }, hoverStyle || {}));
13708
13733
  } else {
13709
13734
  this.hoverStroker.target = null;
@@ -13886,16 +13911,17 @@ const {topLeft: topLeft$1, top: top$1, topRight: topRight$1, right: right$2, bot
13886
13911
  const {toPoint: toPoint} = AroundHelper, {within: within$3, sign: sign$1} = MathHelper, {abs: abs$4} = Math;
13887
13912
 
13888
13913
  const EditDataHelper = {
13889
- getScaleData(target, startBounds, direction, totalMoveOrScale, lockRatio, around, flipable, scaleMode) {
13914
+ getScaleData(target, startBounds, direction, totalMoveOrScale, lockRatio, around, flipable, scaleMode, boundsType) {
13890
13915
  let align, origin = {}, scaleX = 1, scaleY = 1, lockScale;
13891
- const {boxBounds: boxBounds, widthRange: widthRange, heightRange: heightRange, dragBounds: dragBounds, worldBoxBounds: worldBoxBounds} = target;
13916
+ const {widthRange: widthRange, heightRange: heightRange, dragBounds: dragBounds, worldTransform: worldTransform, boxBounds: boxBounds} = target;
13892
13917
  const {width: width, height: height} = startBounds;
13918
+ const innerBounds = target.getBounds(boundsType, "inner");
13893
13919
  const originChangedScaleX = target.scaleX / startBounds.scaleX;
13894
13920
  const originChangedScaleY = target.scaleY / startBounds.scaleY;
13895
13921
  const signX = sign$1(originChangedScaleX);
13896
13922
  const signY = sign$1(originChangedScaleY);
13897
- const changedScaleX = scaleMode ? originChangedScaleX : signX * boxBounds.width / width;
13898
- const changedScaleY = scaleMode ? originChangedScaleY : signY * boxBounds.height / height;
13923
+ const changedScaleX = scaleMode ? originChangedScaleX : signX * innerBounds.width / width;
13924
+ const changedScaleY = scaleMode ? originChangedScaleY : signY * innerBounds.height / height;
13899
13925
  if (isNumber(totalMoveOrScale)) {
13900
13926
  scaleX = scaleY = Math.sqrt(totalMoveOrScale);
13901
13927
  } else {
@@ -13981,10 +14007,11 @@ const EditDataHelper = {
13981
14007
  if (useScaleY) scaleY /= changedScaleY;
13982
14008
  if (!flipable) {
13983
14009
  const {worldTransform: worldTransform} = target;
13984
- if (scaleX < 0) scaleX = 1 / boxBounds.width / worldTransform.scaleX;
13985
- if (scaleY < 0) scaleY = 1 / boxBounds.height / worldTransform.scaleY;
14010
+ if (scaleX < 0) scaleX = 1 / innerBounds.width / worldTransform.scaleX;
14011
+ if (scaleY < 0) scaleY = 1 / innerBounds.height / worldTransform.scaleY;
13986
14012
  }
13987
- toPoint(around || align, boxBounds, origin, true);
14013
+ toPoint(around || align, innerBounds, origin, true);
14014
+ this.checkOrigin(target, origin, boundsType);
13988
14015
  if (dragBounds) {
13989
14016
  const scaleData = {
13990
14017
  x: scaleX,
@@ -13995,15 +14022,20 @@ const EditDataHelper = {
13995
14022
  scaleY = scaleData.y;
13996
14023
  }
13997
14024
  if (useScaleX && widthRange) {
13998
- const nowWidth = boxBounds.width * target.scaleX;
14025
+ const nowWidth = innerBounds.width * target.scaleX;
13999
14026
  scaleX = within$3(nowWidth * scaleX, widthRange) / nowWidth;
14000
14027
  }
14001
14028
  if (useScaleY && heightRange) {
14002
- const nowHeight = boxBounds.height * target.scaleY;
14029
+ const nowHeight = innerBounds.height * target.scaleY;
14003
14030
  scaleY = within$3(nowHeight * scaleY, heightRange) / nowHeight;
14004
14031
  }
14005
- if (useScaleX && abs$4(scaleX * worldBoxBounds.width) < 1) scaleX = sign$1(scaleX) / worldBoxBounds.width;
14006
- if (useScaleY && abs$4(scaleY * worldBoxBounds.height) < 1) scaleY = sign$1(scaleY) / worldBoxBounds.height;
14032
+ let minWidth = 1 * abs$4(worldTransform.scaleX), minHeight = 1 * abs$4(worldTransform.scaleY);
14033
+ if (boundsType !== "box") {
14034
+ minWidth += innerBounds.width - boxBounds.width;
14035
+ minHeight += innerBounds.height - boxBounds.height;
14036
+ }
14037
+ if (useScaleX && abs$4(scaleX * innerBounds.width) < minWidth) scaleX = sign$1(scaleX) * minWidth / innerBounds.width;
14038
+ if (useScaleY && abs$4(scaleY * innerBounds.height) < minHeight) scaleY = sign$1(scaleY) * minHeight / innerBounds.height;
14007
14039
  if (lockRatio && scaleX !== scaleY) {
14008
14040
  lockScale = Math.min(abs$4(scaleX), abs$4(scaleY));
14009
14041
  scaleX = sign$1(scaleX) * lockScale;
@@ -14020,7 +14052,7 @@ const EditDataHelper = {
14020
14052
  around: around
14021
14053
  };
14022
14054
  },
14023
- getRotateData(target, direction, current, last, around) {
14055
+ getRotateData(target, direction, current, last, around, boundsType) {
14024
14056
  let align, origin = {};
14025
14057
  switch (direction) {
14026
14058
  case topLeft$1:
@@ -14042,13 +14074,14 @@ const EditDataHelper = {
14042
14074
  default:
14043
14075
  align = "center";
14044
14076
  }
14045
- toPoint(around || align, target.boxBounds, origin, true);
14077
+ toPoint(around || align, target.getBounds(boundsType, "inner"), origin, true);
14078
+ this.checkOrigin(target, origin, boundsType);
14046
14079
  return {
14047
14080
  origin: origin,
14048
14081
  rotation: PointHelper.getRotation(last, target.getWorldPointByBox(origin), current)
14049
14082
  };
14050
14083
  },
14051
- getSkewData(bounds, direction, move, around) {
14084
+ getSkewData(target, direction, move, around, boundsType) {
14052
14085
  let align, origin = {}, skewX = 0, skewY = 0;
14053
14086
  let last;
14054
14087
  switch (direction) {
@@ -14091,10 +14124,12 @@ const EditDataHelper = {
14091
14124
  align = "left";
14092
14125
  skewY = 1;
14093
14126
  }
14094
- const {width: width, height: height} = bounds;
14127
+ const innerBounds = target.getBounds(boundsType, "inner");
14128
+ const {width: width, height: height} = innerBounds;
14095
14129
  last.x = last.x * width;
14096
14130
  last.y = last.y * height;
14097
- toPoint(around || align, bounds, origin, true);
14131
+ toPoint(around || align, innerBounds, origin, true);
14132
+ this.checkOrigin(target, origin, boundsType);
14098
14133
  const rotation = PointHelper.getRotation(last, origin, {
14099
14134
  x: last.x + (skewX ? move.x : 0),
14100
14135
  y: last.y + (skewY ? move.y : 0)
@@ -14106,6 +14141,13 @@ const EditDataHelper = {
14106
14141
  skewY: skewY
14107
14142
  };
14108
14143
  },
14144
+ checkOrigin(target, origin, boundsType) {
14145
+ if (boundsType !== "box") {
14146
+ const {boxBounds: boxBounds} = target, innerBounds = target.getBounds(boundsType, "inner");
14147
+ origin.x += innerBounds.x - boxBounds.x;
14148
+ origin.y += innerBounds.y - boxBounds.y;
14149
+ }
14150
+ },
14109
14151
  getAround(around, altKey) {
14110
14152
  return altKey && !around ? "center" : around;
14111
14153
  },
@@ -14376,8 +14418,8 @@ class EditBox extends Group {
14376
14418
  updateMoveCursor(this);
14377
14419
  }
14378
14420
  update() {
14379
- const {editor: editor} = this;
14380
- 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);
14421
+ const {editor: editor, mergeConfig: mergeConfig} = this;
14422
+ 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);
14381
14423
  this.visible = !this.target.locked;
14382
14424
  this.set({
14383
14425
  x: x,
@@ -14400,9 +14442,9 @@ class EditBox extends Group {
14400
14442
  if (this.app) this.rect.syncEventer = this.app.interaction.bottomList = null;
14401
14443
  }
14402
14444
  updateBounds(bounds) {
14403
- const {editor: editor, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
14445
+ const {editor: editor, mergedConfig: mergedConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
14404
14446
  const {editMask: editMask} = editor;
14405
- const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergeConfig;
14447
+ const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergedConfig;
14406
14448
  editMask.visible = mask ? true : 0;
14407
14449
  if (!isUndefined(dimOthers) || !isUndefined(bright)) {
14408
14450
  editor.setDimOthers(dimOthers);
@@ -14440,7 +14482,7 @@ class EditBox extends Group {
14440
14482
  }
14441
14483
  }
14442
14484
  }
14443
- circle.visible = showPoints && rotateable && !!(mergeConfig.circle || mergeConfig.rotatePoint);
14485
+ circle.visible = showPoints && rotateable && !!(mergedConfig.circle || mergedConfig.rotatePoint);
14444
14486
  if (circle.visible) this.layoutCircle();
14445
14487
  if (rect.path) rect.path = null;
14446
14488
  rect.set(Object.assign(Object.assign({}, bounds), {
@@ -14548,7 +14590,8 @@ class EditBox extends Group {
14548
14590
  this.dragPoint = null;
14549
14591
  }
14550
14592
  onTransformStart(e) {
14551
- if (this.moving || this.gesturing) this.editor.opacity = this.mergedConfig.hideOnMove ? 0 : 1;
14593
+ const {hideOnMove: hideOnMove, editBoxType: editBoxType} = this.mergedConfig;
14594
+ if (this.moving || this.gesturing) this.editor.opacity = hideOnMove ? 0 : 1;
14552
14595
  if (this.resizing) ResizeEvent.resizingKeys = this.editor.leafList.keys;
14553
14596
  const {dragStartData: dragStartData, target: target} = this;
14554
14597
  dragStartData.x = e.x;
@@ -14558,7 +14601,7 @@ class EditBox extends Group {
14558
14601
  x: target.x,
14559
14602
  y: target.y
14560
14603
  };
14561
- dragStartData.bounds = Object.assign({}, target.getLayoutBounds("box", "local"));
14604
+ dragStartData.bounds = Object.assign({}, target.getLayoutBounds(editBoxType, "local"));
14562
14605
  dragStartData.rotation = target.rotation;
14563
14606
  }
14564
14607
  onTransformEnd(e) {
@@ -14796,6 +14839,7 @@ const config$1 = {
14796
14839
  },
14797
14840
  selector: true,
14798
14841
  editBox: true,
14842
+ editBoxType: "box",
14799
14843
  hover: true,
14800
14844
  select: "press",
14801
14845
  openInner: "double",
@@ -15120,7 +15164,7 @@ class TransformTool {
15120
15164
  }
15121
15165
  onScale(e) {
15122
15166
  const {target: target, mergeConfig: mergeConfig, single: single, dragStartData: dragStartData} = this.editBox;
15123
- let {around: around, lockRatio: lockRatio, flipable: flipable, editSize: editSize} = mergeConfig, totalMove;
15167
+ let {around: around, lockRatio: lockRatio, flipable: flipable, editSize: editSize, editBoxType: editBoxType} = mergeConfig, totalMove;
15124
15168
  if (e instanceof ZoomEvent) {
15125
15169
  if (!around) around = target.getBoxPoint(e);
15126
15170
  totalMove = e.totalScale;
@@ -15129,7 +15173,7 @@ class TransformTool {
15129
15173
  }
15130
15174
  const {direction: direction} = e.current;
15131
15175
  if (e.shiftKey || target.lockRatio) lockRatio = true;
15132
- const data = EditDataHelper.getScaleData(target, dragStartData.bounds, direction, totalMove, lockRatio, EditDataHelper.getAround(around, e.altKey), flipable, !single || editSize === "scale");
15176
+ const data = EditDataHelper.getScaleData(target, dragStartData.bounds, direction, totalMove, lockRatio, EditDataHelper.getAround(around, e.altKey), flipable, !single || editSize === "scale", editBoxType);
15133
15177
  const targetX = target.x, targetY = target.y;
15134
15178
  if (e instanceof DragEvent && this.editTool && this.editTool.onScaleWithDrag) {
15135
15179
  data.drag = e;
@@ -15141,7 +15185,7 @@ class TransformTool {
15141
15185
  }
15142
15186
  onRotate(e) {
15143
15187
  const {target: target, mergeConfig: mergeConfig, dragStartData: dragStartData} = this.editBox;
15144
- const {around: around, rotateAround: rotateAround, rotateGap: rotateGap, diagonalRotateKey: diagonalRotateKey} = mergeConfig;
15188
+ const {around: around, rotateAround: rotateAround, rotateGap: rotateGap, diagonalRotateKey: diagonalRotateKey, editBoxType: editBoxType} = mergeConfig;
15145
15189
  const {direction: direction} = e.current;
15146
15190
  let origin, rotation;
15147
15191
  if (e instanceof RotateEvent) {
@@ -15149,7 +15193,7 @@ class TransformTool {
15149
15193
  origin = rotateAround ? AroundHelper.getPoint(rotateAround, target.boxBounds) : target.getBoxPoint(e);
15150
15194
  } else {
15151
15195
  const isDiagonalRotate = diagonalRotateKey ? e.isHoldKeys(diagonalRotateKey) : e.shiftKey;
15152
- const data = EditDataHelper.getRotateData(target, direction, e, dragStartData, isDiagonalRotate ? null : rotateAround || target.around || target.origin || around || "center");
15196
+ const data = EditDataHelper.getRotateData(target, direction, e, dragStartData, isDiagonalRotate ? null : rotateAround || target.around || target.origin || around || "center", editBoxType);
15153
15197
  rotation = dragStartData.rotation + data.rotation - target.rotation;
15154
15198
  origin = data.origin;
15155
15199
  }
@@ -15161,8 +15205,8 @@ class TransformTool {
15161
15205
  }
15162
15206
  onSkew(e) {
15163
15207
  const {target: target, mergeConfig: mergeConfig} = this.editBox;
15164
- const {around: around} = mergeConfig;
15165
- const {origin: origin, skewX: skewX, skewY: skewY} = EditDataHelper.getSkewData(target.boxBounds, e.current.direction, e.getInnerMove(target), EditDataHelper.getAround(around, e.altKey));
15208
+ const {around: around, editBoxType: editBoxType} = mergeConfig;
15209
+ const {origin: origin, skewX: skewX, skewY: skewY} = EditDataHelper.getSkewData(target, e.current.direction, e.getInnerMove(target), EditDataHelper.getAround(around, e.altKey), editBoxType);
15166
15210
  if (!skewX && !skewY) return;
15167
15211
  this.skewOf(origin, skewX, skewY);
15168
15212
  }
@@ -15223,7 +15267,7 @@ class TransformTool {
15223
15267
  scaleOf(origin, scaleX, scaleY = scaleX, _resize) {
15224
15268
  if (!this.checkTransform("resizeable")) return;
15225
15269
  const {target: target, mergeConfig: mergeConfig, single: single, editor: editor} = this.editBox;
15226
- const {beforeScale: beforeScale} = mergeConfig;
15270
+ const {beforeScale: beforeScale, editBoxType: editBoxType} = mergeConfig;
15227
15271
  if (beforeScale) {
15228
15272
  const check = beforeScale({
15229
15273
  target: target,
@@ -15241,7 +15285,8 @@ class TransformTool {
15241
15285
  worldOrigin: worldOrigin,
15242
15286
  scaleX: scaleX,
15243
15287
  scaleY: scaleY,
15244
- transform: transform
15288
+ transform: transform,
15289
+ editBoxType: editBoxType
15245
15290
  };
15246
15291
  this.emitEvent(new EditorScaleEvent(EditorScaleEvent.BEFORE_SCALE, data));
15247
15292
  const event = new EditorScaleEvent(EditorScaleEvent.SCALE, data);
@@ -15269,7 +15314,7 @@ class TransformTool {
15269
15314
  rotateOf(origin, rotation) {
15270
15315
  if (!this.checkTransform("rotateable")) return;
15271
15316
  const {target: target, mergeConfig: mergeConfig, single: single, editor: editor} = this.editBox;
15272
- const {beforeRotate: beforeRotate} = mergeConfig;
15317
+ const {beforeRotate: beforeRotate, editBoxType: editBoxType} = mergeConfig;
15273
15318
  if (beforeRotate) {
15274
15319
  const check = beforeRotate({
15275
15320
  target: target,
@@ -15285,7 +15330,8 @@ class TransformTool {
15285
15330
  editor: editor,
15286
15331
  worldOrigin: worldOrigin,
15287
15332
  rotation: rotation,
15288
- transform: transform
15333
+ transform: transform,
15334
+ editBoxType: editBoxType
15289
15335
  };
15290
15336
  this.emitEvent(new EditorRotateEvent(EditorRotateEvent.BEFORE_ROTATE, data));
15291
15337
  const event = new EditorRotateEvent(EditorRotateEvent.ROTATE, data);
@@ -15295,7 +15341,7 @@ class TransformTool {
15295
15341
  skewOf(origin, skewX, skewY = 0, _resize) {
15296
15342
  if (!this.checkTransform("skewable")) return;
15297
15343
  const {target: target, mergeConfig: mergeConfig, single: single, editor: editor} = this.editBox;
15298
- const {beforeSkew: beforeSkew} = mergeConfig;
15344
+ const {beforeSkew: beforeSkew, editBoxType: editBoxType} = mergeConfig;
15299
15345
  if (beforeSkew) {
15300
15346
  const check = beforeSkew({
15301
15347
  target: target,
@@ -15313,7 +15359,8 @@ class TransformTool {
15313
15359
  worldOrigin: worldOrigin,
15314
15360
  skewX: skewX,
15315
15361
  skewY: skewY,
15316
- transform: transform
15362
+ transform: transform,
15363
+ editBoxType: editBoxType
15317
15364
  };
15318
15365
  this.emitEvent(new EditorSkewEvent(EditorSkewEvent.BEFORE_SKEW, data));
15319
15366
  const event = new EditorSkewEvent(EditorSkewEvent.SKEW, data);
@@ -15762,32 +15809,32 @@ let EditTool = class EditTool extends InnerEditor {
15762
15809
  app.unlockLayout();
15763
15810
  }
15764
15811
  onScale(e) {
15765
- const {scaleX: scaleX, scaleY: scaleY, transform: transform, worldOrigin: worldOrigin, editor: editor} = e;
15812
+ const {scaleX: scaleX, scaleY: scaleY, transform: transform, worldOrigin: worldOrigin, editor: editor, editBoxType: editBoxType} = e;
15766
15813
  const {app: app, list: list} = editor;
15767
15814
  app.lockLayout();
15768
15815
  list.forEach(target => {
15769
15816
  const resize = editor.getEditSize(target) !== "scale";
15770
- if (transform) target.transformWorld(transform, resize); else target.scaleOfWorld(worldOrigin, scaleX, scaleY, resize);
15817
+ if (transform) target.transformWorld(transform, resize, false, editBoxType); else target.scaleOfWorld(worldOrigin, scaleX, scaleY, resize, false, editBoxType);
15771
15818
  });
15772
15819
  app.unlockLayout();
15773
15820
  }
15774
15821
  onRotate(e) {
15775
- const {rotation: rotation, transform: transform, worldOrigin: worldOrigin, editor: editor} = e;
15822
+ const {rotation: rotation, transform: transform, worldOrigin: worldOrigin, editor: editor, editBoxType: editBoxType} = e;
15776
15823
  const {app: app, list: list} = editor;
15777
15824
  app.lockLayout();
15778
15825
  list.forEach(target => {
15779
15826
  const resize = editor.getEditSize(target) !== "scale";
15780
- if (transform) target.transformWorld(transform, resize); else target.rotateOfWorld(worldOrigin, rotation);
15827
+ if (transform) target.transformWorld(transform, resize, false, editBoxType); else target.rotateOfWorld(worldOrigin, rotation);
15781
15828
  });
15782
15829
  app.unlockLayout();
15783
15830
  }
15784
15831
  onSkew(e) {
15785
- const {skewX: skewX, skewY: skewY, transform: transform, worldOrigin: worldOrigin, editor: editor} = e;
15832
+ const {skewX: skewX, skewY: skewY, transform: transform, worldOrigin: worldOrigin, editor: editor, editBoxType: editBoxType} = e;
15786
15833
  const {app: app, list: list} = editor;
15787
15834
  app.lockLayout();
15788
15835
  list.forEach(target => {
15789
15836
  const resize = editor.getEditSize(target) !== "scale";
15790
- if (transform) target.transformWorld(transform, resize); else target.skewOfWorld(worldOrigin, skewX, skewY, resize);
15837
+ if (transform) target.transformWorld(transform, resize, false, editBoxType); else target.skewOfWorld(worldOrigin, skewX, skewY, resize);
15791
15838
  });
15792
15839
  app.unlockLayout();
15793
15840
  }
@@ -16084,16 +16131,27 @@ function scaleResizeGroup(group, scaleX, scaleY) {
16084
16131
  }
16085
16132
  }
16086
16133
 
16087
- const leaf = Leaf.prototype;
16134
+ const leaf = Leaf.prototype, tempPoint$1 = {}, {scale: scale$2, toOuterPoint: toOuterPoint} = MatrixHelper;
16088
16135
 
16089
- leaf.scaleResize = function(scaleX, scaleY = scaleX, noResize) {
16136
+ leaf.scaleResize = function(scaleX, scaleY = scaleX, noResize, boundsType) {
16090
16137
  const data = this;
16091
16138
  if (noResize || data.editConfig && data.editConfig.editSize === "scale") {
16092
16139
  data.scaleX *= scaleX;
16093
16140
  data.scaleY *= scaleY;
16094
16141
  } else {
16095
- if (scaleX < 0) data.scaleX *= -1, scaleX = -scaleX;
16096
- if (scaleY < 0) data.scaleY *= -1, scaleY = -scaleY;
16142
+ const local = this.__localMatrix;
16143
+ if (scaleX < 0) data.scaleX *= -1, scaleX = -scaleX, scale$2(local, -1, 1);
16144
+ if (scaleY < 0) data.scaleY *= -1, scaleY = -scaleY, scale$2(local, 1, -1);
16145
+ if (boundsType === "stroke") {
16146
+ const {boxBounds: boxBounds, strokeBounds: strokeBounds} = this.__layout, {x: x, y: y, width: width, height: height} = strokeBounds;
16147
+ tempPoint$1.x = (x - boxBounds.x) * (scaleX - 1);
16148
+ tempPoint$1.y = (y - boxBounds.y) * (scaleY - 1);
16149
+ toOuterPoint(local, tempPoint$1, tempPoint$1, true);
16150
+ this.x += tempPoint$1.x;
16151
+ this.y += tempPoint$1.y;
16152
+ scaleX = (width * scaleX - (width - boxBounds.width)) / boxBounds.width;
16153
+ scaleY = (height * scaleY - (height - boxBounds.height)) / boxBounds.height;
16154
+ }
16097
16155
  this.__scaleResize(scaleX, scaleY);
16098
16156
  }
16099
16157
  };
@@ -21128,4 +21186,4 @@ function isSame(a, b) {
21128
21186
 
21129
21187
  Plugin.add("corner");
21130
21188
 
21131
- 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$4 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
21189
+ 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$5 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };