@leafer/worker 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.
@@ -472,7 +472,7 @@ const {sin: sin$6, cos: cos$6, acos: acos, sqrt: sqrt$5} = Math;
472
472
 
473
473
  const {float: float$6} = MathHelper;
474
474
 
475
- const tempPoint$5 = {};
475
+ const tempPoint$6 = {};
476
476
 
477
477
  function getWorld() {
478
478
  return Object.assign(Object.assign(Object.assign({}, getMatrixData()), getBoundsData()), {
@@ -531,8 +531,8 @@ const MatrixHelper = {
531
531
  to.f = t.f * pixelRatio;
532
532
  },
533
533
  scaleOfOuter(t, origin, scaleX, scaleY) {
534
- M$c.toInnerPoint(t, origin, tempPoint$5);
535
- M$c.scaleOfInner(t, tempPoint$5, scaleX, scaleY);
534
+ M$c.toInnerPoint(t, origin, tempPoint$6);
535
+ M$c.scaleOfInner(t, tempPoint$6, scaleX, scaleY);
536
536
  },
537
537
  scaleOfInner(t, origin, scaleX, scaleY = scaleX) {
538
538
  M$c.translateInner(t, origin.x, origin.y);
@@ -550,8 +550,8 @@ const MatrixHelper = {
550
550
  t.d = c * sinR + d * cosR;
551
551
  },
552
552
  rotateOfOuter(t, origin, rotation) {
553
- M$c.toInnerPoint(t, origin, tempPoint$5);
554
- M$c.rotateOfInner(t, tempPoint$5, rotation);
553
+ M$c.toInnerPoint(t, origin, tempPoint$6);
554
+ M$c.rotateOfInner(t, tempPoint$6, rotation);
555
555
  },
556
556
  rotateOfInner(t, origin, rotation) {
557
557
  M$c.translateInner(t, origin.x, origin.y);
@@ -572,8 +572,8 @@ const MatrixHelper = {
572
572
  }
573
573
  },
574
574
  skewOfOuter(t, origin, skewX, skewY) {
575
- M$c.toInnerPoint(t, origin, tempPoint$5);
576
- M$c.skewOfInner(t, tempPoint$5, skewX, skewY);
575
+ M$c.toInnerPoint(t, origin, tempPoint$6);
576
+ M$c.skewOfInner(t, tempPoint$6, skewX, skewY);
577
577
  },
578
578
  skewOfInner(t, origin, skewX, skewY = 0) {
579
579
  M$c.translateInner(t, origin.x, origin.y);
@@ -772,7 +772,7 @@ const M$c = MatrixHelper;
772
772
 
773
773
  const {float: float$5} = MathHelper;
774
774
 
775
- const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
775
+ const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$4} = MatrixHelper;
776
776
 
777
777
  const {sin: sin$5, cos: cos$5, abs: abs$b, sqrt: sqrt$4, atan2: atan2$2, min: min$3, round: round$5} = Math;
778
778
 
@@ -830,7 +830,7 @@ const PointHelper = {
830
830
  tempToOuterOf(t, matrix) {
831
831
  const {tempPoint: temp} = P$7;
832
832
  copy$c(temp, t);
833
- toOuterPoint$3(matrix, temp, temp);
833
+ toOuterPoint$4(matrix, temp, temp);
834
834
  return temp;
835
835
  },
836
836
  tempToInnerRadiusPointOf(t, matrix) {
@@ -854,7 +854,7 @@ const PointHelper = {
854
854
  toInnerPoint$2(matrix, t, to);
855
855
  },
856
856
  toOuterOf(t, matrix, to) {
857
- toOuterPoint$3(matrix, t, to);
857
+ toOuterPoint$4(matrix, t, to);
858
858
  },
859
859
  getCenter(t, to) {
860
860
  return {
@@ -995,7 +995,7 @@ class Point {
995
995
  }
996
996
  }
997
997
 
998
- const tempPoint$4 = new Point;
998
+ const tempPoint$5 = new Point;
999
999
 
1000
1000
  class Matrix {
1001
1001
  constructor(a, b, c, d, e, f) {
@@ -1264,7 +1264,7 @@ const AlignHelper = {
1264
1264
 
1265
1265
  const {tempPointBounds: tempPointBounds$1, setPoint: setPoint$5, addPoint: addPoint$3, toBounds: toBounds$3} = TwoPointBoundsHelper;
1266
1266
 
1267
- const {toOuterPoint: toOuterPoint$2} = MatrixHelper;
1267
+ const {toOuterPoint: toOuterPoint$3} = MatrixHelper;
1268
1268
 
1269
1269
  const {float: float$4, fourNumber: fourNumber$1} = MathHelper;
1270
1270
 
@@ -1378,16 +1378,16 @@ const BoundsHelper = {
1378
1378
  } else {
1379
1379
  point$2.x = t.x;
1380
1380
  point$2.y = t.y;
1381
- toOuterPoint$2(matrix, point$2, toPoint$5);
1381
+ toOuterPoint$3(matrix, point$2, toPoint$5);
1382
1382
  setPoint$5(tempPointBounds$1, toPoint$5.x, toPoint$5.y);
1383
1383
  point$2.x = t.x + t.width;
1384
- toOuterPoint$2(matrix, point$2, toPoint$5);
1384
+ toOuterPoint$3(matrix, point$2, toPoint$5);
1385
1385
  addPoint$3(tempPointBounds$1, toPoint$5.x, toPoint$5.y);
1386
1386
  point$2.y = t.y + t.height;
1387
- toOuterPoint$2(matrix, point$2, toPoint$5);
1387
+ toOuterPoint$3(matrix, point$2, toPoint$5);
1388
1388
  addPoint$3(tempPointBounds$1, toPoint$5.x, toPoint$5.y);
1389
1389
  point$2.x = t.x;
1390
- toOuterPoint$2(matrix, point$2, toPoint$5);
1390
+ toOuterPoint$3(matrix, point$2, toPoint$5);
1391
1391
  addPoint$3(tempPointBounds$1, toPoint$5.x, toPoint$5.y);
1392
1392
  toBounds$3(tempPointBounds$1, to);
1393
1393
  }
@@ -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() {
@@ -7741,7 +7747,7 @@ class Renderer {
7741
7747
 
7742
7748
  Renderer.clipSpread = 10;
7743
7749
 
7744
- const tempPoint$1 = {};
7750
+ const tempPoint$2 = {};
7745
7751
 
7746
7752
  const {copyRadiusPoint: copyRadiusPoint$1} = PointHelper;
7747
7753
 
@@ -7876,7 +7882,7 @@ class Picker {
7876
7882
  for (let i = len - 1; i > -1; i--) {
7877
7883
  child = children[i], data = child.__;
7878
7884
  if (!data.visible || hitMask && !data.mask) continue;
7879
- hit = hitRadiusPoint$1(child.__world, data.hitRadius ? copyRadiusPoint$1(tempPoint$1, point, data.hitRadius) : point);
7885
+ hit = hitRadiusPoint$1(child.__world, data.hitRadius ? copyRadiusPoint$1(tempPoint$2, point, data.hitRadius) : point);
7880
7886
  if (child.isBranch) {
7881
7887
  if (hit || child.__ignoreHitWorld) {
7882
7888
  if (child.isBranchLeaf && data.__clipAfterFill && !child.__hitWorld(point, true)) continue;
@@ -11884,7 +11890,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
11884
11890
  needUpdate = false;
11885
11891
  }
11886
11892
  }
11887
- if (paint.mode === "brush") PaintImage.brush(leafPaint);
11893
+ if (paint.mode === "brush") PaintImage.brush(leafPaint, ui);
11888
11894
  if (!leafPaint.data) {
11889
11895
  PaintImage.createData(leafPaint, image, paint, boxBounds);
11890
11896
  const {transform: transform} = leafPaint.data, {opacity: opacity} = paint;
@@ -12100,7 +12106,7 @@ function layout$3(transform, box, x, y, scaleX, scaleY, rotation, skew) {
12100
12106
  translate(transform, box.x + x, box.y + y);
12101
12107
  }
12102
12108
 
12103
- const {get: get$1, scale: scale$2, copy: copy$4} = MatrixHelper;
12109
+ const {get: get$1, scale: scale$3, copy: copy$4} = MatrixHelper;
12104
12110
 
12105
12111
  const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$7} = Math;
12106
12112
 
@@ -12138,11 +12144,15 @@ function createPattern(paint, ui, canvas, renderOptions) {
12138
12144
  scaleY *= getFloorScale(height + (yGap || 0));
12139
12145
  imageMatrix = get$1();
12140
12146
  if (transform) copy$4(imageMatrix, transform);
12141
- scale$2(imageMatrix, 1 / scaleX, 1 / scaleY);
12147
+ scale$3(imageMatrix, 1 / scaleX, 1 / scaleY);
12142
12148
  }
12143
12149
  const imageCanvas = image.getCanvas(width, height, opacity, undefined, xGap, yGap, ui.leafer && ui.leafer.config.smooth, data.interlace);
12144
- const pattern = brush ? imageCanvas : image.getPattern(imageCanvas, data.repeat || (Platform.origin.noRepeat || "no-repeat"), imageMatrix, paint);
12145
- paint.style = pattern;
12150
+ if (brush) {
12151
+ paint.style = imageCanvas;
12152
+ PaintImage.cacheBrush(paint, ui, canvas, renderOptions);
12153
+ } else {
12154
+ paint.style = image.getPattern(imageCanvas, data.repeat || (Platform.origin.noRepeat || "no-repeat"), imageMatrix, paint);
12155
+ }
12146
12156
  paint.patternId = id;
12147
12157
  }
12148
12158
  }
@@ -13227,10 +13237,11 @@ function mergeConfigAttr() {
13227
13237
  if (innerEditor) innerEditor.editConfig && Object.assign(mergeConfig, innerEditor.editConfig); else if (editTool) editTool.editConfig && Object.assign(mergeConfig, editTool.editConfig);
13228
13238
  if (element && element.editConfig) {
13229
13239
  let {editConfig: editConfig} = element;
13230
- if (editConfig.hover || editConfig.hoverStyle) {
13240
+ if (editConfig.hover || editConfig.hoverStyle || editConfig.hoverPathType) {
13231
13241
  editConfig = Object.assign({}, editConfig);
13232
13242
  delete editConfig.hover;
13233
13243
  delete editConfig.hoverStyle;
13244
+ delete editConfig.hoverPathType;
13234
13245
  }
13235
13246
  Object.assign(mergeConfig, editConfig);
13236
13247
  }
@@ -13298,9 +13309,22 @@ class Stroker extends UI {
13298
13309
  matrix$1.half = strokeWidth % 2;
13299
13310
  canvas.setWorld(matrix$1, options.matrix);
13300
13311
  canvas.beginPath();
13301
- if (this.strokePathType === "path") {
13312
+ switch (this.strokePathType) {
13313
+ case "box":
13314
+ const {boxBounds: boxBounds} = leaf.__layout;
13315
+ canvas.rect(boxBounds.x, boxBounds.y, boxBounds.width, boxBounds.height);
13316
+ break;
13317
+
13318
+ case "stroke":
13319
+ const {strokeBounds: strokeBounds} = leaf.__layout;
13320
+ canvas.rect(strokeBounds.x, strokeBounds.y, strokeBounds.width, strokeBounds.height);
13321
+ break;
13322
+
13323
+ case "path":
13302
13324
  leaf.__drawPath(canvas);
13303
- } else {
13325
+ break;
13326
+
13327
+ default:
13304
13328
  if (leaf.__.__useArrow) leaf.__drawPath(canvas); else leaf.__.__pathForRender ? leaf.__drawRenderPath(canvas) : leaf.__drawPathByBox(canvas);
13305
13329
  }
13306
13330
  data.strokeWidth = strokeWidth / Math.max(aScaleX, aScaleY);
@@ -13423,10 +13447,11 @@ class EditSelect extends Group {
13423
13447
  if (this.running && !this.dragging && !editor.dragging) {
13424
13448
  const {hoverTarget: hoverTarget, mergeConfig: mergeConfig} = editor, config = Object.assign({}, mergeConfig);
13425
13449
  if (hoverTarget && hoverTarget.editConfig) Object.assign(config, hoverTarget.editConfig);
13426
- const {stroke: stroke, strokeWidth: strokeWidth, hover: hover, hoverStyle: hoverStyle} = config;
13450
+ const {stroke: stroke, strokeWidth: strokeWidth, hover: hover, hoverStyle: hoverStyle, hoverPathType: hoverPathType} = config;
13427
13451
  this.hoverStroker.setTarget(hover ? hoverTarget : null, Object.assign({
13428
13452
  stroke: stroke,
13429
- strokeWidth: strokeWidth
13453
+ strokeWidth: strokeWidth,
13454
+ strokePathType: hoverPathType
13430
13455
  }, hoverStyle || {}));
13431
13456
  } else {
13432
13457
  this.hoverStroker.target = null;
@@ -13609,16 +13634,17 @@ const {topLeft: topLeft$1, top: top$1, topRight: topRight$1, right: right$2, bot
13609
13634
  const {toPoint: toPoint} = AroundHelper, {within: within$3, sign: sign$1} = MathHelper, {abs: abs$4} = Math;
13610
13635
 
13611
13636
  const EditDataHelper = {
13612
- getScaleData(target, startBounds, direction, totalMoveOrScale, lockRatio, around, flipable, scaleMode) {
13637
+ getScaleData(target, startBounds, direction, totalMoveOrScale, lockRatio, around, flipable, scaleMode, boundsType) {
13613
13638
  let align, origin = {}, scaleX = 1, scaleY = 1, lockScale;
13614
- const {boxBounds: boxBounds, widthRange: widthRange, heightRange: heightRange, dragBounds: dragBounds, worldBoxBounds: worldBoxBounds} = target;
13639
+ const {widthRange: widthRange, heightRange: heightRange, dragBounds: dragBounds, worldTransform: worldTransform, boxBounds: boxBounds} = target;
13615
13640
  const {width: width, height: height} = startBounds;
13641
+ const innerBounds = target.getBounds(boundsType, "inner");
13616
13642
  const originChangedScaleX = target.scaleX / startBounds.scaleX;
13617
13643
  const originChangedScaleY = target.scaleY / startBounds.scaleY;
13618
13644
  const signX = sign$1(originChangedScaleX);
13619
13645
  const signY = sign$1(originChangedScaleY);
13620
- const changedScaleX = scaleMode ? originChangedScaleX : signX * boxBounds.width / width;
13621
- const changedScaleY = scaleMode ? originChangedScaleY : signY * boxBounds.height / height;
13646
+ const changedScaleX = scaleMode ? originChangedScaleX : signX * innerBounds.width / width;
13647
+ const changedScaleY = scaleMode ? originChangedScaleY : signY * innerBounds.height / height;
13622
13648
  if (isNumber(totalMoveOrScale)) {
13623
13649
  scaleX = scaleY = Math.sqrt(totalMoveOrScale);
13624
13650
  } else {
@@ -13704,10 +13730,11 @@ const EditDataHelper = {
13704
13730
  if (useScaleY) scaleY /= changedScaleY;
13705
13731
  if (!flipable) {
13706
13732
  const {worldTransform: worldTransform} = target;
13707
- if (scaleX < 0) scaleX = 1 / boxBounds.width / worldTransform.scaleX;
13708
- if (scaleY < 0) scaleY = 1 / boxBounds.height / worldTransform.scaleY;
13733
+ if (scaleX < 0) scaleX = 1 / innerBounds.width / worldTransform.scaleX;
13734
+ if (scaleY < 0) scaleY = 1 / innerBounds.height / worldTransform.scaleY;
13709
13735
  }
13710
- toPoint(around || align, boxBounds, origin, true);
13736
+ toPoint(around || align, innerBounds, origin, true);
13737
+ this.checkOrigin(target, origin, boundsType);
13711
13738
  if (dragBounds) {
13712
13739
  const scaleData = {
13713
13740
  x: scaleX,
@@ -13718,15 +13745,20 @@ const EditDataHelper = {
13718
13745
  scaleY = scaleData.y;
13719
13746
  }
13720
13747
  if (useScaleX && widthRange) {
13721
- const nowWidth = boxBounds.width * target.scaleX;
13748
+ const nowWidth = innerBounds.width * target.scaleX;
13722
13749
  scaleX = within$3(nowWidth * scaleX, widthRange) / nowWidth;
13723
13750
  }
13724
13751
  if (useScaleY && heightRange) {
13725
- const nowHeight = boxBounds.height * target.scaleY;
13752
+ const nowHeight = innerBounds.height * target.scaleY;
13726
13753
  scaleY = within$3(nowHeight * scaleY, heightRange) / nowHeight;
13727
13754
  }
13728
- if (useScaleX && abs$4(scaleX * worldBoxBounds.width) < 1) scaleX = sign$1(scaleX) / worldBoxBounds.width;
13729
- if (useScaleY && abs$4(scaleY * worldBoxBounds.height) < 1) scaleY = sign$1(scaleY) / worldBoxBounds.height;
13755
+ let minWidth = 1 * abs$4(worldTransform.scaleX), minHeight = 1 * abs$4(worldTransform.scaleY);
13756
+ if (boundsType !== "box") {
13757
+ minWidth += innerBounds.width - boxBounds.width;
13758
+ minHeight += innerBounds.height - boxBounds.height;
13759
+ }
13760
+ if (useScaleX && abs$4(scaleX * innerBounds.width) < minWidth) scaleX = sign$1(scaleX) * minWidth / innerBounds.width;
13761
+ if (useScaleY && abs$4(scaleY * innerBounds.height) < minHeight) scaleY = sign$1(scaleY) * minHeight / innerBounds.height;
13730
13762
  if (lockRatio && scaleX !== scaleY) {
13731
13763
  lockScale = Math.min(abs$4(scaleX), abs$4(scaleY));
13732
13764
  scaleX = sign$1(scaleX) * lockScale;
@@ -13743,7 +13775,7 @@ const EditDataHelper = {
13743
13775
  around: around
13744
13776
  };
13745
13777
  },
13746
- getRotateData(target, direction, current, last, around) {
13778
+ getRotateData(target, direction, current, last, around, boundsType) {
13747
13779
  let align, origin = {};
13748
13780
  switch (direction) {
13749
13781
  case topLeft$1:
@@ -13765,13 +13797,14 @@ const EditDataHelper = {
13765
13797
  default:
13766
13798
  align = "center";
13767
13799
  }
13768
- toPoint(around || align, target.boxBounds, origin, true);
13800
+ toPoint(around || align, target.getBounds(boundsType, "inner"), origin, true);
13801
+ this.checkOrigin(target, origin, boundsType);
13769
13802
  return {
13770
13803
  origin: origin,
13771
13804
  rotation: PointHelper.getRotation(last, target.getWorldPointByBox(origin), current)
13772
13805
  };
13773
13806
  },
13774
- getSkewData(bounds, direction, move, around) {
13807
+ getSkewData(target, direction, move, around, boundsType) {
13775
13808
  let align, origin = {}, skewX = 0, skewY = 0;
13776
13809
  let last;
13777
13810
  switch (direction) {
@@ -13814,10 +13847,12 @@ const EditDataHelper = {
13814
13847
  align = "left";
13815
13848
  skewY = 1;
13816
13849
  }
13817
- const {width: width, height: height} = bounds;
13850
+ const innerBounds = target.getBounds(boundsType, "inner");
13851
+ const {width: width, height: height} = innerBounds;
13818
13852
  last.x = last.x * width;
13819
13853
  last.y = last.y * height;
13820
- toPoint(around || align, bounds, origin, true);
13854
+ toPoint(around || align, innerBounds, origin, true);
13855
+ this.checkOrigin(target, origin, boundsType);
13821
13856
  const rotation = PointHelper.getRotation(last, origin, {
13822
13857
  x: last.x + (skewX ? move.x : 0),
13823
13858
  y: last.y + (skewY ? move.y : 0)
@@ -13829,6 +13864,13 @@ const EditDataHelper = {
13829
13864
  skewY: skewY
13830
13865
  };
13831
13866
  },
13867
+ checkOrigin(target, origin, boundsType) {
13868
+ if (boundsType !== "box") {
13869
+ const {boxBounds: boxBounds} = target, innerBounds = target.getBounds(boundsType, "inner");
13870
+ origin.x += innerBounds.x - boxBounds.x;
13871
+ origin.y += innerBounds.y - boxBounds.y;
13872
+ }
13873
+ },
13832
13874
  getAround(around, altKey) {
13833
13875
  return altKey && !around ? "center" : around;
13834
13876
  },
@@ -14099,8 +14141,8 @@ class EditBox extends Group {
14099
14141
  updateMoveCursor(this);
14100
14142
  }
14101
14143
  update() {
14102
- const {editor: editor} = this;
14103
- 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);
14144
+ const {editor: editor, mergeConfig: mergeConfig} = this;
14145
+ 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);
14104
14146
  this.visible = !this.target.locked;
14105
14147
  this.set({
14106
14148
  x: x,
@@ -14123,9 +14165,9 @@ class EditBox extends Group {
14123
14165
  if (this.app) this.rect.syncEventer = this.app.interaction.bottomList = null;
14124
14166
  }
14125
14167
  updateBounds(bounds) {
14126
- const {editor: editor, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
14168
+ const {editor: editor, mergedConfig: mergedConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
14127
14169
  const {editMask: editMask} = editor;
14128
- const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergeConfig;
14170
+ const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergedConfig;
14129
14171
  editMask.visible = mask ? true : 0;
14130
14172
  if (!isUndefined(dimOthers) || !isUndefined(bright)) {
14131
14173
  editor.setDimOthers(dimOthers);
@@ -14163,7 +14205,7 @@ class EditBox extends Group {
14163
14205
  }
14164
14206
  }
14165
14207
  }
14166
- circle.visible = showPoints && rotateable && !!(mergeConfig.circle || mergeConfig.rotatePoint);
14208
+ circle.visible = showPoints && rotateable && !!(mergedConfig.circle || mergedConfig.rotatePoint);
14167
14209
  if (circle.visible) this.layoutCircle();
14168
14210
  if (rect.path) rect.path = null;
14169
14211
  rect.set(Object.assign(Object.assign({}, bounds), {
@@ -14271,7 +14313,8 @@ class EditBox extends Group {
14271
14313
  this.dragPoint = null;
14272
14314
  }
14273
14315
  onTransformStart(e) {
14274
- if (this.moving || this.gesturing) this.editor.opacity = this.mergedConfig.hideOnMove ? 0 : 1;
14316
+ const {hideOnMove: hideOnMove, editBoxType: editBoxType} = this.mergedConfig;
14317
+ if (this.moving || this.gesturing) this.editor.opacity = hideOnMove ? 0 : 1;
14275
14318
  if (this.resizing) ResizeEvent.resizingKeys = this.editor.leafList.keys;
14276
14319
  const {dragStartData: dragStartData, target: target} = this;
14277
14320
  dragStartData.x = e.x;
@@ -14281,7 +14324,7 @@ class EditBox extends Group {
14281
14324
  x: target.x,
14282
14325
  y: target.y
14283
14326
  };
14284
- dragStartData.bounds = Object.assign({}, target.getLayoutBounds("box", "local"));
14327
+ dragStartData.bounds = Object.assign({}, target.getLayoutBounds(editBoxType, "local"));
14285
14328
  dragStartData.rotation = target.rotation;
14286
14329
  }
14287
14330
  onTransformEnd(e) {
@@ -14519,6 +14562,7 @@ const config$1 = {
14519
14562
  },
14520
14563
  selector: true,
14521
14564
  editBox: true,
14565
+ editBoxType: "box",
14522
14566
  hover: true,
14523
14567
  select: "press",
14524
14568
  openInner: "double",
@@ -14843,7 +14887,7 @@ class TransformTool {
14843
14887
  }
14844
14888
  onScale(e) {
14845
14889
  const {target: target, mergeConfig: mergeConfig, single: single, dragStartData: dragStartData} = this.editBox;
14846
- let {around: around, lockRatio: lockRatio, flipable: flipable, editSize: editSize} = mergeConfig, totalMove;
14890
+ let {around: around, lockRatio: lockRatio, flipable: flipable, editSize: editSize, editBoxType: editBoxType} = mergeConfig, totalMove;
14847
14891
  if (e instanceof ZoomEvent) {
14848
14892
  if (!around) around = target.getBoxPoint(e);
14849
14893
  totalMove = e.totalScale;
@@ -14852,7 +14896,7 @@ class TransformTool {
14852
14896
  }
14853
14897
  const {direction: direction} = e.current;
14854
14898
  if (e.shiftKey || target.lockRatio) lockRatio = true;
14855
- const data = EditDataHelper.getScaleData(target, dragStartData.bounds, direction, totalMove, lockRatio, EditDataHelper.getAround(around, e.altKey), flipable, !single || editSize === "scale");
14899
+ const data = EditDataHelper.getScaleData(target, dragStartData.bounds, direction, totalMove, lockRatio, EditDataHelper.getAround(around, e.altKey), flipable, !single || editSize === "scale", editBoxType);
14856
14900
  const targetX = target.x, targetY = target.y;
14857
14901
  if (e instanceof DragEvent && this.editTool && this.editTool.onScaleWithDrag) {
14858
14902
  data.drag = e;
@@ -14864,7 +14908,7 @@ class TransformTool {
14864
14908
  }
14865
14909
  onRotate(e) {
14866
14910
  const {target: target, mergeConfig: mergeConfig, dragStartData: dragStartData} = this.editBox;
14867
- const {around: around, rotateAround: rotateAround, rotateGap: rotateGap, diagonalRotateKey: diagonalRotateKey} = mergeConfig;
14911
+ const {around: around, rotateAround: rotateAround, rotateGap: rotateGap, diagonalRotateKey: diagonalRotateKey, editBoxType: editBoxType} = mergeConfig;
14868
14912
  const {direction: direction} = e.current;
14869
14913
  let origin, rotation;
14870
14914
  if (e instanceof RotateEvent) {
@@ -14872,7 +14916,7 @@ class TransformTool {
14872
14916
  origin = rotateAround ? AroundHelper.getPoint(rotateAround, target.boxBounds) : target.getBoxPoint(e);
14873
14917
  } else {
14874
14918
  const isDiagonalRotate = diagonalRotateKey ? e.isHoldKeys(diagonalRotateKey) : e.shiftKey;
14875
- const data = EditDataHelper.getRotateData(target, direction, e, dragStartData, isDiagonalRotate ? null : rotateAround || target.around || target.origin || around || "center");
14919
+ const data = EditDataHelper.getRotateData(target, direction, e, dragStartData, isDiagonalRotate ? null : rotateAround || target.around || target.origin || around || "center", editBoxType);
14876
14920
  rotation = dragStartData.rotation + data.rotation - target.rotation;
14877
14921
  origin = data.origin;
14878
14922
  }
@@ -14884,8 +14928,8 @@ class TransformTool {
14884
14928
  }
14885
14929
  onSkew(e) {
14886
14930
  const {target: target, mergeConfig: mergeConfig} = this.editBox;
14887
- const {around: around} = mergeConfig;
14888
- const {origin: origin, skewX: skewX, skewY: skewY} = EditDataHelper.getSkewData(target.boxBounds, e.current.direction, e.getInnerMove(target), EditDataHelper.getAround(around, e.altKey));
14931
+ const {around: around, editBoxType: editBoxType} = mergeConfig;
14932
+ const {origin: origin, skewX: skewX, skewY: skewY} = EditDataHelper.getSkewData(target, e.current.direction, e.getInnerMove(target), EditDataHelper.getAround(around, e.altKey), editBoxType);
14889
14933
  if (!skewX && !skewY) return;
14890
14934
  this.skewOf(origin, skewX, skewY);
14891
14935
  }
@@ -14946,7 +14990,7 @@ class TransformTool {
14946
14990
  scaleOf(origin, scaleX, scaleY = scaleX, _resize) {
14947
14991
  if (!this.checkTransform("resizeable")) return;
14948
14992
  const {target: target, mergeConfig: mergeConfig, single: single, editor: editor} = this.editBox;
14949
- const {beforeScale: beforeScale} = mergeConfig;
14993
+ const {beforeScale: beforeScale, editBoxType: editBoxType} = mergeConfig;
14950
14994
  if (beforeScale) {
14951
14995
  const check = beforeScale({
14952
14996
  target: target,
@@ -14964,7 +15008,8 @@ class TransformTool {
14964
15008
  worldOrigin: worldOrigin,
14965
15009
  scaleX: scaleX,
14966
15010
  scaleY: scaleY,
14967
- transform: transform
15011
+ transform: transform,
15012
+ editBoxType: editBoxType
14968
15013
  };
14969
15014
  this.emitEvent(new EditorScaleEvent(EditorScaleEvent.BEFORE_SCALE, data));
14970
15015
  const event = new EditorScaleEvent(EditorScaleEvent.SCALE, data);
@@ -14992,7 +15037,7 @@ class TransformTool {
14992
15037
  rotateOf(origin, rotation) {
14993
15038
  if (!this.checkTransform("rotateable")) return;
14994
15039
  const {target: target, mergeConfig: mergeConfig, single: single, editor: editor} = this.editBox;
14995
- const {beforeRotate: beforeRotate} = mergeConfig;
15040
+ const {beforeRotate: beforeRotate, editBoxType: editBoxType} = mergeConfig;
14996
15041
  if (beforeRotate) {
14997
15042
  const check = beforeRotate({
14998
15043
  target: target,
@@ -15008,7 +15053,8 @@ class TransformTool {
15008
15053
  editor: editor,
15009
15054
  worldOrigin: worldOrigin,
15010
15055
  rotation: rotation,
15011
- transform: transform
15056
+ transform: transform,
15057
+ editBoxType: editBoxType
15012
15058
  };
15013
15059
  this.emitEvent(new EditorRotateEvent(EditorRotateEvent.BEFORE_ROTATE, data));
15014
15060
  const event = new EditorRotateEvent(EditorRotateEvent.ROTATE, data);
@@ -15018,7 +15064,7 @@ class TransformTool {
15018
15064
  skewOf(origin, skewX, skewY = 0, _resize) {
15019
15065
  if (!this.checkTransform("skewable")) return;
15020
15066
  const {target: target, mergeConfig: mergeConfig, single: single, editor: editor} = this.editBox;
15021
- const {beforeSkew: beforeSkew} = mergeConfig;
15067
+ const {beforeSkew: beforeSkew, editBoxType: editBoxType} = mergeConfig;
15022
15068
  if (beforeSkew) {
15023
15069
  const check = beforeSkew({
15024
15070
  target: target,
@@ -15036,7 +15082,8 @@ class TransformTool {
15036
15082
  worldOrigin: worldOrigin,
15037
15083
  skewX: skewX,
15038
15084
  skewY: skewY,
15039
- transform: transform
15085
+ transform: transform,
15086
+ editBoxType: editBoxType
15040
15087
  };
15041
15088
  this.emitEvent(new EditorSkewEvent(EditorSkewEvent.BEFORE_SKEW, data));
15042
15089
  const event = new EditorSkewEvent(EditorSkewEvent.SKEW, data);
@@ -15485,32 +15532,32 @@ let EditTool = class EditTool extends InnerEditor {
15485
15532
  app.unlockLayout();
15486
15533
  }
15487
15534
  onScale(e) {
15488
- const {scaleX: scaleX, scaleY: scaleY, transform: transform, worldOrigin: worldOrigin, editor: editor} = e;
15535
+ const {scaleX: scaleX, scaleY: scaleY, transform: transform, worldOrigin: worldOrigin, editor: editor, editBoxType: editBoxType} = e;
15489
15536
  const {app: app, list: list} = editor;
15490
15537
  app.lockLayout();
15491
15538
  list.forEach(target => {
15492
15539
  const resize = editor.getEditSize(target) !== "scale";
15493
- if (transform) target.transformWorld(transform, resize); else target.scaleOfWorld(worldOrigin, scaleX, scaleY, resize);
15540
+ if (transform) target.transformWorld(transform, resize, false, editBoxType); else target.scaleOfWorld(worldOrigin, scaleX, scaleY, resize, false, editBoxType);
15494
15541
  });
15495
15542
  app.unlockLayout();
15496
15543
  }
15497
15544
  onRotate(e) {
15498
- const {rotation: rotation, transform: transform, worldOrigin: worldOrigin, editor: editor} = e;
15545
+ const {rotation: rotation, transform: transform, worldOrigin: worldOrigin, editor: editor, editBoxType: editBoxType} = e;
15499
15546
  const {app: app, list: list} = editor;
15500
15547
  app.lockLayout();
15501
15548
  list.forEach(target => {
15502
15549
  const resize = editor.getEditSize(target) !== "scale";
15503
- if (transform) target.transformWorld(transform, resize); else target.rotateOfWorld(worldOrigin, rotation);
15550
+ if (transform) target.transformWorld(transform, resize, false, editBoxType); else target.rotateOfWorld(worldOrigin, rotation);
15504
15551
  });
15505
15552
  app.unlockLayout();
15506
15553
  }
15507
15554
  onSkew(e) {
15508
- const {skewX: skewX, skewY: skewY, transform: transform, worldOrigin: worldOrigin, editor: editor} = e;
15555
+ const {skewX: skewX, skewY: skewY, transform: transform, worldOrigin: worldOrigin, editor: editor, editBoxType: editBoxType} = e;
15509
15556
  const {app: app, list: list} = editor;
15510
15557
  app.lockLayout();
15511
15558
  list.forEach(target => {
15512
15559
  const resize = editor.getEditSize(target) !== "scale";
15513
- if (transform) target.transformWorld(transform, resize); else target.skewOfWorld(worldOrigin, skewX, skewY, resize);
15560
+ if (transform) target.transformWorld(transform, resize, false, editBoxType); else target.skewOfWorld(worldOrigin, skewX, skewY, resize);
15514
15561
  });
15515
15562
  app.unlockLayout();
15516
15563
  }
@@ -15807,16 +15854,27 @@ function scaleResizeGroup(group, scaleX, scaleY) {
15807
15854
  }
15808
15855
  }
15809
15856
 
15810
- const leaf = Leaf.prototype;
15857
+ const leaf = Leaf.prototype, tempPoint$1 = {}, {scale: scale$2, toOuterPoint: toOuterPoint} = MatrixHelper;
15811
15858
 
15812
- leaf.scaleResize = function(scaleX, scaleY = scaleX, noResize) {
15859
+ leaf.scaleResize = function(scaleX, scaleY = scaleX, noResize, boundsType) {
15813
15860
  const data = this;
15814
15861
  if (noResize || data.editConfig && data.editConfig.editSize === "scale") {
15815
15862
  data.scaleX *= scaleX;
15816
15863
  data.scaleY *= scaleY;
15817
15864
  } else {
15818
- if (scaleX < 0) data.scaleX *= -1, scaleX = -scaleX;
15819
- if (scaleY < 0) data.scaleY *= -1, scaleY = -scaleY;
15865
+ const local = this.__localMatrix;
15866
+ if (scaleX < 0) data.scaleX *= -1, scaleX = -scaleX, scale$2(local, -1, 1);
15867
+ if (scaleY < 0) data.scaleY *= -1, scaleY = -scaleY, scale$2(local, 1, -1);
15868
+ if (boundsType === "stroke") {
15869
+ const {boxBounds: boxBounds, strokeBounds: strokeBounds} = this.__layout, {x: x, y: y, width: width, height: height} = strokeBounds;
15870
+ tempPoint$1.x = (x - boxBounds.x) * (scaleX - 1);
15871
+ tempPoint$1.y = (y - boxBounds.y) * (scaleY - 1);
15872
+ toOuterPoint(local, tempPoint$1, tempPoint$1, true);
15873
+ this.x += tempPoint$1.x;
15874
+ this.y += tempPoint$1.y;
15875
+ scaleX = (width * scaleX - (width - boxBounds.width)) / boxBounds.width;
15876
+ scaleY = (height * scaleY - (height - boxBounds.height)) / boxBounds.height;
15877
+ }
15820
15878
  this.__scaleResize(scaleX, scaleY);
15821
15879
  }
15822
15880
  };
@@ -21246,4 +21304,4 @@ function isSame(a, b) {
21246
21304
 
21247
21305
  Plugin.add("corner");
21248
21306
 
21249
- 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, HTMLText, HTMLTextData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageBox, ImageBoxData, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, 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, TextEditor, 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 };
21307
+ 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, HTMLText, HTMLTextData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageBox, ImageBoxData, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, 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, TextEditor, 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 };