@leafer/worker 2.1.3 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/worker.js CHANGED
@@ -240,7 +240,7 @@ var LeaferUI = function(exports) {
240
240
  RUNTIME: "runtime",
241
241
  LEAF: "leaf",
242
242
  TASK: "task",
243
- CNAVAS: "canvas",
243
+ CANVAS: "canvas",
244
244
  IMAGE: "image",
245
245
  types: {},
246
246
  create(typeName) {
@@ -434,7 +434,7 @@ var LeaferUI = function(exports) {
434
434
  }
435
435
  const {sin: sin$6, cos: cos$6, acos: acos, sqrt: sqrt$5} = Math;
436
436
  const {float: float$6} = MathHelper;
437
- const tempPoint$5 = {};
437
+ const tempPoint$6 = {};
438
438
  function getWorld() {
439
439
  return Object.assign(Object.assign(Object.assign({}, getMatrixData()), getBoundsData()), {
440
440
  scaleX: 1,
@@ -491,8 +491,8 @@ var LeaferUI = function(exports) {
491
491
  to.f = t.f * pixelRatio;
492
492
  },
493
493
  scaleOfOuter(t, origin, scaleX, scaleY) {
494
- M$c.toInnerPoint(t, origin, tempPoint$5);
495
- M$c.scaleOfInner(t, tempPoint$5, scaleX, scaleY);
494
+ M$c.toInnerPoint(t, origin, tempPoint$6);
495
+ M$c.scaleOfInner(t, tempPoint$6, scaleX, scaleY);
496
496
  },
497
497
  scaleOfInner(t, origin, scaleX, scaleY = scaleX) {
498
498
  M$c.translateInner(t, origin.x, origin.y);
@@ -510,8 +510,8 @@ var LeaferUI = function(exports) {
510
510
  t.d = c * sinR + d * cosR;
511
511
  },
512
512
  rotateOfOuter(t, origin, rotation) {
513
- M$c.toInnerPoint(t, origin, tempPoint$5);
514
- M$c.rotateOfInner(t, tempPoint$5, rotation);
513
+ M$c.toInnerPoint(t, origin, tempPoint$6);
514
+ M$c.rotateOfInner(t, tempPoint$6, rotation);
515
515
  },
516
516
  rotateOfInner(t, origin, rotation) {
517
517
  M$c.translateInner(t, origin.x, origin.y);
@@ -532,8 +532,8 @@ var LeaferUI = function(exports) {
532
532
  }
533
533
  },
534
534
  skewOfOuter(t, origin, skewX, skewY) {
535
- M$c.toInnerPoint(t, origin, tempPoint$5);
536
- M$c.skewOfInner(t, tempPoint$5, skewX, skewY);
535
+ M$c.toInnerPoint(t, origin, tempPoint$6);
536
+ M$c.skewOfInner(t, tempPoint$6, skewX, skewY);
537
537
  },
538
538
  skewOfInner(t, origin, skewX, skewY = 0) {
539
539
  M$c.translateInner(t, origin.x, origin.y);
@@ -729,7 +729,7 @@ var LeaferUI = function(exports) {
729
729
  };
730
730
  const M$c = MatrixHelper;
731
731
  const {float: float$5} = MathHelper;
732
- const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
732
+ const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$4} = MatrixHelper;
733
733
  const {sin: sin$5, cos: cos$5, abs: abs$b, sqrt: sqrt$4, atan2: atan2$2, min: min$3, round: round$5} = Math;
734
734
  const PointHelper = {
735
735
  defaultPoint: getPointData(),
@@ -785,7 +785,7 @@ var LeaferUI = function(exports) {
785
785
  tempToOuterOf(t, matrix) {
786
786
  const {tempPoint: temp} = P$7;
787
787
  copy$c(temp, t);
788
- toOuterPoint$3(matrix, temp, temp);
788
+ toOuterPoint$4(matrix, temp, temp);
789
789
  return temp;
790
790
  },
791
791
  tempToInnerRadiusPointOf(t, matrix) {
@@ -809,7 +809,7 @@ var LeaferUI = function(exports) {
809
809
  toInnerPoint$2(matrix, t, to);
810
810
  },
811
811
  toOuterOf(t, matrix, to) {
812
- toOuterPoint$3(matrix, t, to);
812
+ toOuterPoint$4(matrix, t, to);
813
813
  },
814
814
  getCenter(t, to) {
815
815
  return {
@@ -869,7 +869,7 @@ var LeaferUI = function(exports) {
869
869
  return quick ? t.x === point.x && t.y === point.y : float$5(t.x) === float$5(point.x) && float$5(t.y) === float$5(point.y);
870
870
  },
871
871
  reset(t) {
872
- P$7.reset(t);
872
+ t.x = t.y = 0;
873
873
  }
874
874
  };
875
875
  const P$7 = PointHelper;
@@ -946,7 +946,7 @@ var LeaferUI = function(exports) {
946
946
  return this;
947
947
  }
948
948
  }
949
- const tempPoint$4 = new Point;
949
+ const tempPoint$5 = new Point;
950
950
  class Matrix {
951
951
  constructor(a, b, c, d, e, f) {
952
952
  this.set(a, b, c, d, e, f);
@@ -1073,6 +1073,7 @@ var LeaferUI = function(exports) {
1073
1073
  }
1074
1074
  reset() {
1075
1075
  MatrixHelper.reset(this);
1076
+ return this;
1076
1077
  }
1077
1078
  }
1078
1079
  const tempMatrix$2 = new Matrix;
@@ -1199,7 +1200,7 @@ var LeaferUI = function(exports) {
1199
1200
  }
1200
1201
  };
1201
1202
  const {tempPointBounds: tempPointBounds$1, setPoint: setPoint$5, addPoint: addPoint$3, toBounds: toBounds$3} = TwoPointBoundsHelper;
1202
- const {toOuterPoint: toOuterPoint$2} = MatrixHelper;
1203
+ const {toOuterPoint: toOuterPoint$3} = MatrixHelper;
1203
1204
  const {float: float$4, fourNumber: fourNumber$1} = MathHelper;
1204
1205
  const {floor: floor$2, ceil: ceil$2} = Math;
1205
1206
  let right$4, bottom$3, boundsRight, boundsBottom;
@@ -1306,16 +1307,16 @@ var LeaferUI = function(exports) {
1306
1307
  } else {
1307
1308
  point$2.x = t.x;
1308
1309
  point$2.y = t.y;
1309
- toOuterPoint$2(matrix, point$2, toPoint$5);
1310
+ toOuterPoint$3(matrix, point$2, toPoint$5);
1310
1311
  setPoint$5(tempPointBounds$1, toPoint$5.x, toPoint$5.y);
1311
1312
  point$2.x = t.x + t.width;
1312
- toOuterPoint$2(matrix, point$2, toPoint$5);
1313
+ toOuterPoint$3(matrix, point$2, toPoint$5);
1313
1314
  addPoint$3(tempPointBounds$1, toPoint$5.x, toPoint$5.y);
1314
1315
  point$2.y = t.y + t.height;
1315
- toOuterPoint$2(matrix, point$2, toPoint$5);
1316
+ toOuterPoint$3(matrix, point$2, toPoint$5);
1316
1317
  addPoint$3(tempPointBounds$1, toPoint$5.x, toPoint$5.y);
1317
1318
  point$2.x = t.x;
1318
- toOuterPoint$2(matrix, point$2, toPoint$5);
1319
+ toOuterPoint$3(matrix, point$2, toPoint$5);
1319
1320
  addPoint$3(tempPointBounds$1, toPoint$5.x, toPoint$5.y);
1320
1321
  toBounds$3(tempPointBounds$1, to);
1321
1322
  }
@@ -2177,7 +2178,7 @@ var LeaferUI = function(exports) {
2177
2178
  this.worldTransform = {};
2178
2179
  if (!config) config = minSize;
2179
2180
  this.manager = manager;
2180
- this.innerId = IncrementId.create(IncrementId.CNAVAS);
2181
+ this.innerId = IncrementId.create(IncrementId.CANVAS);
2181
2182
  const {width: width, height: height, pixelRatio: pixelRatio} = config;
2182
2183
  this.autoLayout = !width || !height;
2183
2184
  this.size.pixelRatio = pixelRatio || Platform.devicePixelRatio;
@@ -2327,6 +2328,7 @@ var LeaferUI = function(exports) {
2327
2328
  }
2328
2329
  useGrayscaleAlpha(bounds) {
2329
2330
  this.setTempPixelBounds(bounds, true, true);
2331
+ if (!tempPixelBounds.width || !tempPixelBounds.height) return;
2330
2332
  let alpha, pixel;
2331
2333
  const {context: context} = this, imageData = context.getImageData(tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height), {data: data} = imageData;
2332
2334
  for (let i = 0, len = data.length; i < len; i += 4) {
@@ -2522,7 +2524,7 @@ var LeaferUI = function(exports) {
2522
2524
  const {setPoint: setPoint$4, addPoint: addPoint$2} = TwoPointBoundsHelper;
2523
2525
  const {set: set$1, toNumberPoints: toNumberPoints$1} = PointHelper;
2524
2526
  const {M: M$b, L: L$b, C: C$9, Q: Q$7, Z: Z$9} = PathCommandMap;
2525
- const tempPoint$3 = {};
2527
+ const tempPoint$4 = {};
2526
2528
  const BezierHelper = {
2527
2529
  points(data, originPoints, curve, close) {
2528
2530
  let points = toNumberPoints$1(originPoints);
@@ -2607,10 +2609,10 @@ var LeaferUI = function(exports) {
2607
2609
  const centerY = y1 + c * sin$4(startRadian + totalRadian / 2 + PI_2 * sign);
2608
2610
  startRadian -= PI_2 * sign;
2609
2611
  endRadian -= PI_2 * sign;
2610
- return ellipse$8(data, centerX, centerY, radius, radius, 0, startRadian / OneRadian, endRadian / OneRadian, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2612
+ return ellipse$7(data, centerX, centerY, radius, radius, 0, startRadian / OneRadian, endRadian / OneRadian, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2611
2613
  },
2612
2614
  arc(data, x, y, radius, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint) {
2613
- return ellipse$8(data, x, y, radius, radius, 0, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2615
+ return ellipse$7(data, x, y, radius, radius, 0, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2614
2616
  },
2615
2617
  ellipse(data, cx, cy, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint) {
2616
2618
  const rotationRadian = rotation * OneRadian;
@@ -2692,8 +2694,8 @@ var LeaferUI = function(exports) {
2692
2694
  addMode ? addPoint$2(pointBounds, fromX, fromY) : setPoint$4(pointBounds, fromX, fromY);
2693
2695
  addPoint$2(pointBounds, toX, toY);
2694
2696
  for (let i = 0, len = tList.length; i < len; i++) {
2695
- getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$3);
2696
- addPoint$2(pointBounds, tempPoint$3.x, tempPoint$3.y);
2697
+ getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$4);
2698
+ addPoint$2(pointBounds, tempPoint$4.x, tempPoint$4.y);
2697
2699
  }
2698
2700
  },
2699
2701
  getPointAndSet(t, fromX, fromY, x1, y1, x2, y2, toX, toY, setPoint) {
@@ -2737,9 +2739,9 @@ var LeaferUI = function(exports) {
2737
2739
  };
2738
2740
  }
2739
2741
  };
2740
- const {getPointAndSet: getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$8} = BezierHelper;
2742
+ const {getPointAndSet: getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$7} = BezierHelper;
2741
2743
  const {sin: sin$3, cos: cos$3, sqrt: sqrt$2, atan2: atan2} = Math;
2742
- const {ellipse: ellipse$7} = BezierHelper;
2744
+ const {ellipse: ellipse$6} = BezierHelper;
2743
2745
  const EllipseHelper = {
2744
2746
  ellipticalArc(data, fromX, fromY, radiusX, radiusY, rotation, largeFlag, sweepFlag, toX, toY, curveMode) {
2745
2747
  const halfX = (toX - fromX) / 2;
@@ -2776,7 +2778,7 @@ var LeaferUI = function(exports) {
2776
2778
  const centerY = fromY + halfY + rotationSin * cx + rotationCos * cy;
2777
2779
  const anticlockwise = totalRadian < 0 ? 1 : 0;
2778
2780
  if (curveMode || Platform.ellipseToCurve) {
2779
- ellipse$7(data, centerX, centerY, radiusX, radiusY, rotation, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
2781
+ ellipse$6(data, centerX, centerY, radiusX, radiusY, rotation, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
2780
2782
  } else {
2781
2783
  if (radiusX === radiusY && !rotation) {
2782
2784
  data.push(PathCommandMap.O, centerX, centerY, radiusX, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
@@ -2795,7 +2797,7 @@ var LeaferUI = function(exports) {
2795
2797
  }
2796
2798
  };
2797
2799
  const {M: M$a, m: m, L: L$a, l: l, H: H, h: h, V: V, v: v, C: C$8, c: c, S: S$1, s: s, Q: Q$6, q: q, T: T, t: t, A: A, a: a, Z: Z$8, z: z, N: N$5, D: D$6, X: X$5, G: G$5, F: F$6, O: O$6, P: P$5, U: U$5} = PathCommandMap;
2798
- const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$4, arc: arc$3, ellipse: ellipse$6, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
2800
+ const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$4, arc: arc$3, ellipse: ellipse$5, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
2799
2801
  const {ellipticalArc: ellipticalArc} = EllipseHelper;
2800
2802
  const debug$f = Debug.get("PathConvert");
2801
2803
  const setEndPoint$1 = {};
@@ -2850,7 +2852,8 @@ var LeaferUI = function(exports) {
2850
2852
  current.length = PathCommandLengthMap[char];
2851
2853
  current.index = 0;
2852
2854
  pushData(data, current.name);
2853
- if (char === "m") current.name = PathCommandMap["l"]; else if (char === "M") current.name = PathCommandMap["L"]; else if (!needConvert && convertCommand[char]) needConvert = true;
2855
+ if (char === "m") current.name = PathCommandMap["l"]; else if (char === "M") current.name = PathCommandMap["L"];
2856
+ if (!needConvert && convertCommand[char]) needConvert = true;
2854
2857
  } else {
2855
2858
  if (char === "-" || char === "+") {
2856
2859
  if (lastChar === "e" || lastChar === "E") {
@@ -2926,8 +2929,8 @@ var LeaferUI = function(exports) {
2926
2929
 
2927
2930
  case S$1:
2928
2931
  smooth = lastCommand === C$8 || lastCommand === S$1;
2929
- x1 = smooth ? x * 2 - controlX : old[i + 1];
2930
- y1 = smooth ? y * 2 - controlY : old[i + 2];
2932
+ x1 = smooth ? x * 2 - controlX : x;
2933
+ y1 = smooth ? y * 2 - controlY : y;
2931
2934
  controlX = old[i + 1];
2932
2935
  controlY = old[i + 2];
2933
2936
  x = old[i + 3];
@@ -2961,8 +2964,8 @@ var LeaferUI = function(exports) {
2961
2964
 
2962
2965
  case T:
2963
2966
  smooth = lastCommand === Q$6 || lastCommand === T;
2964
- controlX = smooth ? x * 2 - controlX : old[i + 1];
2965
- controlY = smooth ? y * 2 - controlY : old[i + 2];
2967
+ controlX = smooth ? x * 2 - controlX : x;
2968
+ controlY = smooth ? y * 2 - controlY : y;
2966
2969
  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]);
2967
2970
  x = old[i + 1];
2968
2971
  y = old[i + 2];
@@ -3026,14 +3029,14 @@ var LeaferUI = function(exports) {
3026
3029
  break;
3027
3030
 
3028
3031
  case G$5:
3029
- ellipse$6(curveMode ? data : copyData(data, old, i, 9), old[i + 1], old[i + 2], old[i + 3], old[i + 4], old[i + 5], old[i + 6], old[i + 7], old[i + 8], null, setEndPoint$1);
3032
+ ellipse$5(curveMode ? data : copyData(data, old, i, 9), old[i + 1], old[i + 2], old[i + 3], old[i + 4], old[i + 5], old[i + 6], old[i + 7], old[i + 8], null, setEndPoint$1);
3030
3033
  x = setEndPoint$1.x;
3031
3034
  y = setEndPoint$1.y;
3032
3035
  i += 9;
3033
3036
  break;
3034
3037
 
3035
3038
  case F$6:
3036
- curveMode ? ellipse$6(data, old[i + 1], old[i + 2], old[i + 3], old[i + 4], 0, 0, 360, false) : copyData(data, old, i, 5);
3039
+ curveMode ? ellipse$5(data, old[i + 1], old[i + 2], old[i + 3], old[i + 4], 0, 0, 360, false) : copyData(data, old, i, 5);
3037
3040
  x = old[i + 1] + old[i + 3];
3038
3041
  y = old[i + 2];
3039
3042
  i += 5;
@@ -3181,7 +3184,7 @@ var LeaferUI = function(exports) {
3181
3184
  drawEllipse(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
3182
3185
  BezierHelper.ellipse(null, x, y, radiusX, radiusY, isNull(rotation) ? 0 : rotation, isNull(startAngle) ? 0 : startAngle, isNull(endAngle) ? 360 : endAngle, anticlockwise, null, null, startPoint);
3183
3186
  data.push(M$9, startPoint.x, startPoint.y);
3184
- ellipse$5(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3187
+ ellipse$4(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3185
3188
  },
3186
3189
  drawArc(data, x, y, radius, startAngle, endAngle, anticlockwise) {
3187
3190
  BezierHelper.arc(null, x, y, radius, isNull(startAngle) ? 0 : startAngle, isNull(endAngle) ? 360 : endAngle, anticlockwise, null, null, startPoint);
@@ -3192,8 +3195,8 @@ var LeaferUI = function(exports) {
3192
3195
  BezierHelper.points(data, points, curve, close);
3193
3196
  }
3194
3197
  };
3195
- const {ellipse: ellipse$5, arc: arc$2} = PathCommandDataHelper;
3196
- const {moveTo: moveTo$4, lineTo: lineTo$3, quadraticCurveTo: quadraticCurveTo, bezierCurveTo: bezierCurveTo, closePath: closePath$3, beginPath: beginPath, rect: rect$2, roundRect: roundRect$1, ellipse: ellipse$4, arc: arc$1, arcTo: arcTo$3, drawEllipse: drawEllipse, drawArc: drawArc, drawPoints: drawPoints$2} = PathCommandDataHelper;
3198
+ const {ellipse: ellipse$4, arc: arc$2} = PathCommandDataHelper;
3199
+ const {moveTo: moveTo$4, lineTo: lineTo$3, quadraticCurveTo: quadraticCurveTo, bezierCurveTo: bezierCurveTo, closePath: closePath$3, beginPath: beginPath, rect: rect$2, roundRect: roundRect$1, ellipse: ellipse$3, arc: arc$1, arcTo: arcTo$3, drawEllipse: drawEllipse, drawArc: drawArc, drawPoints: drawPoints$2} = PathCommandDataHelper;
3197
3200
  class PathCreator {
3198
3201
  set path(value) {
3199
3202
  this.__path = value;
@@ -3249,7 +3252,7 @@ var LeaferUI = function(exports) {
3249
3252
  return this;
3250
3253
  }
3251
3254
  ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
3252
- ellipse$4(this.__path, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3255
+ ellipse$3(this.__path, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3253
3256
  this.paint();
3254
3257
  return this;
3255
3258
  }
@@ -3366,7 +3369,7 @@ var LeaferUI = function(exports) {
3366
3369
  }
3367
3370
  };
3368
3371
  const {M: M$7, L: L$7, C: C$5, Q: Q$3, Z: Z$5, N: N$2, D: D$3, X: X$2, G: G$2, F: F$3, O: O$3, P: P$2, U: U$2} = PathCommandMap;
3369
- const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$2, arc: arc, ellipse: ellipse$3} = BezierHelper;
3372
+ const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$2, arc: arc, ellipse: ellipse$2} = BezierHelper;
3370
3373
  const {addPointBounds: addPointBounds, copy: copy$9, addPoint: addPoint$1, setPoint: setPoint$3, addBounds: addBounds, toBounds: toBounds$2} = TwoPointBoundsHelper;
3371
3374
  const debug$d = Debug.get("PathBounds");
3372
3375
  let radius, radiusX, radiusY;
@@ -3442,7 +3445,7 @@ var LeaferUI = function(exports) {
3442
3445
  break;
3443
3446
 
3444
3447
  case G$2:
3445
- ellipse$3(null, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], data[i + 7], data[i + 8], tempPointBounds, setEndPoint);
3448
+ ellipse$2(null, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], data[i + 7], data[i + 8], tempPointBounds, setEndPoint);
3446
3449
  i === 0 ? copy$9(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
3447
3450
  x = setEndPoint.x;
3448
3451
  y = setEndPoint.y;
@@ -4474,7 +4477,7 @@ var LeaferUI = function(exports) {
4474
4477
  EventCreator.register(target);
4475
4478
  };
4476
4479
  }
4477
- 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;
4480
+ 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;
4478
4481
  const matrix$3 = {}, {round: round$3} = Math;
4479
4482
  const LeafHelper = {
4480
4483
  updateAllMatrix(leaf, checkAutoLayout, waitAutoLayout) {
@@ -4555,7 +4558,7 @@ var LeaferUI = function(exports) {
4555
4558
  x: x,
4556
4559
  y: y
4557
4560
  };
4558
- isInnerPoint ? toOuterPoint$1(t.localTransform, local, local, true) : t.parent && toInnerPoint$1(t.parent.scrollWorldTransform, local, local, true);
4561
+ isInnerPoint ? toOuterPoint$2(t.localTransform, local, local, true) : t.parent && toInnerPoint$1(t.parent.scrollWorldTransform, local, local, true);
4559
4562
  L$5.moveLocal(t, local.x, local.y, transition);
4560
4563
  },
4561
4564
  moveLocal(t, x, y = 0, transition) {
@@ -4568,10 +4571,10 @@ var LeaferUI = function(exports) {
4568
4571
  y: y
4569
4572
  }, transition) : (t.x = x, t.y = y);
4570
4573
  },
4571
- zoomOfWorld(t, origin, scaleX, scaleY, resize, transition) {
4572
- L$5.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize, transition);
4574
+ zoomOfWorld(t, origin, scaleX, scaleY, resize, transition, boundsType) {
4575
+ L$5.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize, transition, boundsType);
4573
4576
  },
4574
- zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize, transition) {
4577
+ zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize, transition, boundsType) {
4575
4578
  const o = t.__localMatrix;
4576
4579
  if (!isNumber(scaleY)) {
4577
4580
  if (scaleY) transition = scaleY;
@@ -4580,7 +4583,7 @@ var LeaferUI = function(exports) {
4580
4583
  copy$8(matrix$3, o);
4581
4584
  scaleOfOuter$2(matrix$3, origin, scaleX, scaleY);
4582
4585
  if (L$5.hasHighPosition(t)) {
4583
- L$5.setTransform(t, matrix$3, resize, transition);
4586
+ L$5.setTransform(t, matrix$3, resize, transition, boundsType);
4584
4587
  } else {
4585
4588
  const x = t.x + matrix$3.e - o.e, y = t.y + matrix$3.f - o.f;
4586
4589
  if (transition && !resize) t.animate({
@@ -4588,7 +4591,7 @@ var LeaferUI = function(exports) {
4588
4591
  y: y,
4589
4592
  scaleX: t.scaleX * scaleX,
4590
4593
  scaleY: t.scaleY * scaleY
4591
- }, transition); else t.x = x, t.y = y, t.scaleResize(scaleX, scaleY, resize !== true);
4594
+ }, transition); else t.x = x, t.y = y, t.scaleResize(scaleX, scaleY, resize !== true, boundsType);
4592
4595
  }
4593
4596
  },
4594
4597
  rotateOfWorld(t, origin, angle, transition) {
@@ -4612,18 +4615,18 @@ var LeaferUI = function(exports) {
4612
4615
  skewOfOuter(matrix$3, origin, skewX, skewY);
4613
4616
  L$5.setTransform(t, matrix$3, resize, transition);
4614
4617
  },
4615
- transformWorld(t, transform, resize, transition) {
4618
+ transformWorld(t, transform, resize, transition, boundsType) {
4616
4619
  copy$8(matrix$3, t.worldTransform);
4617
4620
  multiplyParent$3(matrix$3, transform);
4618
4621
  if (t.parent) divideParent(matrix$3, t.parent.scrollWorldTransform);
4619
- L$5.setTransform(t, matrix$3, resize, transition);
4622
+ L$5.setTransform(t, matrix$3, resize, transition, boundsType);
4620
4623
  },
4621
- transform(t, transform, resize, transition) {
4624
+ transform(t, transform, resize, transition, boundsType) {
4622
4625
  copy$8(matrix$3, t.localTransform);
4623
4626
  multiplyParent$3(matrix$3, transform);
4624
- L$5.setTransform(t, matrix$3, resize, transition);
4627
+ L$5.setTransform(t, matrix$3, resize, transition, boundsType);
4625
4628
  },
4626
- setTransform(t, transform, resize, transition) {
4629
+ setTransform(t, transform, resize, transition, boundsType) {
4627
4630
  const data = t.__, originPoint = data.origin && L$5.getInnerOrigin(t, data.origin);
4628
4631
  const layout = getLayout(transform, originPoint, data.around && L$5.getInnerOrigin(t, data.around));
4629
4632
  if (L$5.hasOffset(t)) {
@@ -4639,7 +4642,7 @@ var LeaferUI = function(exports) {
4639
4642
  PointHelper.move(layout, originPoint.x - changedPoint.x, originPoint.y - changedPoint.y);
4640
4643
  }
4641
4644
  t.set(layout);
4642
- t.scaleResize(scaleX, scaleY, false);
4645
+ t.scaleResize(scaleX, scaleY, false, boundsType);
4643
4646
  } else t.set(layout, transition);
4644
4647
  },
4645
4648
  getFlipTransform(t, axis) {
@@ -4841,11 +4844,11 @@ var LeaferUI = function(exports) {
4841
4844
  w.height *= scaleY;
4842
4845
  w.scaleX *= scaleX;
4843
4846
  w.scaleY *= scaleY;
4844
- if (branch.isBranch) scale$3(branch, x, y, scaleX, scaleY, a, b);
4847
+ if (branch.isBranch) scale$4(branch, x, y, scaleX, scaleY, a, b);
4845
4848
  }
4846
4849
  }
4847
4850
  };
4848
- const {pushAllChildBranch: pushAllChildBranch$1, pushAllBranchStack: pushAllBranchStack, updateBoundsByBranchStack: updateBoundsByBranchStack, move: move$9, scale: scale$3} = BranchHelper;
4851
+ const {pushAllChildBranch: pushAllChildBranch$1, pushAllBranchStack: pushAllBranchStack, updateBoundsByBranchStack: updateBoundsByBranchStack, move: move$9, scale: scale$4} = BranchHelper;
4849
4852
  const WaitHelper = {
4850
4853
  run(wait) {
4851
4854
  if (wait && wait.length) {
@@ -5206,6 +5209,7 @@ var LeaferUI = function(exports) {
5206
5209
  this.renderChanged = true;
5207
5210
  this.renderSpread || (this.renderSpread = 1);
5208
5211
  this.boundsChanged = true;
5212
+ this.hitCanvasChanged = true;
5209
5213
  }
5210
5214
  scaleChange() {
5211
5215
  this.scaleChanged = true;
@@ -5638,7 +5642,7 @@ var LeaferUI = function(exports) {
5638
5642
  }
5639
5643
  };
5640
5644
  const {setLayout: setLayout, multiplyParent: multiplyParent$2, translateInner: translateInner, defaultWorld: defaultWorld} = MatrixHelper;
5641
- const {toPoint: toPoint$4, tempPoint: tempPoint$2} = AroundHelper;
5645
+ const {toPoint: toPoint$4, tempPoint: tempPoint$3} = AroundHelper;
5642
5646
  const LeafMatrix = {
5643
5647
  __updateWorldMatrix() {
5644
5648
  const {parent: parent, __layout: __layout, __world: __world, __scrollWorld: __scrollWorld, __: __} = this;
@@ -5658,8 +5662,8 @@ var LeaferUI = function(exports) {
5658
5662
  local.e = data.x + data.offsetX;
5659
5663
  local.f = data.y + data.offsetY;
5660
5664
  if (data.around || data.origin) {
5661
- toPoint$4(data.around || data.origin, layout.boxBounds, tempPoint$2);
5662
- translateInner(local, -tempPoint$2.x, -tempPoint$2.y, !data.around);
5665
+ toPoint$4(data.around || data.origin, layout.boxBounds, tempPoint$3);
5666
+ translateInner(local, -tempPoint$3.x, -tempPoint$3.y, !data.around);
5663
5667
  }
5664
5668
  }
5665
5669
  this.__layout.matrixChanged = undefined;
@@ -5880,7 +5884,7 @@ var LeaferUI = function(exports) {
5880
5884
  };
5881
5885
  const {LEAF: LEAF, create: create} = IncrementId;
5882
5886
  const {stintSet: stintSet$6} = DataHelper;
5883
- const {toInnerPoint: toInnerPoint, toOuterPoint: toOuterPoint, multiplyParent: multiplyParent$1} = MatrixHelper;
5887
+ const {toInnerPoint: toInnerPoint, toOuterPoint: toOuterPoint$1, multiplyParent: multiplyParent$1} = MatrixHelper;
5884
5888
  const {toOuterOf: toOuterOf$1} = BoundsHelper;
5885
5889
  const {copy: copy$5, move: move$8} = PointHelper;
5886
5890
  const {getScaleFixedData: getScaleFixedData$1} = MathHelper;
@@ -6052,10 +6056,6 @@ var LeaferUI = function(exports) {
6052
6056
  }
6053
6057
  }
6054
6058
  }
6055
- set(_data, _isTemp) {}
6056
- get(_name) {
6057
- return undefined;
6058
- }
6059
6059
  setAttr(name, value) {
6060
6060
  this[name] = value;
6061
6061
  }
@@ -6072,37 +6072,10 @@ var LeaferUI = function(exports) {
6072
6072
  toString(options) {
6073
6073
  return JSON.stringify(this.toJSON(options));
6074
6074
  }
6075
- toSVG() {
6076
- return undefined;
6077
- }
6078
- __SVG(_data) {}
6079
- toHTML() {
6080
- return undefined;
6081
- }
6082
- __setAttr(_attrName, _newValue) {
6083
- return true;
6084
- }
6085
- __getAttr(_attrName) {
6086
- return undefined;
6087
- }
6088
- setProxyAttr(_attrName, _newValue) {}
6089
- getProxyAttr(_attrName) {
6090
- return undefined;
6091
- }
6092
- find(_condition, _options) {
6093
- return undefined;
6094
- }
6095
- findTag(_tag) {
6096
- return undefined;
6097
- }
6098
- findOne(_condition, _options) {
6099
- return undefined;
6100
- }
6101
- findId(_id) {
6102
- return undefined;
6075
+ scaleResize(scaleX, scaleY = scaleX, _noResize, _boundsType) {
6076
+ this.scaleX *= scaleX;
6077
+ this.scaleY *= scaleY;
6103
6078
  }
6104
- focus(_value) {}
6105
- updateState() {}
6106
6079
  updateLayout() {
6107
6080
  this.__layout.update();
6108
6081
  }
@@ -6118,27 +6091,6 @@ var LeaferUI = function(exports) {
6118
6091
  __extraUpdate() {
6119
6092
  if (this.leaferIsReady) this.leafer.layouter.addExtra(this);
6120
6093
  }
6121
- __updateWorldMatrix() {}
6122
- __updateLocalMatrix() {}
6123
- __updateWorldBounds() {}
6124
- __updateLocalBounds() {}
6125
- __updateLocalBoxBounds() {}
6126
- __updateLocalStrokeBounds() {}
6127
- __updateLocalRenderBounds() {}
6128
- __updateBoxBounds(_secondLayout, _bounds) {}
6129
- __updateContentBounds() {}
6130
- __updateStrokeBounds(_bounds) {}
6131
- __updateRenderBounds(_bounds) {}
6132
- __updateAutoLayout() {}
6133
- __updateFlowLayout() {}
6134
- __updateNaturalSize() {}
6135
- __updateStrokeSpread() {
6136
- return 0;
6137
- }
6138
- __updateRenderSpread() {
6139
- return 0;
6140
- }
6141
- __onUpdateSize() {}
6142
6094
  __updateEraser(value) {
6143
6095
  this.__hasEraser = value ? true : this.children.some(item => item.__.eraser);
6144
6096
  }
@@ -6152,7 +6104,6 @@ var LeaferUI = function(exports) {
6152
6104
  __updateMask(_value) {
6153
6105
  this.__hasMask = this.children.some(item => item.__.mask && item.__.visible && item.__.opacity);
6154
6106
  }
6155
- __renderMask(_canvas, _options) {}
6156
6107
  __getNowWorld(options) {
6157
6108
  if (options.matrix) {
6158
6109
  if (!this.__cameraWorld) this.__cameraWorld = {};
@@ -6214,7 +6165,7 @@ var LeaferUI = function(exports) {
6214
6165
  toInnerPoint(this.worldTransform, world, to, distance);
6215
6166
  }
6216
6167
  innerToWorld(inner, to, distance, relative) {
6217
- toOuterPoint(this.worldTransform, inner, to, distance);
6168
+ toOuterPoint$1(this.worldTransform, inner, to, distance);
6218
6169
  if (relative) relative.worldToInner(to ? to : inner, null, distance);
6219
6170
  }
6220
6171
  getBoxPoint(world, relative, distance, change) {
@@ -6269,11 +6220,11 @@ var LeaferUI = function(exports) {
6269
6220
  const layer = this.leafer ? this.leafer.zoomLayer : this;
6270
6221
  return layer.getWorldPoint(page, relative, distance, change);
6271
6222
  }
6272
- setTransform(matrix, resize, transition) {
6273
- setTransform(this, matrix, resize, transition);
6223
+ setTransform(matrix, resize, transition, boundsType) {
6224
+ setTransform(this, matrix, resize, transition, boundsType);
6274
6225
  }
6275
- transform(matrix, resize, transition) {
6276
- transform(this, matrix, resize, transition);
6226
+ transform(matrix, resize, transition, boundsType) {
6227
+ transform(this, matrix, resize, transition, boundsType);
6277
6228
  }
6278
6229
  move(x, y, transition) {
6279
6230
  moveLocal(this, x, y, transition);
@@ -6281,8 +6232,8 @@ var LeaferUI = function(exports) {
6281
6232
  moveInner(x, y, transition) {
6282
6233
  moveWorld(this, x, y, true, transition);
6283
6234
  }
6284
- scaleOf(origin, scaleX, scaleY, resize, transition) {
6285
- zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize, transition);
6235
+ scaleOf(origin, scaleX, scaleY, resize, transition, boundsType) {
6236
+ zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize, transition, boundsType);
6286
6237
  }
6287
6238
  rotateOf(origin, rotation, transition) {
6288
6239
  rotateOfLocal(this, getLocalOrigin(this, origin), rotation, transition);
@@ -6290,14 +6241,14 @@ var LeaferUI = function(exports) {
6290
6241
  skewOf(origin, skewX, skewY, resize, transition) {
6291
6242
  skewOfLocal(this, getLocalOrigin(this, origin), skewX, skewY, resize, transition);
6292
6243
  }
6293
- transformWorld(worldTransform, resize, transition) {
6294
- transformWorld(this, worldTransform, resize, transition);
6244
+ transformWorld(worldTransform, resize, transition, boundsType) {
6245
+ transformWorld(this, worldTransform, resize, transition, boundsType);
6295
6246
  }
6296
6247
  moveWorld(x, y, transition) {
6297
6248
  moveWorld(this, x, y, false, transition);
6298
6249
  }
6299
- scaleOfWorld(worldOrigin, scaleX, scaleY, resize, transition) {
6300
- zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize, transition);
6250
+ scaleOfWorld(worldOrigin, scaleX, scaleY, resize, transition, boundsType) {
6251
+ zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize, transition, boundsType);
6301
6252
  }
6302
6253
  rotateOfWorld(worldOrigin, rotation) {
6303
6254
  rotateOfWorld(this, worldOrigin, rotation);
@@ -6308,76 +6259,12 @@ var LeaferUI = function(exports) {
6308
6259
  flip(axis, transition) {
6309
6260
  transform(this, getFlipTransform(this, axis), false, transition);
6310
6261
  }
6311
- scaleResize(scaleX, scaleY = scaleX, _noResize) {
6312
- this.scaleX *= scaleX;
6313
- this.scaleY *= scaleY;
6314
- }
6315
- __scaleResize(_scaleX, _scaleY) {}
6316
- resizeWidth(_width) {}
6317
- resizeHeight(_height) {}
6318
- hit(_world, _hitRadius) {
6319
- return true;
6320
- }
6321
- __hitWorld(_point, _forceHitFill) {
6322
- return true;
6323
- }
6324
- __hit(_local, _forceHitFill) {
6325
- return true;
6326
- }
6327
- __hitFill(_inner) {
6328
- return true;
6329
- }
6330
- __hitStroke(_inner, _strokeWidth) {
6331
- return true;
6332
- }
6333
- __hitPixel(_inner) {
6334
- return true;
6335
- }
6336
- __drawHitPath(_canvas) {}
6337
- __updateHitCanvas() {}
6338
- __render(_canvas, _options) {}
6339
- __drawFast(_canvas, _options) {}
6340
- __draw(_canvas, _options, _originCanvas) {}
6341
- __clip(_canvas, _options) {}
6342
- __renderShape(_canvas, _options) {}
6343
- __drawShape(_canvas, _options) {}
6344
- __updateWorldOpacity() {}
6345
- __updateChange() {}
6346
- __drawPath(_canvas) {}
6347
- __drawRenderPath(_canvas) {}
6348
- __updatePath() {}
6349
- __updateRenderPath(_updateCache) {}
6350
- getMotionPathData() {
6351
- return Plugin.need("path");
6352
- }
6353
- getMotionPoint(_motionDistance) {
6354
- return Plugin.need("path");
6355
- }
6356
- getMotionTotal() {
6357
- return 0;
6358
- }
6359
- __updateMotionPath() {}
6360
- __runAnimation(_type, _complete) {}
6361
- __updateSortChildren() {}
6362
- add(_child, _index) {}
6363
6262
  remove(_child, destroy) {
6364
6263
  if (this.parent) this.parent.remove(this, destroy);
6365
6264
  }
6366
6265
  dropTo(parent, index, resize) {
6367
6266
  drop(this, parent, index, resize);
6368
6267
  }
6369
- on(_type, _listener, _options) {}
6370
- off(_type, _listener, _options) {}
6371
- on_(_type, _listener, _bind, _options) {
6372
- return undefined;
6373
- }
6374
- off_(_id) {}
6375
- once(_type, _listener, _captureOrBind, _capture) {}
6376
- emit(_type, _event, _capture) {}
6377
- emitEvent(_event, _capture) {}
6378
- hasEvent(_type, _capture) {
6379
- return false;
6380
- }
6381
6268
  static changeAttr(attrName, defaultValue, fn) {
6382
6269
  fn ? this.addAttr(attrName, defaultValue, fn) : defineDataProcessor(this.prototype, attrName, defaultValue);
6383
6270
  }
@@ -6673,7 +6560,7 @@ var LeaferUI = function(exports) {
6673
6560
  this.levelMap = null;
6674
6561
  }
6675
6562
  }
6676
- const version = "2.1.3";
6563
+ const version = "2.1.5";
6677
6564
  class LeaferCanvas extends LeaferCanvasBase {
6678
6565
  get allowBackgroundColor() {
6679
6566
  return true;
@@ -7302,7 +7189,7 @@ var LeaferUI = function(exports) {
7302
7189
  }
7303
7190
  }
7304
7191
  Renderer.clipSpread = 10;
7305
- const tempPoint$1 = {};
7192
+ const tempPoint$2 = {};
7306
7193
  const {copyRadiusPoint: copyRadiusPoint$1} = PointHelper;
7307
7194
  const {hitRadiusPoint: hitRadiusPoint$1} = BoundsHelper;
7308
7195
  class Picker {
@@ -7434,7 +7321,7 @@ var LeaferUI = function(exports) {
7434
7321
  for (let i = len - 1; i > -1; i--) {
7435
7322
  child = children[i], data = child.__;
7436
7323
  if (!data.visible || hitMask && !data.mask) continue;
7437
- hit = hitRadiusPoint$1(child.__world, data.hitRadius ? copyRadiusPoint$1(tempPoint$1, point, data.hitRadius) : point);
7324
+ hit = hitRadiusPoint$1(child.__world, data.hitRadius ? copyRadiusPoint$1(tempPoint$2, point, data.hitRadius) : point);
7438
7325
  if (child.isBranch) {
7439
7326
  if (hit || child.__ignoreHitWorld) {
7440
7327
  if (child.isBranchLeaf && data.__clipAfterFill && !child.__hitWorld(point, true)) continue;
@@ -8079,17 +7966,12 @@ var LeaferUI = function(exports) {
8079
7966
  if (!path) this.__drawPathByBox(pen);
8080
7967
  return pen;
8081
7968
  }
8082
- reset(_data) {}
8083
7969
  set(data, _transition) {
8084
7970
  if (data) Object.assign(this, data);
8085
7971
  }
8086
7972
  get(name) {
8087
7973
  return isString(name) ? this.__.__getInput(name) : this.__.__getInputData(name);
8088
7974
  }
8089
- createProxyData() {
8090
- return undefined;
8091
- }
8092
- clearProxyData() {}
8093
7975
  find(_condition, _options) {
8094
7976
  return Plugin.need("find");
8095
7977
  }
@@ -8127,6 +8009,7 @@ var LeaferUI = function(exports) {
8127
8009
  data.lazy && !this.__inLazyBounds && !Export.running ? data.__needComputePaint = true : data.__computePaint();
8128
8010
  }
8129
8011
  }
8012
+ __updatePath() {}
8130
8013
  __updateRenderPath(updateCache) {
8131
8014
  const data = this.__;
8132
8015
  if (data.path) {
@@ -8162,7 +8045,6 @@ var LeaferUI = function(exports) {
8162
8045
  this.set(keyframe);
8163
8046
  return Plugin.need("animate");
8164
8047
  }
8165
- killAnimate(_type, _nextStyle) {}
8166
8048
  export(_filename, _options) {
8167
8049
  return Plugin.need("export");
8168
8050
  }
@@ -8265,7 +8147,6 @@ var LeaferUI = function(exports) {
8265
8147
  __decorate([ surfaceType() ], exports.UI.prototype, "placeholderColor", void 0);
8266
8148
  __decorate([ dataType(100) ], exports.UI.prototype, "placeholderDelay", void 0);
8267
8149
  __decorate([ dataType({}) ], exports.UI.prototype, "data", void 0);
8268
- __decorate([ rewrite(exports.Leaf.prototype.reset) ], exports.UI.prototype, "reset", null);
8269
8150
  exports.UI = UI_1 = __decorate([ useModule(UIBounds), useModule(UIRender), rewriteAble() ], exports.UI);
8270
8151
  exports.Group = class Group extends exports.UI {
8271
8152
  get __tag() {
@@ -8301,9 +8182,6 @@ var LeaferUI = function(exports) {
8301
8182
  }
8302
8183
  return data;
8303
8184
  }
8304
- pick(_hitPoint, _options) {
8305
- return undefined;
8306
- }
8307
8185
  addAt(child, index) {
8308
8186
  this.add(child, index);
8309
8187
  }
@@ -8313,11 +8191,6 @@ var LeaferUI = function(exports) {
8313
8191
  addBefore(child, before) {
8314
8192
  this.add(child, this.children.indexOf(before));
8315
8193
  }
8316
- add(_child, _index) {}
8317
- addMany(..._children) {}
8318
- remove(_child, _destroy) {}
8319
- removeAll(_destroy) {}
8320
- clear() {}
8321
8194
  };
8322
8195
  __decorate([ dataProcessor(GroupData) ], exports.Group.prototype, "__", void 0);
8323
8196
  __decorate([ boundsType(0) ], exports.Group.prototype, "width", void 0);
@@ -8819,7 +8692,7 @@ var LeaferUI = function(exports) {
8819
8692
  __decorate([ surfaceType("#FFFFFF") ], exports.Frame.prototype, "fill", void 0);
8820
8693
  __decorate([ affectRenderBoundsType("hide") ], exports.Frame.prototype, "overflow", void 0);
8821
8694
  exports.Frame = __decorate([ registerUI() ], exports.Frame);
8822
- const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse$2} = PathCommandDataHelper;
8695
+ const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse$1} = PathCommandDataHelper;
8823
8696
  exports.Ellipse = class Ellipse extends exports.UI {
8824
8697
  get __tag() {
8825
8698
  return "Ellipse";
@@ -8831,21 +8704,21 @@ var LeaferUI = function(exports) {
8831
8704
  let open;
8832
8705
  if (innerRadius) {
8833
8706
  if (startAngle || endAngle) {
8834
- if (innerRadius < 1) ellipse$2(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false); else open = true;
8835
- ellipse$2(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
8707
+ if (innerRadius < 1) ellipse$1(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false); else open = true;
8708
+ ellipse$1(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
8836
8709
  } else {
8837
8710
  if (innerRadius < 1) {
8838
- ellipse$2(path, rx, ry, rx * innerRadius, ry * innerRadius);
8711
+ ellipse$1(path, rx, ry, rx * innerRadius, ry * innerRadius);
8839
8712
  moveTo$3(path, width, ry);
8840
8713
  }
8841
- ellipse$2(path, rx, ry, rx, ry, 0, 360, 0, true);
8714
+ ellipse$1(path, rx, ry, rx, ry, 0, 360, 0, true);
8842
8715
  }
8843
8716
  } else {
8844
8717
  if (startAngle || endAngle) {
8845
8718
  moveTo$3(path, rx, ry);
8846
- ellipse$2(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
8719
+ ellipse$1(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
8847
8720
  } else {
8848
- ellipse$2(path, rx, ry, rx, ry);
8721
+ ellipse$1(path, rx, ry, rx, ry);
8849
8722
  }
8850
8723
  }
8851
8724
  if (!open) closePath$2(path);
@@ -9171,51 +9044,6 @@ var LeaferUI = function(exports) {
9171
9044
  this.add(path);
9172
9045
  return this;
9173
9046
  }
9174
- beginPath() {
9175
- return this;
9176
- }
9177
- moveTo(_x, _y) {
9178
- return this;
9179
- }
9180
- lineTo(_x, _y) {
9181
- return this;
9182
- }
9183
- bezierCurveTo(_x1, _y1, _x2, _y2, _x, _y) {
9184
- return this;
9185
- }
9186
- quadraticCurveTo(_x1, _y1, _x, _y) {
9187
- return this;
9188
- }
9189
- closePath() {
9190
- return this;
9191
- }
9192
- rect(_x, _y, _width, _height) {
9193
- return this;
9194
- }
9195
- roundRect(_x, _y, _width, _height, _cornerRadius) {
9196
- return this;
9197
- }
9198
- ellipse(_x, _y, _radiusX, _radiusY, _rotation, _startAngle, _endAngle, _anticlockwise) {
9199
- return this;
9200
- }
9201
- arc(_x, _y, _radius, _startAngle, _endAngle, _anticlockwise) {
9202
- return this;
9203
- }
9204
- arcTo(_x1, _y1, _x2, _y2, _radius) {
9205
- return this;
9206
- }
9207
- drawEllipse(_x, _y, _radiusX, _radiusY, _rotation, _startAngle, _endAngle, _anticlockwise) {
9208
- return this;
9209
- }
9210
- drawArc(_x, _y, _radius, _startAngle, _endAngle, _anticlockwise) {
9211
- return this;
9212
- }
9213
- drawPoints(_points, _curve, _close) {
9214
- return this;
9215
- }
9216
- clearPath() {
9217
- return this;
9218
- }
9219
9047
  paint() {
9220
9048
  const {pathElement: pathElement} = this;
9221
9049
  if (!pathElement.__layout.boxChanged) pathElement.forceUpdate("path");
@@ -11041,7 +10869,7 @@ var LeaferUI = function(exports) {
11041
10869
  needUpdate = false;
11042
10870
  }
11043
10871
  }
11044
- if (paint.mode === "brush") PaintImage.brush(leafPaint, ui);
10872
+ if (paint.mode === "brush") PaintImage.brush(leafPaint, ui, attrName);
11045
10873
  if (!leafPaint.data) {
11046
10874
  PaintImage.createData(leafPaint, image, paint, boxBounds);
11047
10875
  const {transform: transform} = leafPaint.data, {opacity: opacity} = paint;
@@ -11236,7 +11064,7 @@ var LeaferUI = function(exports) {
11236
11064
  if (scaleX) scaleHelper(transform, scaleX, scaleY);
11237
11065
  translate(transform, box.x + x, box.y + y);
11238
11066
  }
11239
- const {get: get$1, scale: scale$2, copy: copy$4} = MatrixHelper;
11067
+ const {get: get$1, scale: scale$3, copy: copy$4} = MatrixHelper;
11240
11068
  const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$7} = Math;
11241
11069
  function createPatternTask(paint, ui, canvas, renderOptions) {
11242
11070
  if (!paint.patternTask) {
@@ -11271,7 +11099,7 @@ var LeaferUI = function(exports) {
11271
11099
  scaleY *= getFloorScale(height + (yGap || 0));
11272
11100
  imageMatrix = get$1();
11273
11101
  if (transform) copy$4(imageMatrix, transform);
11274
- scale$2(imageMatrix, 1 / scaleX, 1 / scaleY);
11102
+ scale$3(imageMatrix, 1 / scaleX, 1 / scaleY);
11275
11103
  }
11276
11104
  const imageCanvas = image.getCanvas(width, height, opacity, undefined, xGap, yGap, ui.leafer && ui.leafer.config.smooth, data.interlace);
11277
11105
  if (brush) {
@@ -12250,10 +12078,11 @@ var LeaferUI = function(exports) {
12250
12078
  if (innerEditor) innerEditor.editConfig && Object.assign(mergeConfig, innerEditor.editConfig); else if (editTool) editTool.editConfig && Object.assign(mergeConfig, editTool.editConfig);
12251
12079
  if (element && element.editConfig) {
12252
12080
  let {editConfig: editConfig} = element;
12253
- if (editConfig.hover || editConfig.hoverStyle) {
12081
+ if (editConfig.hover || editConfig.hoverStyle || editConfig.hoverPathType) {
12254
12082
  editConfig = Object.assign({}, editConfig);
12255
12083
  delete editConfig.hover;
12256
12084
  delete editConfig.hoverStyle;
12085
+ delete editConfig.hoverPathType;
12257
12086
  }
12258
12087
  Object.assign(mergeConfig, editConfig);
12259
12088
  }
@@ -12314,9 +12143,22 @@ var LeaferUI = function(exports) {
12314
12143
  matrix$1.half = strokeWidth % 2;
12315
12144
  canvas.setWorld(matrix$1, options.matrix);
12316
12145
  canvas.beginPath();
12317
- if (this.strokePathType === "path") {
12146
+ switch (this.strokePathType) {
12147
+ case "box":
12148
+ const {boxBounds: boxBounds} = leaf.__layout;
12149
+ canvas.rect(boxBounds.x, boxBounds.y, boxBounds.width, boxBounds.height);
12150
+ break;
12151
+
12152
+ case "stroke":
12153
+ const {strokeBounds: strokeBounds} = leaf.__layout;
12154
+ canvas.rect(strokeBounds.x, strokeBounds.y, strokeBounds.width, strokeBounds.height);
12155
+ break;
12156
+
12157
+ case "path":
12318
12158
  leaf.__drawPath(canvas);
12319
- } else {
12159
+ break;
12160
+
12161
+ default:
12320
12162
  if (leaf.__.__useArrow) leaf.__drawPath(canvas); else leaf.__.__pathForRender ? leaf.__drawRenderPath(canvas) : leaf.__drawPathByBox(canvas);
12321
12163
  }
12322
12164
  data.strokeWidth = strokeWidth / Math.max(aScaleX, aScaleY);
@@ -12431,10 +12273,11 @@ var LeaferUI = function(exports) {
12431
12273
  if (this.running && !this.dragging && !editor.dragging) {
12432
12274
  const {hoverTarget: hoverTarget, mergeConfig: mergeConfig} = editor, config = Object.assign({}, mergeConfig);
12433
12275
  if (hoverTarget && hoverTarget.editConfig) Object.assign(config, hoverTarget.editConfig);
12434
- const {stroke: stroke, strokeWidth: strokeWidth, hover: hover, hoverStyle: hoverStyle} = config;
12276
+ const {stroke: stroke, strokeWidth: strokeWidth, hover: hover, hoverStyle: hoverStyle, hoverPathType: hoverPathType} = config;
12435
12277
  this.hoverStroker.setTarget(hover ? hoverTarget : null, Object.assign({
12436
12278
  stroke: stroke,
12437
- strokeWidth: strokeWidth
12279
+ strokeWidth: strokeWidth,
12280
+ strokePathType: hoverPathType
12438
12281
  }, hoverStyle || {}));
12439
12282
  } else {
12440
12283
  this.hoverStroker.target = null;
@@ -12614,16 +12457,17 @@ var LeaferUI = function(exports) {
12614
12457
  const {topLeft: topLeft$1, top: top$1, topRight: topRight$1, right: right$2, bottomRight: bottomRight, bottom: bottom$1, bottomLeft: bottomLeft, left: left$2} = exports.Direction9;
12615
12458
  const {toPoint: toPoint} = AroundHelper, {within: within$3, sign: sign$1} = MathHelper, {abs: abs$4} = Math;
12616
12459
  const EditDataHelper = {
12617
- getScaleData(target, startBounds, direction, totalMoveOrScale, lockRatio, around, flipable, scaleMode) {
12460
+ getScaleData(target, startBounds, direction, totalMoveOrScale, lockRatio, around, flipable, scaleMode, boundsType) {
12618
12461
  let align, origin = {}, scaleX = 1, scaleY = 1, lockScale;
12619
- const {boxBounds: boxBounds, widthRange: widthRange, heightRange: heightRange, dragBounds: dragBounds, worldBoxBounds: worldBoxBounds} = target;
12462
+ const {widthRange: widthRange, heightRange: heightRange, dragBounds: dragBounds, worldTransform: worldTransform, boxBounds: boxBounds} = target;
12620
12463
  const {width: width, height: height} = startBounds;
12464
+ const innerBounds = target.getBounds(boundsType, "inner");
12621
12465
  const originChangedScaleX = target.scaleX / startBounds.scaleX;
12622
12466
  const originChangedScaleY = target.scaleY / startBounds.scaleY;
12623
12467
  const signX = sign$1(originChangedScaleX);
12624
12468
  const signY = sign$1(originChangedScaleY);
12625
- const changedScaleX = scaleMode ? originChangedScaleX : signX * boxBounds.width / width;
12626
- const changedScaleY = scaleMode ? originChangedScaleY : signY * boxBounds.height / height;
12469
+ const changedScaleX = scaleMode ? originChangedScaleX : signX * innerBounds.width / width;
12470
+ const changedScaleY = scaleMode ? originChangedScaleY : signY * innerBounds.height / height;
12627
12471
  if (isNumber(totalMoveOrScale)) {
12628
12472
  scaleX = scaleY = Math.sqrt(totalMoveOrScale);
12629
12473
  } else {
@@ -12709,10 +12553,11 @@ var LeaferUI = function(exports) {
12709
12553
  if (useScaleY) scaleY /= changedScaleY;
12710
12554
  if (!flipable) {
12711
12555
  const {worldTransform: worldTransform} = target;
12712
- if (scaleX < 0) scaleX = 1 / boxBounds.width / worldTransform.scaleX;
12713
- if (scaleY < 0) scaleY = 1 / boxBounds.height / worldTransform.scaleY;
12556
+ if (scaleX < 0) scaleX = 1 / innerBounds.width / worldTransform.scaleX;
12557
+ if (scaleY < 0) scaleY = 1 / innerBounds.height / worldTransform.scaleY;
12714
12558
  }
12715
- toPoint(around || align, boxBounds, origin, true);
12559
+ toPoint(around || align, innerBounds, origin, true);
12560
+ this.checkOrigin(target, origin, boundsType);
12716
12561
  if (dragBounds) {
12717
12562
  const scaleData = {
12718
12563
  x: scaleX,
@@ -12723,15 +12568,20 @@ var LeaferUI = function(exports) {
12723
12568
  scaleY = scaleData.y;
12724
12569
  }
12725
12570
  if (useScaleX && widthRange) {
12726
- const nowWidth = boxBounds.width * target.scaleX;
12571
+ const nowWidth = innerBounds.width * target.scaleX;
12727
12572
  scaleX = within$3(nowWidth * scaleX, widthRange) / nowWidth;
12728
12573
  }
12729
12574
  if (useScaleY && heightRange) {
12730
- const nowHeight = boxBounds.height * target.scaleY;
12575
+ const nowHeight = innerBounds.height * target.scaleY;
12731
12576
  scaleY = within$3(nowHeight * scaleY, heightRange) / nowHeight;
12732
12577
  }
12733
- if (useScaleX && abs$4(scaleX * worldBoxBounds.width) < 1) scaleX = sign$1(scaleX) / worldBoxBounds.width;
12734
- if (useScaleY && abs$4(scaleY * worldBoxBounds.height) < 1) scaleY = sign$1(scaleY) / worldBoxBounds.height;
12578
+ let minWidth = 1 * abs$4(worldTransform.scaleX), minHeight = 1 * abs$4(worldTransform.scaleY);
12579
+ if (boundsType !== "box") {
12580
+ minWidth += innerBounds.width - boxBounds.width;
12581
+ minHeight += innerBounds.height - boxBounds.height;
12582
+ }
12583
+ if (useScaleX && abs$4(scaleX * innerBounds.width) < minWidth) scaleX = sign$1(scaleX) * minWidth / innerBounds.width;
12584
+ if (useScaleY && abs$4(scaleY * innerBounds.height) < minHeight) scaleY = sign$1(scaleY) * minHeight / innerBounds.height;
12735
12585
  if (lockRatio && scaleX !== scaleY) {
12736
12586
  lockScale = Math.min(abs$4(scaleX), abs$4(scaleY));
12737
12587
  scaleX = sign$1(scaleX) * lockScale;
@@ -12748,7 +12598,7 @@ var LeaferUI = function(exports) {
12748
12598
  around: around
12749
12599
  };
12750
12600
  },
12751
- getRotateData(target, direction, current, last, around) {
12601
+ getRotateData(target, direction, current, last, around, boundsType) {
12752
12602
  let align, origin = {};
12753
12603
  switch (direction) {
12754
12604
  case topLeft$1:
@@ -12770,13 +12620,14 @@ var LeaferUI = function(exports) {
12770
12620
  default:
12771
12621
  align = "center";
12772
12622
  }
12773
- toPoint(around || align, target.boxBounds, origin, true);
12623
+ toPoint(around || align, target.getBounds(boundsType, "inner"), origin, true);
12624
+ this.checkOrigin(target, origin, boundsType);
12774
12625
  return {
12775
12626
  origin: origin,
12776
12627
  rotation: PointHelper.getRotation(last, target.getWorldPointByBox(origin), current)
12777
12628
  };
12778
12629
  },
12779
- getSkewData(bounds, direction, move, around) {
12630
+ getSkewData(target, direction, move, around, boundsType) {
12780
12631
  let align, origin = {}, skewX = 0, skewY = 0;
12781
12632
  let last;
12782
12633
  switch (direction) {
@@ -12819,10 +12670,12 @@ var LeaferUI = function(exports) {
12819
12670
  align = "left";
12820
12671
  skewY = 1;
12821
12672
  }
12822
- const {width: width, height: height} = bounds;
12673
+ const innerBounds = target.getBounds(boundsType, "inner");
12674
+ const {width: width, height: height} = innerBounds;
12823
12675
  last.x = last.x * width;
12824
12676
  last.y = last.y * height;
12825
- toPoint(around || align, bounds, origin, true);
12677
+ toPoint(around || align, innerBounds, origin, true);
12678
+ this.checkOrigin(target, origin, boundsType);
12826
12679
  const rotation = PointHelper.getRotation(last, origin, {
12827
12680
  x: last.x + (skewX ? move.x : 0),
12828
12681
  y: last.y + (skewY ? move.y : 0)
@@ -12834,6 +12687,13 @@ var LeaferUI = function(exports) {
12834
12687
  skewY: skewY
12835
12688
  };
12836
12689
  },
12690
+ checkOrigin(target, origin, boundsType) {
12691
+ if (boundsType !== "box") {
12692
+ const {boxBounds: boxBounds} = target, innerBounds = target.getBounds(boundsType, "inner");
12693
+ origin.x += innerBounds.x - boxBounds.x;
12694
+ origin.y += innerBounds.y - boxBounds.y;
12695
+ }
12696
+ },
12837
12697
  getAround(around, altKey) {
12838
12698
  return altKey && !around ? "center" : around;
12839
12699
  },
@@ -13097,8 +12957,8 @@ var LeaferUI = function(exports) {
13097
12957
  updateMoveCursor(this);
13098
12958
  }
13099
12959
  update() {
13100
- const {editor: editor} = this;
13101
- 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);
12960
+ const {editor: editor, mergeConfig: mergeConfig} = this;
12961
+ 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);
13102
12962
  this.visible = !this.target.locked;
13103
12963
  this.set({
13104
12964
  x: x,
@@ -13121,9 +12981,9 @@ var LeaferUI = function(exports) {
13121
12981
  if (this.app) this.rect.syncEventer = this.app.interaction.bottomList = null;
13122
12982
  }
13123
12983
  updateBounds(bounds) {
13124
- const {editor: editor, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
12984
+ const {editor: editor, mergedConfig: mergedConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
13125
12985
  const {editMask: editMask} = editor;
13126
- const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergeConfig;
12986
+ const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergedConfig;
13127
12987
  editMask.visible = mask ? true : 0;
13128
12988
  if (!isUndefined(dimOthers) || !isUndefined(bright)) {
13129
12989
  editor.setDimOthers(dimOthers);
@@ -13161,7 +13021,7 @@ var LeaferUI = function(exports) {
13161
13021
  }
13162
13022
  }
13163
13023
  }
13164
- circle.visible = showPoints && rotateable && !!(mergeConfig.circle || mergeConfig.rotatePoint);
13024
+ circle.visible = showPoints && rotateable && !!(mergedConfig.circle || mergedConfig.rotatePoint);
13165
13025
  if (circle.visible) this.layoutCircle();
13166
13026
  if (rect.path) rect.path = null;
13167
13027
  rect.set(Object.assign(Object.assign({}, bounds), {
@@ -13269,7 +13129,8 @@ var LeaferUI = function(exports) {
13269
13129
  this.dragPoint = null;
13270
13130
  }
13271
13131
  onTransformStart(e) {
13272
- if (this.moving || this.gesturing) this.editor.opacity = this.mergedConfig.hideOnMove ? 0 : 1;
13132
+ const {hideOnMove: hideOnMove, editBoxType: editBoxType} = this.mergedConfig;
13133
+ if (this.moving || this.gesturing) this.editor.opacity = hideOnMove ? 0 : 1;
13273
13134
  if (this.resizing) ResizeEvent.resizingKeys = this.editor.leafList.keys;
13274
13135
  const {dragStartData: dragStartData, target: target} = this;
13275
13136
  dragStartData.x = e.x;
@@ -13279,7 +13140,7 @@ var LeaferUI = function(exports) {
13279
13140
  x: target.x,
13280
13141
  y: target.y
13281
13142
  };
13282
- dragStartData.bounds = Object.assign({}, target.getLayoutBounds("box", "local"));
13143
+ dragStartData.bounds = Object.assign({}, target.getLayoutBounds(editBoxType, "local"));
13283
13144
  dragStartData.rotation = target.rotation;
13284
13145
  }
13285
13146
  onTransformEnd(e) {
@@ -13510,6 +13371,7 @@ var LeaferUI = function(exports) {
13510
13371
  },
13511
13372
  selector: true,
13512
13373
  editBox: true,
13374
+ editBoxType: "box",
13513
13375
  hover: true,
13514
13376
  select: "press",
13515
13377
  openInner: "double",
@@ -13792,7 +13654,7 @@ var LeaferUI = function(exports) {
13792
13654
  }
13793
13655
  onScale(e) {
13794
13656
  const {target: target, mergeConfig: mergeConfig, single: single, dragStartData: dragStartData} = this.editBox;
13795
- let {around: around, lockRatio: lockRatio, flipable: flipable, editSize: editSize} = mergeConfig, totalMove;
13657
+ let {around: around, lockRatio: lockRatio, flipable: flipable, editSize: editSize, editBoxType: editBoxType} = mergeConfig, totalMove;
13796
13658
  if (e instanceof exports.ZoomEvent) {
13797
13659
  if (!around) around = target.getBoxPoint(e);
13798
13660
  totalMove = e.totalScale;
@@ -13801,7 +13663,7 @@ var LeaferUI = function(exports) {
13801
13663
  }
13802
13664
  const {direction: direction} = e.current;
13803
13665
  if (e.shiftKey || target.lockRatio) lockRatio = true;
13804
- const data = EditDataHelper.getScaleData(target, dragStartData.bounds, direction, totalMove, lockRatio, EditDataHelper.getAround(around, e.altKey), flipable, !single || editSize === "scale");
13666
+ const data = EditDataHelper.getScaleData(target, dragStartData.bounds, direction, totalMove, lockRatio, EditDataHelper.getAround(around, e.altKey), flipable, !single || editSize === "scale", editBoxType);
13805
13667
  const targetX = target.x, targetY = target.y;
13806
13668
  if (e instanceof exports.DragEvent && this.editTool && this.editTool.onScaleWithDrag) {
13807
13669
  data.drag = e;
@@ -13813,7 +13675,7 @@ var LeaferUI = function(exports) {
13813
13675
  }
13814
13676
  onRotate(e) {
13815
13677
  const {target: target, mergeConfig: mergeConfig, dragStartData: dragStartData} = this.editBox;
13816
- const {around: around, rotateAround: rotateAround, rotateGap: rotateGap, diagonalRotateKey: diagonalRotateKey} = mergeConfig;
13678
+ const {around: around, rotateAround: rotateAround, rotateGap: rotateGap, diagonalRotateKey: diagonalRotateKey, editBoxType: editBoxType} = mergeConfig;
13817
13679
  const {direction: direction} = e.current;
13818
13680
  let origin, rotation;
13819
13681
  if (e instanceof exports.RotateEvent) {
@@ -13821,7 +13683,7 @@ var LeaferUI = function(exports) {
13821
13683
  origin = rotateAround ? AroundHelper.getPoint(rotateAround, target.boxBounds) : target.getBoxPoint(e);
13822
13684
  } else {
13823
13685
  const isDiagonalRotate = diagonalRotateKey ? e.isHoldKeys(diagonalRotateKey) : e.shiftKey;
13824
- const data = EditDataHelper.getRotateData(target, direction, e, dragStartData, isDiagonalRotate ? null : rotateAround || target.around || target.origin || around || "center");
13686
+ const data = EditDataHelper.getRotateData(target, direction, e, dragStartData, isDiagonalRotate ? null : rotateAround || target.around || target.origin || around || "center", editBoxType);
13825
13687
  rotation = dragStartData.rotation + data.rotation - target.rotation;
13826
13688
  origin = data.origin;
13827
13689
  }
@@ -13833,8 +13695,8 @@ var LeaferUI = function(exports) {
13833
13695
  }
13834
13696
  onSkew(e) {
13835
13697
  const {target: target, mergeConfig: mergeConfig} = this.editBox;
13836
- const {around: around} = mergeConfig;
13837
- const {origin: origin, skewX: skewX, skewY: skewY} = EditDataHelper.getSkewData(target.boxBounds, e.current.direction, e.getInnerMove(target), EditDataHelper.getAround(around, e.altKey));
13698
+ const {around: around, editBoxType: editBoxType} = mergeConfig;
13699
+ const {origin: origin, skewX: skewX, skewY: skewY} = EditDataHelper.getSkewData(target, e.current.direction, e.getInnerMove(target), EditDataHelper.getAround(around, e.altKey), editBoxType);
13838
13700
  if (!skewX && !skewY) return;
13839
13701
  this.skewOf(origin, skewX, skewY);
13840
13702
  }
@@ -13895,7 +13757,7 @@ var LeaferUI = function(exports) {
13895
13757
  scaleOf(origin, scaleX, scaleY = scaleX, _resize) {
13896
13758
  if (!this.checkTransform("resizeable")) return;
13897
13759
  const {target: target, mergeConfig: mergeConfig, single: single, editor: editor} = this.editBox;
13898
- const {beforeScale: beforeScale} = mergeConfig;
13760
+ const {beforeScale: beforeScale, editBoxType: editBoxType} = mergeConfig;
13899
13761
  if (beforeScale) {
13900
13762
  const check = beforeScale({
13901
13763
  target: target,
@@ -13913,7 +13775,8 @@ var LeaferUI = function(exports) {
13913
13775
  worldOrigin: worldOrigin,
13914
13776
  scaleX: scaleX,
13915
13777
  scaleY: scaleY,
13916
- transform: transform
13778
+ transform: transform,
13779
+ editBoxType: editBoxType
13917
13780
  };
13918
13781
  this.emitEvent(new EditorScaleEvent(EditorScaleEvent.BEFORE_SCALE, data));
13919
13782
  const event = new EditorScaleEvent(EditorScaleEvent.SCALE, data);
@@ -13941,7 +13804,7 @@ var LeaferUI = function(exports) {
13941
13804
  rotateOf(origin, rotation) {
13942
13805
  if (!this.checkTransform("rotateable")) return;
13943
13806
  const {target: target, mergeConfig: mergeConfig, single: single, editor: editor} = this.editBox;
13944
- const {beforeRotate: beforeRotate} = mergeConfig;
13807
+ const {beforeRotate: beforeRotate, editBoxType: editBoxType} = mergeConfig;
13945
13808
  if (beforeRotate) {
13946
13809
  const check = beforeRotate({
13947
13810
  target: target,
@@ -13957,7 +13820,8 @@ var LeaferUI = function(exports) {
13957
13820
  editor: editor,
13958
13821
  worldOrigin: worldOrigin,
13959
13822
  rotation: rotation,
13960
- transform: transform
13823
+ transform: transform,
13824
+ editBoxType: editBoxType
13961
13825
  };
13962
13826
  this.emitEvent(new EditorRotateEvent(EditorRotateEvent.BEFORE_ROTATE, data));
13963
13827
  const event = new EditorRotateEvent(EditorRotateEvent.ROTATE, data);
@@ -13967,7 +13831,7 @@ var LeaferUI = function(exports) {
13967
13831
  skewOf(origin, skewX, skewY = 0, _resize) {
13968
13832
  if (!this.checkTransform("skewable")) return;
13969
13833
  const {target: target, mergeConfig: mergeConfig, single: single, editor: editor} = this.editBox;
13970
- const {beforeSkew: beforeSkew} = mergeConfig;
13834
+ const {beforeSkew: beforeSkew, editBoxType: editBoxType} = mergeConfig;
13971
13835
  if (beforeSkew) {
13972
13836
  const check = beforeSkew({
13973
13837
  target: target,
@@ -13985,7 +13849,8 @@ var LeaferUI = function(exports) {
13985
13849
  worldOrigin: worldOrigin,
13986
13850
  skewX: skewX,
13987
13851
  skewY: skewY,
13988
- transform: transform
13852
+ transform: transform,
13853
+ editBoxType: editBoxType
13989
13854
  };
13990
13855
  this.emitEvent(new EditorSkewEvent(EditorSkewEvent.BEFORE_SKEW, data));
13991
13856
  const event = new EditorSkewEvent(EditorSkewEvent.SKEW, data);
@@ -14427,32 +14292,32 @@ var LeaferUI = function(exports) {
14427
14292
  app.unlockLayout();
14428
14293
  }
14429
14294
  onScale(e) {
14430
- const {scaleX: scaleX, scaleY: scaleY, transform: transform, worldOrigin: worldOrigin, editor: editor} = e;
14295
+ const {scaleX: scaleX, scaleY: scaleY, transform: transform, worldOrigin: worldOrigin, editor: editor, editBoxType: editBoxType} = e;
14431
14296
  const {app: app, list: list} = editor;
14432
14297
  app.lockLayout();
14433
14298
  list.forEach(target => {
14434
14299
  const resize = editor.getEditSize(target) !== "scale";
14435
- if (transform) target.transformWorld(transform, resize); else target.scaleOfWorld(worldOrigin, scaleX, scaleY, resize);
14300
+ if (transform) target.transformWorld(transform, resize, false, editBoxType); else target.scaleOfWorld(worldOrigin, scaleX, scaleY, resize, false, editBoxType);
14436
14301
  });
14437
14302
  app.unlockLayout();
14438
14303
  }
14439
14304
  onRotate(e) {
14440
- const {rotation: rotation, transform: transform, worldOrigin: worldOrigin, editor: editor} = e;
14305
+ const {rotation: rotation, transform: transform, worldOrigin: worldOrigin, editor: editor, editBoxType: editBoxType} = e;
14441
14306
  const {app: app, list: list} = editor;
14442
14307
  app.lockLayout();
14443
14308
  list.forEach(target => {
14444
14309
  const resize = editor.getEditSize(target) !== "scale";
14445
- if (transform) target.transformWorld(transform, resize); else target.rotateOfWorld(worldOrigin, rotation);
14310
+ if (transform) target.transformWorld(transform, resize, false, editBoxType); else target.rotateOfWorld(worldOrigin, rotation);
14446
14311
  });
14447
14312
  app.unlockLayout();
14448
14313
  }
14449
14314
  onSkew(e) {
14450
- const {skewX: skewX, skewY: skewY, transform: transform, worldOrigin: worldOrigin, editor: editor} = e;
14315
+ const {skewX: skewX, skewY: skewY, transform: transform, worldOrigin: worldOrigin, editor: editor, editBoxType: editBoxType} = e;
14451
14316
  const {app: app, list: list} = editor;
14452
14317
  app.lockLayout();
14453
14318
  list.forEach(target => {
14454
14319
  const resize = editor.getEditSize(target) !== "scale";
14455
- if (transform) target.transformWorld(transform, resize); else target.skewOfWorld(worldOrigin, skewX, skewY, resize);
14320
+ if (transform) target.transformWorld(transform, resize, false, editBoxType); else target.skewOfWorld(worldOrigin, skewX, skewY, resize);
14456
14321
  });
14457
14322
  app.unlockLayout();
14458
14323
  }
@@ -14733,15 +14598,26 @@ var LeaferUI = function(exports) {
14733
14598
  children[i].transform(matrix, true);
14734
14599
  }
14735
14600
  }
14736
- const leaf = exports.Leaf.prototype;
14737
- leaf.scaleResize = function(scaleX, scaleY = scaleX, noResize) {
14601
+ const leaf = exports.Leaf.prototype, tempPoint$1 = {}, {scale: scale$2, toOuterPoint: toOuterPoint} = MatrixHelper;
14602
+ leaf.scaleResize = function(scaleX, scaleY = scaleX, noResize, boundsType) {
14738
14603
  const data = this;
14739
14604
  if (noResize || data.editConfig && data.editConfig.editSize === "scale") {
14740
14605
  data.scaleX *= scaleX;
14741
14606
  data.scaleY *= scaleY;
14742
14607
  } else {
14743
- if (scaleX < 0) data.scaleX *= -1, scaleX = -scaleX;
14744
- if (scaleY < 0) data.scaleY *= -1, scaleY = -scaleY;
14608
+ const local = this.__localMatrix;
14609
+ if (scaleX < 0) data.scaleX *= -1, scaleX = -scaleX, scale$2(local, -1, 1);
14610
+ if (scaleY < 0) data.scaleY *= -1, scaleY = -scaleY, scale$2(local, 1, -1);
14611
+ if (boundsType === "stroke") {
14612
+ const {boxBounds: boxBounds, strokeBounds: strokeBounds} = this.__layout, {x: x, y: y, width: width, height: height} = strokeBounds;
14613
+ tempPoint$1.x = (x - boxBounds.x) * (scaleX - 1);
14614
+ tempPoint$1.y = (y - boxBounds.y) * (scaleY - 1);
14615
+ toOuterPoint(local, tempPoint$1, tempPoint$1, true);
14616
+ this.x += tempPoint$1.x;
14617
+ this.y += tempPoint$1.y;
14618
+ scaleX = (width * scaleX - (width - boxBounds.width)) / boxBounds.width;
14619
+ scaleY = (height * scaleY - (height - boxBounds.height)) / boxBounds.height;
14620
+ }
14745
14621
  this.__scaleResize(scaleX, scaleY);
14746
14622
  }
14747
14623
  };
@@ -14807,7 +14683,8 @@ var LeaferUI = function(exports) {
14807
14683
  exports.UI.addAttr("editConfig", undefined, dataType);
14808
14684
  exports.UI.addAttr("editOuter", ui => {
14809
14685
  ui.updateLayout();
14810
- return ui.__.__isLinePath ? "LineEditTool" : "EditTool";
14686
+ const name = (ui.tag === "Line" ? "" : ui.tag) + "EditTool";
14687
+ return ui.__.__isLinePath ? "LineEditTool" : EditToolCreator.list[name] ? name : "EditTool";
14811
14688
  }, dataType);
14812
14689
  exports.UI.addAttr("editInner", "PathEditor", dataType);
14813
14690
  exports.Group.addAttr("editInner", "", dataType);
@@ -15077,8 +14954,9 @@ var LeaferUI = function(exports) {
15077
14954
  addViewportConfig(leafer.parentApp ? leafer.parentApp : leafer, mergeConfig);
15078
14955
  if (leafer.isApp || custom) return;
15079
14956
  leafer.__eventIds.push(leafer.on_(exports.MoveEvent.BEFORE_MOVE, e => {
15080
- const move = leafer.getValidMove(e.moveX, e.moveY, false);
15081
- if (getScrollType(leafer).includes("limit")) {
14957
+ const limit = getScrollType(leafer).includes("limit"), stopLimit = leafer.app.config.move.scrollLimit === "stop";
14958
+ const move = leafer.getValidMove(e.moveX, e.moveY, limit && stopLimit);
14959
+ if (limit && !stopLimit) {
15082
14960
  const testMove = leafer.getValidMove(0, 0);
15083
14961
  if (testMove.x || testMove.y) {
15084
14962
  const maxX = 100, maxY = 200, resistance = e.moveType === "drag" ? .3 : .05;
@@ -19316,7 +19194,7 @@ var LeaferUI = function(exports) {
19316
19194
  Plugin.add("scale-fixed");
19317
19195
  exports.UI.addAttr("scaleFixed", undefined, scaleFixedType);
19318
19196
  class EllipseBoxData extends BoxData {}
19319
- const ellipse$1 = exports.Ellipse.prototype;
19197
+ const ellipse = exports.Ellipse.prototype;
19320
19198
  exports.EllipseBox = class EllipseBox extends exports.Box {
19321
19199
  get __tag() {
19322
19200
  return "EllipseBox";
@@ -19327,7 +19205,7 @@ var LeaferUI = function(exports) {
19327
19205
  __decorate([ pathType(0) ], exports.EllipseBox.prototype, "innerRadius", void 0);
19328
19206
  __decorate([ pathType(0) ], exports.EllipseBox.prototype, "startAngle", void 0);
19329
19207
  __decorate([ pathType(0) ], exports.EllipseBox.prototype, "endAngle", void 0);
19330
- __decorate([ rewrite(ellipse$1.__updatePath) ], exports.EllipseBox.prototype, "__updatePath", null);
19208
+ __decorate([ rewrite(ellipse.__updatePath) ], exports.EllipseBox.prototype, "__updatePath", null);
19331
19209
  exports.EllipseBox = __decorate([ rewriteAble(), registerUI() ], exports.EllipseBox);
19332
19210
  class PolygonBoxData extends BoxData {
19333
19211
  get __usePathBox() {
@@ -19348,7 +19226,7 @@ var LeaferUI = function(exports) {
19348
19226
  __decorate([ rewrite(polygon.__updatePath) ], exports.PolygonBox.prototype, "__updatePath", null);
19349
19227
  exports.PolygonBox = __decorate([ rewriteAble(), registerUI() ], exports.PolygonBox);
19350
19228
  class StarBoxData extends BoxData {}
19351
- const ellipse = exports.Star.prototype;
19229
+ const star = exports.Star.prototype;
19352
19230
  exports.StarBox = class StarBox extends exports.Box {
19353
19231
  get __tag() {
19354
19232
  return "StarBox";
@@ -19358,7 +19236,7 @@ var LeaferUI = function(exports) {
19358
19236
  __decorate([ pathType(5) ], exports.StarBox.prototype, "corners", void 0);
19359
19237
  __decorate([ pathType(.382) ], exports.StarBox.prototype, "innerRadius", void 0);
19360
19238
  __decorate([ dataProcessor(StarBoxData) ], exports.StarBox.prototype, "__", void 0);
19361
- __decorate([ rewrite(ellipse.__updatePath) ], exports.StarBox.prototype, "__updatePath", null);
19239
+ __decorate([ rewrite(star.__updatePath) ], exports.StarBox.prototype, "__updatePath", null);
19362
19240
  exports.StarBox = __decorate([ rewriteAble(), registerUI() ], exports.StarBox);
19363
19241
  class PathBoxData extends BoxData {}
19364
19242
  exports.PathBox = class PathBox extends exports.Box {
@@ -19927,7 +19805,7 @@ var LeaferUI = function(exports) {
19927
19805
  exports.surfaceType = surfaceType;
19928
19806
  exports.tempBounds = tempBounds$3;
19929
19807
  exports.tempMatrix = tempMatrix$2;
19930
- exports.tempPoint = tempPoint$4;
19808
+ exports.tempPoint = tempPoint$5;
19931
19809
  exports.tryToNumber = tryToNumber;
19932
19810
  exports.useCanvas = useCanvas;
19933
19811
  exports.useModule = useModule;