@leafer/miniapp 2.0.2 → 2.0.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.
@@ -213,6 +213,7 @@ class LeafData {
213
213
  }
214
214
  destroy() {
215
215
  this.__input = this.__middle = null;
216
+ if (this.__complexData) this.__complexData.destroy();
216
217
  }
217
218
  }
218
219
 
@@ -311,6 +312,8 @@ const {set: set$2, get: get$5, setTemp: setTemp, toTempAB: toTempAB} = FourNumbe
311
312
 
312
313
  const {round: round$6, pow: pow$2, max: max$6, floor: floor$3, PI: PI$4} = Math;
313
314
 
315
+ const tempScaleData$1 = {};
316
+
314
317
  const MathHelper = {
315
318
  within(value, min, max) {
316
319
  if (isObject(min)) max = min.max, min = min.min;
@@ -354,6 +357,24 @@ const MathHelper = {
354
357
  } else if (scale) MathHelper.assignScale(scaleData, scale);
355
358
  return scaleData;
356
359
  },
360
+ getScaleFixedData(worldScaleData, scaleFixed, unscale, abs, _localScaleData) {
361
+ let {scaleX: scaleX, scaleY: scaleY} = worldScaleData;
362
+ if (abs || scaleFixed) scaleX < 0 && (scaleX = -scaleX), scaleY < 0 && (scaleY = -scaleY);
363
+ if (scaleFixed) {
364
+ if (scaleFixed === true) {
365
+ scaleX = scaleY = unscale ? 1 : 1 / scaleX;
366
+ } else {
367
+ let minScale;
368
+ if (isNumber(scaleFixed)) minScale = scaleFixed; else if (scaleFixed === "zoom-in") minScale = 1;
369
+ if (minScale) {
370
+ if (scaleX > minScale || scaleY > minScale) scaleX = scaleY = unscale ? 1 : 1 / scaleX; else scaleX = scaleY = unscale ? 1 : 1 / minScale;
371
+ }
372
+ }
373
+ }
374
+ tempScaleData$1.scaleX = scaleX;
375
+ tempScaleData$1.scaleY = scaleY;
376
+ return tempScaleData$1;
377
+ },
357
378
  assignScale(scaleData, scale) {
358
379
  if (isNumber(scale)) {
359
380
  scaleData.scaleX = scaleData.scaleY = scale;
@@ -850,8 +871,8 @@ const PointHelper = {
850
871
  if (isObject(originPoints[0])) points = [], originPoints.forEach(p => points.push(p.x, p.y));
851
872
  return points;
852
873
  },
853
- isSame(t, point) {
854
- return float$5(t.x) === float$5(point.x) && float$5(t.y) === float$5(point.y);
874
+ isSame(t, point, quick) {
875
+ 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);
855
876
  },
856
877
  reset(t) {
857
878
  P$7.reset(t);
@@ -926,8 +947,8 @@ class Point {
926
947
  getAtan2(to) {
927
948
  return PointHelper.getAtan2(this, to);
928
949
  }
929
- isSame(point) {
930
- return PointHelper.isSame(this, point);
950
+ isSame(point, quick) {
951
+ return PointHelper.isSame(this, point, quick);
931
952
  }
932
953
  reset() {
933
954
  PointHelper.reset(this);
@@ -1183,9 +1204,9 @@ const AroundHelper = {
1183
1204
  }
1184
1205
  if (!onlyBoxSize) to.x += box.x, to.y += box.y;
1185
1206
  },
1186
- getPoint(around, box, to) {
1207
+ getPoint(around, box, to, onlyBoxSize = true) {
1187
1208
  if (!to) to = {};
1188
- AroundHelper.toPoint(around, box, to, true);
1209
+ AroundHelper.toPoint(around, box, to, onlyBoxSize);
1189
1210
  return to;
1190
1211
  }
1191
1212
  };
@@ -1452,6 +1473,9 @@ const BoundsHelper = {
1452
1473
  y: y + height
1453
1474
  } ];
1454
1475
  },
1476
+ getPoint(t, around, onlyBoxSize = false, to) {
1477
+ return AroundHelper.getPoint(around, t, to, onlyBoxSize);
1478
+ },
1455
1479
  hitRadiusPoint(t, point, pointMatrix) {
1456
1480
  if (pointMatrix) point = PointHelper.tempToInnerRadiusPointOf(point, pointMatrix);
1457
1481
  return point.x >= t.x - point.radiusX && point.x <= t.x + t.width + point.radiusX && (point.y >= t.y - point.radiusY && point.y <= t.y + t.height + point.radiusY);
@@ -1623,6 +1647,9 @@ class Bounds {
1623
1647
  getPoints() {
1624
1648
  return BoundsHelper.getPoints(this);
1625
1649
  }
1650
+ getPoint(around, onlyBoxSize, to) {
1651
+ return BoundsHelper.getPoint(this, around, onlyBoxSize, to);
1652
+ }
1626
1653
  hitPoint(point, pointMatrix) {
1627
1654
  return BoundsHelper.hitPoint(this, point, pointMatrix);
1628
1655
  }
@@ -2767,10 +2794,10 @@ const BezierHelper = {
2767
2794
  const centerY = y1 + c * sin$4(startRadian + totalRadian / 2 + PI_2 * sign);
2768
2795
  startRadian -= PI_2 * sign;
2769
2796
  endRadian -= PI_2 * sign;
2770
- return ellipse$6(data, centerX, centerY, radius, radius, 0, startRadian / OneRadian, endRadian / OneRadian, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2797
+ return ellipse$8(data, centerX, centerY, radius, radius, 0, startRadian / OneRadian, endRadian / OneRadian, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2771
2798
  },
2772
2799
  arc(data, x, y, radius, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint) {
2773
- return ellipse$6(data, x, y, radius, radius, 0, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2800
+ return ellipse$8(data, x, y, radius, radius, 0, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2774
2801
  },
2775
2802
  ellipse(data, cx, cy, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint) {
2776
2803
  const rotationRadian = rotation * OneRadian;
@@ -2872,11 +2899,11 @@ const BezierHelper = {
2872
2899
  }
2873
2900
  };
2874
2901
 
2875
- const {getPointAndSet: getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$6} = BezierHelper;
2902
+ const {getPointAndSet: getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$8} = BezierHelper;
2876
2903
 
2877
2904
  const {sin: sin$3, cos: cos$3, sqrt: sqrt$2, atan2: atan2} = Math;
2878
2905
 
2879
- const {ellipse: ellipse$5} = BezierHelper;
2906
+ const {ellipse: ellipse$7} = BezierHelper;
2880
2907
 
2881
2908
  const EllipseHelper = {
2882
2909
  ellipticalArc(data, fromX, fromY, radiusX, radiusY, rotation, largeFlag, sweepFlag, toX, toY, curveMode) {
@@ -2914,7 +2941,7 @@ const EllipseHelper = {
2914
2941
  const centerY = fromY + halfY + rotationSin * cx + rotationCos * cy;
2915
2942
  const anticlockwise = totalRadian < 0 ? 1 : 0;
2916
2943
  if (curveMode || Platform.ellipseToCurve) {
2917
- ellipse$5(data, centerX, centerY, radiusX, radiusY, rotation, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
2944
+ ellipse$7(data, centerX, centerY, radiusX, radiusY, rotation, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
2918
2945
  } else {
2919
2946
  if (radiusX === radiusY && !rotation) {
2920
2947
  data.push(PathCommandMap.O, centerX, centerY, radiusX, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
@@ -2936,7 +2963,7 @@ const PathCommandNodeHelper = {
2936
2963
 
2937
2964
  const {M: M$9, m: m, L: L$9, l: l, H: H, h: h, V: V, v: v, C: C$7, c: c, S: S$1, s: s, Q: Q$6, q: q, T: T, t: t, A: A, a: a, Z: Z$7, 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;
2938
2965
 
2939
- const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
2966
+ const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$6, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
2940
2967
 
2941
2968
  const {ellipticalArc: ellipticalArc} = EllipseHelper;
2942
2969
 
@@ -3169,14 +3196,14 @@ const PathConvert = {
3169
3196
  break;
3170
3197
 
3171
3198
  case G$5:
3172
- ellipse$4(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);
3199
+ 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);
3173
3200
  x = setEndPoint$1.x;
3174
3201
  y = setEndPoint$1.y;
3175
3202
  i += 9;
3176
3203
  break;
3177
3204
 
3178
3205
  case F$6:
3179
- curveMode ? ellipse$4(data, old[i + 1], old[i + 2], old[i + 3], old[i + 4], 0, 0, 360, false) : copyData(data, old, i, 5);
3206
+ 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);
3180
3207
  x = old[i + 1] + old[i + 3];
3181
3208
  y = old[i + 2];
3182
3209
  i += 5;
@@ -3330,7 +3357,7 @@ const PathCommandDataHelper = {
3330
3357
  drawEllipse(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
3331
3358
  BezierHelper.ellipse(null, x, y, radiusX, radiusY, isNull(rotation) ? 0 : rotation, isNull(startAngle) ? 0 : startAngle, isNull(endAngle) ? 360 : endAngle, anticlockwise, null, null, startPoint);
3332
3359
  data.push(M$8, startPoint.x, startPoint.y);
3333
- ellipse$3(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3360
+ ellipse$5(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3334
3361
  },
3335
3362
  drawArc(data, x, y, radius, startAngle, endAngle, anticlockwise) {
3336
3363
  BezierHelper.arc(null, x, y, radius, isNull(startAngle) ? 0 : startAngle, isNull(endAngle) ? 360 : endAngle, anticlockwise, null, null, startPoint);
@@ -3342,9 +3369,9 @@ const PathCommandDataHelper = {
3342
3369
  }
3343
3370
  };
3344
3371
 
3345
- const {ellipse: ellipse$3, arc: arc$2} = PathCommandDataHelper;
3372
+ const {ellipse: ellipse$5, arc: arc$2} = PathCommandDataHelper;
3346
3373
 
3347
- const {moveTo: moveTo$4, lineTo: lineTo$3, quadraticCurveTo: quadraticCurveTo, bezierCurveTo: bezierCurveTo, closePath: closePath$3, beginPath: beginPath, rect: rect$2, roundRect: roundRect$1, ellipse: ellipse$2, arc: arc$1, arcTo: arcTo$2, drawEllipse: drawEllipse, drawArc: drawArc, drawPoints: drawPoints$2} = PathCommandDataHelper;
3374
+ 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$2, drawEllipse: drawEllipse, drawArc: drawArc, drawPoints: drawPoints$2} = PathCommandDataHelper;
3348
3375
 
3349
3376
  class PathCreator {
3350
3377
  set path(value) {
@@ -3401,7 +3428,7 @@ class PathCreator {
3401
3428
  return this;
3402
3429
  }
3403
3430
  ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
3404
- ellipse$2(this.__path, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3431
+ ellipse$4(this.__path, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3405
3432
  this.paint();
3406
3433
  return this;
3407
3434
  }
@@ -3523,7 +3550,7 @@ const PathDrawer = {
3523
3550
 
3524
3551
  const {M: M$6, L: L$6, C: C$4, Q: Q$3, Z: Z$4, 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;
3525
3552
 
3526
- const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc: arc, ellipse: ellipse$1} = BezierHelper;
3553
+ const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc: arc, ellipse: ellipse$3} = BezierHelper;
3527
3554
 
3528
3555
  const {addPointBounds: addPointBounds, copy: copy$9, addPoint: addPoint$1, setPoint: setPoint$3, addBounds: addBounds, toBounds: toBounds$2} = TwoPointBoundsHelper;
3529
3556
 
@@ -3606,7 +3633,7 @@ const PathBounds = {
3606
3633
  break;
3607
3634
 
3608
3635
  case G$2:
3609
- ellipse$1(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);
3636
+ 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);
3610
3637
  i === 0 ? copy$9(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
3611
3638
  x = setEndPoint.x;
3612
3639
  y = setEndPoint.y;
@@ -4102,6 +4129,7 @@ const ImageManager = {
4102
4129
  return image;
4103
4130
  },
4104
4131
  recycle(image) {
4132
+ if (image.parent) image = image.parent;
4105
4133
  image.use--;
4106
4134
  setTimeout(() => {
4107
4135
  if (!image.use) {
@@ -4270,8 +4298,10 @@ class LeaferImage {
4270
4298
  return undefined;
4271
4299
  }
4272
4300
  clearLevels(_checkUse) {}
4301
+ destroyFilter() {}
4273
4302
  destroy() {
4274
4303
  this.clearLevels();
4304
+ this.destroyFilter();
4275
4305
  const {view: view} = this;
4276
4306
  if (view && view.close) view.close();
4277
4307
  this.config = {
@@ -4468,7 +4498,6 @@ function dimType(defaultValue) {
4468
4498
  if (this.__setAttr(key, value)) {
4469
4499
  const data = this.__;
4470
4500
  DataHelper.stintSet(data, "__useDim", data.dim || data.bright || data.dimskip);
4471
- this.__layout.surfaceChange();
4472
4501
  }
4473
4502
  }
4474
4503
  }));
@@ -4518,7 +4547,6 @@ function sortType(defaultValue) {
4518
4547
  return decorateLeafAttr(defaultValue, key => attr({
4519
4548
  set(value) {
4520
4549
  if (this.__setAttr(key, value)) {
4521
- this.__layout.surfaceChange();
4522
4550
  this.waitParent(() => {
4523
4551
  this.parent.__layout.childrenSortChange();
4524
4552
  });
@@ -4555,7 +4583,6 @@ function hitType(defaultValue) {
4555
4583
  set(value) {
4556
4584
  if (this.__setAttr(key, value)) {
4557
4585
  this.__layout.hitCanvasChanged = true;
4558
- if (Debug.showBounds === "hit") this.__layout.surfaceChange();
4559
4586
  if (this.leafer) this.leafer.updateCursor();
4560
4587
  }
4561
4588
  }
@@ -4761,6 +4788,10 @@ const LeafHelper = {
4761
4788
  if (layout.stateStyleChanged) leaf.updateState();
4762
4789
  if (layout.opacityChanged) updateAllWorldOpacity(leaf);
4763
4790
  leaf.__updateChange();
4791
+ if (layout.surfaceChanged) {
4792
+ if (leaf.__hasComplex) L$4.updateComplex(leaf);
4793
+ layout.surfaceChanged = false;
4794
+ }
4764
4795
  },
4765
4796
  updateAllChange(leaf) {
4766
4797
  updateChange$1(leaf);
@@ -4785,6 +4816,9 @@ const LeafHelper = {
4785
4816
  if (!fromWorld) fromWorld = leaf.__nowWorld;
4786
4817
  if (leaf.__worldFlipped || Platform.fullImageShadow) currentCanvas.copyWorldByReset(fromCanvas, fromWorld, leaf.__nowWorld, blendMode, onlyResetTransform); else currentCanvas.copyWorldToInner(fromCanvas, fromWorld, leaf.__layout.renderBounds, blendMode);
4787
4818
  },
4819
+ renderComplex(_leaf, _canvas, _options) {},
4820
+ updateComplex(_leaf) {},
4821
+ checkComplex(_leaf) {},
4788
4822
  moveWorld(t, x, y = 0, isInnerPoint, transition) {
4789
4823
  const local = isObject(x) ? Object.assign({}, x) : {
4790
4824
  x: x,
@@ -4896,6 +4930,9 @@ const LeafHelper = {
4896
4930
  divideParent(matrix$3, relative.scrollWorldTransform);
4897
4931
  return temp ? matrix$3 : Object.assign({}, matrix$3);
4898
4932
  },
4933
+ updateScaleFixedWorld(_t) {},
4934
+ updateOuterBounds(_t) {},
4935
+ cacheId(_t) {},
4899
4936
  drop(t, parent, index, resize) {
4900
4937
  t.setTransform(L$4.getRelativeWorld(t, parent, true), resize);
4901
4938
  parent.add(t, index);
@@ -4946,7 +4983,8 @@ const LeafBoundsHelper = {
4946
4983
  return target.__.eraser || target.__.visible === 0 ? null : target.__layout.localStrokeBounds;
4947
4984
  },
4948
4985
  localRenderBounds(target) {
4949
- return target.__.eraser || target.__.visible === 0 ? null : target.__layout.localRenderBounds;
4986
+ const {__: __, __layout: __layout} = target;
4987
+ return __.eraser || __.visible === 0 ? null : __layout.localOuterBounds || __layout.localRenderBounds;
4950
4988
  },
4951
4989
  maskLocalBoxBounds(target, index) {
4952
4990
  return checkMask(target, index) && target.__localBoxBounds;
@@ -4955,7 +4993,8 @@ const LeafBoundsHelper = {
4955
4993
  return checkMask(target, index) && target.__layout.localStrokeBounds;
4956
4994
  },
4957
4995
  maskLocalRenderBounds(target, index) {
4958
- return checkMask(target, index) && target.__layout.localRenderBounds;
4996
+ const {__layout: __layout} = target;
4997
+ return checkMask(target, index) && (__layout.localOuterBounds || __layout.localRenderBounds);
4959
4998
  },
4960
4999
  excludeRenderBounds(child, options) {
4961
5000
  if (options.bounds && !options.bounds.hit(child.__world, options.matrix)) return true;
@@ -5079,12 +5118,12 @@ const BranchHelper = {
5079
5118
  w.height *= scaleY;
5080
5119
  w.scaleX *= scaleX;
5081
5120
  w.scaleY *= scaleY;
5082
- if (branch.isBranch) scale$2(branch, x, y, scaleX, scaleY, a, b);
5121
+ if (branch.isBranch) scale$3(branch, x, y, scaleX, scaleY, a, b);
5083
5122
  }
5084
5123
  }
5085
5124
  };
5086
5125
 
5087
- const {pushAllChildBranch: pushAllChildBranch$1, pushAllBranchStack: pushAllBranchStack, updateBoundsByBranchStack: updateBoundsByBranchStack, move: move$9, scale: scale$2} = BranchHelper;
5126
+ const {pushAllChildBranch: pushAllChildBranch$1, pushAllBranchStack: pushAllBranchStack, updateBoundsByBranchStack: updateBoundsByBranchStack, move: move$9, scale: scale$3} = BranchHelper;
5088
5127
 
5089
5128
  const WaitHelper = {
5090
5129
  run(wait) {
@@ -5475,7 +5514,6 @@ class LeafLayout {
5475
5514
  }
5476
5515
  opacityChange() {
5477
5516
  this.opacityChanged = true;
5478
- this.surfaceChanged || this.surfaceChange();
5479
5517
  }
5480
5518
  childrenSortChange() {
5481
5519
  if (!this.childrenSortChanged) {
@@ -5582,7 +5620,7 @@ class BoundsEvent extends Event {
5582
5620
  }
5583
5621
  }
5584
5622
  static emitWorld(leaf) {
5585
- if (leaf.leaferIsReady) leaf.emit(WORLD, this);
5623
+ if (leaf.leaferIsReady) leaf.emit(WORLD, leaf);
5586
5624
  }
5587
5625
  }
5588
5626
 
@@ -5968,6 +6006,7 @@ const LeafMatrix = {
5968
6006
  const {parent: parent, __layout: __layout, __world: __world, __scrollWorld: __scrollWorld, __: __} = this;
5969
6007
  multiplyParent$2(this.__local || __layout, parent ? parent.__scrollWorld || parent.__world : defaultWorld, __world, !!__layout.affectScaleOrRotation, __);
5970
6008
  if (__scrollWorld) translateInner(Object.assign(__scrollWorld, __world), __.scrollX, __.scrollY);
6009
+ if (__layout.scaleFixed) LeafHelper.updateScaleFixedWorld(this);
5971
6010
  },
5972
6011
  __updateLocalMatrix() {
5973
6012
  if (this.__local) {
@@ -5993,7 +6032,7 @@ const {updateMatrix: updateMatrix$3, updateAllMatrix: updateAllMatrix$3} = LeafH
5993
6032
 
5994
6033
  const {updateBounds: updateBounds$2} = BranchHelper;
5995
6034
 
5996
- const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$3, copy: copy$6} = BoundsHelper;
6035
+ const {toOuterOf: toOuterOf$2, copyAndSpread: copyAndSpread$4, copy: copy$6} = BoundsHelper;
5997
6036
 
5998
6037
  const {toBounds: toBounds$1} = PathBounds;
5999
6038
 
@@ -6001,6 +6040,7 @@ const LeafBounds = {
6001
6040
  __updateWorldBounds() {
6002
6041
  const {__layout: __layout, __world: __world} = this;
6003
6042
  toOuterOf$2(__layout.renderBounds, __world, __world);
6043
+ if (this.__hasComplex) LeafHelper.checkComplex(this);
6004
6044
  if (__layout.resized) {
6005
6045
  if (__layout.resized === "inner") this.__onUpdateSize();
6006
6046
  if (this.__hasLocalEvent) BoundsEvent.emitLocal(this);
@@ -6050,6 +6090,7 @@ const LeafBounds = {
6050
6090
  layout.renderChanged = undefined;
6051
6091
  if (this.parent) this.parent.__layout.renderChange();
6052
6092
  }
6093
+ if (layout.outerScale) LeafHelper.updateOuterBounds(this);
6053
6094
  layout.resized || (layout.resized = "local");
6054
6095
  layout.boundsChanged = undefined;
6055
6096
  },
@@ -6100,11 +6141,11 @@ const LeafBounds = {
6100
6141
  },
6101
6142
  __updateStrokeBounds(_bounds) {
6102
6143
  const layout = this.__layout;
6103
- copyAndSpread$3(layout.strokeBounds, layout.boxBounds, layout.strokeBoxSpread);
6144
+ copyAndSpread$4(layout.strokeBounds, layout.boxBounds, layout.strokeBoxSpread);
6104
6145
  },
6105
6146
  __updateRenderBounds(_bounds) {
6106
6147
  const layout = this.__layout, {renderSpread: renderSpread} = layout;
6107
- isNumber(renderSpread) && renderSpread <= 0 ? copy$6(layout.renderBounds, layout.strokeBounds) : copyAndSpread$3(layout.renderBounds, layout.boxBounds, renderSpread);
6148
+ isNumber(renderSpread) && renderSpread <= 0 ? copy$6(layout.renderBounds, layout.strokeBounds) : copyAndSpread$4(layout.renderBounds, layout.boxBounds, renderSpread);
6108
6149
  }
6109
6150
  };
6110
6151
 
@@ -6116,7 +6157,7 @@ const LeafRender = {
6116
6157
  const data = this.__;
6117
6158
  if (data.bright && !options.topRendering) return options.topList.add(this);
6118
6159
  canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
6119
- canvas.opacity = options.dimOpacity && !data.dimskip ? data.opacity * options.dimOpacity : data.opacity;
6160
+ canvas.opacity = options.ignoreOpacity ? 1 : options.dimOpacity && !data.dimskip ? data.opacity * options.dimOpacity : data.opacity;
6120
6161
  if (this.__.__single) {
6121
6162
  if (data.eraser === "path") return this.__renderEraser(canvas, options);
6122
6163
  const tempCanvas = canvas.getSameCanvas(true, true);
@@ -6170,7 +6211,7 @@ const BranchRender = {
6170
6211
  if (data.eraser === "path") return this.__renderEraser(canvas, options);
6171
6212
  const tempCanvas = canvas.getSameCanvas(false, true);
6172
6213
  this.__renderBranch(tempCanvas, options);
6173
- canvas.opacity = options.dimOpacity ? data.opacity * options.dimOpacity : data.opacity;
6214
+ canvas.opacity = options.ignoreOpacity ? 1 : options.dimOpacity ? data.opacity * options.dimOpacity : data.opacity;
6174
6215
  canvas.copyWorldByReset(tempCanvas, nowWorld, nowWorld, data.__blendMode, true);
6175
6216
  tempCanvas.recycle(nowWorld);
6176
6217
  } else {
@@ -6186,7 +6227,7 @@ const BranchRender = {
6186
6227
  const {children: children} = this;
6187
6228
  for (let i = 0, len = children.length; i < len; i++) {
6188
6229
  child = children[i];
6189
- excludeRenderBounds$1(child, options) || (child.__.complex ? child.__renderComplex(canvas, options) : child.__render(canvas, options));
6230
+ excludeRenderBounds$1(child, options) || (child.__hasComplex ? LeafHelper.renderComplex(child, canvas, options) : child.__render(canvas, options));
6190
6231
  }
6191
6232
  }
6192
6233
  },
@@ -6200,11 +6241,9 @@ const BranchRender = {
6200
6241
  }
6201
6242
  };
6202
6243
 
6203
- const tempScaleData$1 = {};
6204
-
6205
6244
  const {LEAF: LEAF, create: create} = IncrementId;
6206
6245
 
6207
- const {stintSet: stintSet$4} = DataHelper;
6246
+ const {stintSet: stintSet$6} = DataHelper;
6208
6247
 
6209
6248
  const {toInnerPoint: toInnerPoint, toOuterPoint: toOuterPoint, multiplyParent: multiplyParent$1} = MatrixHelper;
6210
6249
 
@@ -6212,6 +6251,8 @@ const {toOuterOf: toOuterOf$1} = BoundsHelper;
6212
6251
 
6213
6252
  const {copy: copy$5, move: move$8} = PointHelper;
6214
6253
 
6254
+ const {getScaleFixedData: getScaleFixedData$1} = MathHelper;
6255
+
6215
6256
  const {moveLocal: moveLocal, zoomOfLocal: zoomOfLocal, rotateOfLocal: rotateOfLocal, skewOfLocal: skewOfLocal, moveWorld: moveWorld, zoomOfWorld: zoomOfWorld, rotateOfWorld: rotateOfWorld, skewOfWorld: skewOfWorld, transform: transform, transformWorld: transformWorld, setTransform: setTransform, getFlipTransform: getFlipTransform, getLocalOrigin: getLocalOrigin, getRelativeWorld: getRelativeWorld, drop: drop} = LeafHelper;
6216
6257
 
6217
6258
  let Leaf = class Leaf {
@@ -6370,6 +6411,7 @@ let Leaf = class Leaf {
6370
6411
  this.__level = this.parent ? this.parent.__level + 1 : 1;
6371
6412
  if (this.animation) this.__runAnimation("in");
6372
6413
  if (this.__bubbleMap) this.__emitLifeEvent(ChildEvent.MOUNTED);
6414
+ if (leafer.cacheId) LeafHelper.cacheId(this);
6373
6415
  } else {
6374
6416
  this.__emitLifeEvent(ChildEvent.UNMOUNTED);
6375
6417
  }
@@ -6487,8 +6529,8 @@ let Leaf = class Leaf {
6487
6529
  const cameraWorld = this.__cameraWorld, world = this.__world;
6488
6530
  multiplyParent$1(world, options.matrix, cameraWorld, undefined, world);
6489
6531
  toOuterOf$1(this.__layout.renderBounds, cameraWorld, cameraWorld);
6490
- stintSet$4(cameraWorld, "half", world.half);
6491
- stintSet$4(cameraWorld, "ignorePixelSnap", world.ignorePixelSnap);
6532
+ stintSet$6(cameraWorld, "half", world.half);
6533
+ stintSet$6(cameraWorld, "ignorePixelSnap", world.ignorePixelSnap);
6492
6534
  return cameraWorld;
6493
6535
  } else {
6494
6536
  return this.__world;
@@ -6499,13 +6541,8 @@ let Leaf = class Leaf {
6499
6541
  if (scaleX < 0) scaleX = -scaleX;
6500
6542
  return scaleX > 1 ? scaleX : 1;
6501
6543
  }
6502
- getRenderScaleData(abs, scaleFixed) {
6503
- let {scaleX: scaleX, scaleY: scaleY} = ImageManager.patternLocked ? this.__world : this.__nowWorld;
6504
- if (abs) scaleX < 0 && (scaleX = -scaleX), scaleY < 0 && (scaleY = -scaleY);
6505
- if (scaleFixed === true || scaleFixed === "zoom-in" && scaleX > 1 && scaleY > 1) scaleX = scaleY = 1;
6506
- tempScaleData$1.scaleX = scaleX;
6507
- tempScaleData$1.scaleY = scaleY;
6508
- return tempScaleData$1;
6544
+ getRenderScaleData(abs, scaleFixed, unscale = true) {
6545
+ return getScaleFixedData$1(ImageManager.patternLocked ? this.__world : this.__nowWorld || this.__world, scaleFixed, unscale, abs);
6509
6546
  }
6510
6547
  getTransform(relative) {
6511
6548
  return this.__layout.getTransform(relative || "local");
@@ -6544,14 +6581,16 @@ let Leaf = class Leaf {
6544
6581
  relative.innerToWorld(world, to, distance);
6545
6582
  world = to ? to : world;
6546
6583
  }
6547
- toInnerPoint(this.scrollWorldTransform, world, to, distance);
6584
+ toInnerPoint(this.worldTransform, world, to, distance);
6548
6585
  }
6549
6586
  innerToWorld(inner, to, distance, relative) {
6550
- toOuterPoint(this.scrollWorldTransform, inner, to, distance);
6587
+ toOuterPoint(this.worldTransform, inner, to, distance);
6551
6588
  if (relative) relative.worldToInner(to ? to : inner, null, distance);
6552
6589
  }
6553
6590
  getBoxPoint(world, relative, distance, change) {
6554
- return this.getBoxPointByInner(this.getInnerPoint(world, relative, distance, change), null, null, true);
6591
+ const inner = this.getInnerPoint(world, relative, distance, change);
6592
+ if (distance) return inner;
6593
+ return this.getBoxPointByInner(inner, null, null, true);
6555
6594
  }
6556
6595
  getBoxPointByInner(inner, _relative, _distance, change) {
6557
6596
  const point = change ? inner : Object.assign({}, inner), {x: x, y: y} = this.boxBounds;
@@ -6667,7 +6706,6 @@ let Leaf = class Leaf {
6667
6706
  __drawHitPath(_canvas) {}
6668
6707
  __updateHitCanvas() {}
6669
6708
  __render(_canvas, _options) {}
6670
- __renderComplex(_canvas, _options) {}
6671
6709
  __drawFast(_canvas, _options) {}
6672
6710
  __draw(_canvas, _options, _originCanvas) {}
6673
6711
  __clip(_canvas, _options) {}
@@ -6678,7 +6716,7 @@ let Leaf = class Leaf {
6678
6716
  __drawPath(_canvas) {}
6679
6717
  __drawRenderPath(_canvas) {}
6680
6718
  __updatePath() {}
6681
- __updateRenderPath() {}
6719
+ __updateRenderPath(_updateCache) {}
6682
6720
  getMotionPathData() {
6683
6721
  return Plugin.need("path");
6684
6722
  }
@@ -6752,9 +6790,11 @@ let Branch = class Branch extends Leaf {
6752
6790
  return 0;
6753
6791
  }
6754
6792
  __updateRenderSpread() {
6793
+ let layout;
6755
6794
  const {children: children} = this;
6756
6795
  for (let i = 0, len = children.length; i < len; i++) {
6757
- if (children[i].__layout.renderSpread) return 1;
6796
+ layout = children[i].__layout;
6797
+ if (layout.renderSpread || layout.localOuterBounds) return 1;
6758
6798
  }
6759
6799
  return 0;
6760
6800
  }
@@ -7013,7 +7053,7 @@ class LeafLevelList {
7013
7053
  }
7014
7054
  }
7015
7055
 
7016
- const version = "2.0.2";
7056
+ const version = "2.0.4";
7017
7057
 
7018
7058
  class LeaferCanvas extends LeaferCanvasBase {
7019
7059
  get allowBackgroundColor() {
@@ -8006,7 +8046,7 @@ class Selector {
8006
8046
  this.config = {};
8007
8047
  if (userConfig) this.config = DataHelper.default(userConfig, this.config);
8008
8048
  this.picker = new Picker(this.target = target, this);
8009
- this.finder = Creator.finder && Creator.finder();
8049
+ this.finder = Creator.finder && Creator.finder(target, this.config);
8010
8050
  }
8011
8051
  getByPoint(hitPoint, hitRadius, options) {
8012
8052
  const {target: target, picker: picker} = this;
@@ -8048,7 +8088,9 @@ function effectType(defaultValue) {
8048
8088
  set(value) {
8049
8089
  this.__setAttr(key, value);
8050
8090
  if (value) this.__.__useEffect = true;
8051
- this.__layout.renderChanged || this.__layout.renderChange();
8091
+ const layout = this.__layout;
8092
+ layout.renderChanged || layout.renderChange();
8093
+ layout.surfaceChange();
8052
8094
  }
8053
8095
  }));
8054
8096
  }
@@ -8151,7 +8193,7 @@ const Transition = {
8151
8193
 
8152
8194
  const {parse: parse, objectToCanvasData: objectToCanvasData} = PathConvert;
8153
8195
 
8154
- const {stintSet: stintSet$3} = DataHelper, {hasTransparent: hasTransparent$2} = ColorConvert;
8196
+ const {stintSet: stintSet$5} = DataHelper, {hasTransparent: hasTransparent$2} = ColorConvert;
8155
8197
 
8156
8198
  const emptyPaint = {
8157
8199
  originPaint: {}
@@ -8220,7 +8262,7 @@ class UIData extends LeafData {
8220
8262
  setFill(value) {
8221
8263
  if (this.__naturalWidth) this.__removeNaturalSize();
8222
8264
  if (isString(value) || !value) {
8223
- stintSet$3(this, "__isTransparentFill", hasTransparent$2(value));
8265
+ stintSet$5(this, "__isTransparentFill", hasTransparent$2(value));
8224
8266
  this.__isFills && this.__removePaint("fill", true);
8225
8267
  this._fill = value;
8226
8268
  } else if (isObject(value)) {
@@ -8229,7 +8271,7 @@ class UIData extends LeafData {
8229
8271
  }
8230
8272
  setStroke(value) {
8231
8273
  if (isString(value) || !value) {
8232
- stintSet$3(this, "__isTransparentStroke", hasTransparent$2(value));
8274
+ stintSet$5(this, "__isTransparentStroke", hasTransparent$2(value));
8233
8275
  this.__isStrokes && this.__removePaint("stroke", true);
8234
8276
  this._stroke = value;
8235
8277
  } else if (isObject(value)) {
@@ -8262,15 +8304,16 @@ class UIData extends LeafData {
8262
8304
  this.__needComputePaint = undefined;
8263
8305
  }
8264
8306
  __getRealStrokeWidth(childStyle) {
8265
- let {strokeWidth: strokeWidth, strokeWidthFixed: strokeWidthFixed} = this;
8307
+ let {strokeWidth: strokeWidth, strokeScaleFixed: strokeScaleFixed} = this;
8266
8308
  if (childStyle) {
8267
8309
  if (childStyle.strokeWidth) strokeWidth = childStyle.strokeWidth;
8268
- if (!isUndefined(childStyle.strokeWidthFixed)) strokeWidthFixed = childStyle.strokeWidthFixed;
8310
+ if (!isUndefined(childStyle.strokeScaleFixed)) strokeScaleFixed = childStyle.strokeScaleFixed;
8269
8311
  }
8270
- if (strokeWidthFixed) {
8271
- const scale = this.__leaf.getClampRenderScale();
8272
- return scale > 1 ? strokeWidth / scale : strokeWidth;
8273
- } else return strokeWidth;
8312
+ if (strokeScaleFixed) {
8313
+ const {scaleX: scaleX} = this.__leaf.getRenderScaleData(true, strokeScaleFixed, false);
8314
+ if (scaleX !== 1) return strokeWidth * scaleX;
8315
+ }
8316
+ return strokeWidth;
8274
8317
  }
8275
8318
  __setPaint(attrName, value) {
8276
8319
  this.__setInput(attrName, value);
@@ -8287,11 +8330,11 @@ class UIData extends LeafData {
8287
8330
  if (removeInput) this.__removeInput(attrName);
8288
8331
  PaintImage.recycleImage(attrName, this);
8289
8332
  if (attrName === "fill") {
8290
- stintSet$3(this, "__isAlphaPixelFill", undefined);
8333
+ stintSet$5(this, "__isAlphaPixelFill", undefined);
8291
8334
  this._fill = this.__isFills = undefined;
8292
8335
  } else {
8293
- stintSet$3(this, "__isAlphaPixelStroke", undefined);
8294
- stintSet$3(this, "__hasMultiStrokeStyle", undefined);
8336
+ stintSet$5(this, "__isAlphaPixelStroke", undefined);
8337
+ stintSet$5(this, "__hasMultiStrokeStyle", undefined);
8295
8338
  this._stroke = this.__isStrokes = undefined;
8296
8339
  }
8297
8340
  }
@@ -8352,7 +8395,11 @@ class EllipseData extends UIData {
8352
8395
 
8353
8396
  class PolygonData extends LineData {}
8354
8397
 
8355
- class StarData extends UIData {}
8398
+ class StarData extends UIData {
8399
+ get __boxStroke() {
8400
+ return !this.__pathInputed;
8401
+ }
8402
+ }
8356
8403
 
8357
8404
  class PathData extends UIData {
8358
8405
  get __pathInputed() {
@@ -8456,7 +8503,7 @@ const UIBounds = {
8456
8503
  const data = this.__, {strokeAlign: strokeAlign, __maxStrokeWidth: strokeWidth} = data, box = this.__box;
8457
8504
  if ((data.stroke || data.hitStroke === "all") && strokeWidth && strokeAlign !== "inside") {
8458
8505
  boxSpread = spread = strokeAlign === "center" ? strokeWidth / 2 : strokeWidth;
8459
- if (!data.__boxStroke) {
8506
+ if (!data.__boxStroke || data.__useArrow) {
8460
8507
  const miterLimitAddWidth = data.__isLinePath ? 0 : 10 * spread;
8461
8508
  const storkeCapAddWidth = data.strokeCap === "none" ? 0 : strokeWidth;
8462
8509
  spread += Math.max(miterLimitAddWidth, storkeCapAddWidth);
@@ -8486,23 +8533,23 @@ const UIBounds = {
8486
8533
  }
8487
8534
  };
8488
8535
 
8489
- const {stintSet: stintSet$2} = DataHelper;
8536
+ const {stintSet: stintSet$4} = DataHelper;
8490
8537
 
8491
8538
  const UIRender = {
8492
8539
  __updateChange() {
8493
8540
  const data = this.__;
8494
8541
  if (data.__useStroke) {
8495
8542
  const useStroke = data.__useStroke = !!(data.stroke && data.strokeWidth);
8496
- stintSet$2(this.__world, "half", useStroke && data.strokeAlign === "center" && data.strokeWidth % 2);
8497
- stintSet$2(data, "__fillAfterStroke", useStroke && data.strokeAlign === "outside" && data.fill && !data.__isTransparentFill);
8543
+ stintSet$4(this.__world, "half", useStroke && data.strokeAlign === "center" && data.strokeWidth % 2);
8544
+ stintSet$4(data, "__fillAfterStroke", useStroke && data.strokeAlign === "outside" && data.fill && !data.__isTransparentFill);
8498
8545
  }
8499
8546
  if (data.__useEffect) {
8500
8547
  const {shadow: shadow, fill: fill, stroke: stroke} = data, otherEffect = data.innerShadow || data.blur || data.backgroundBlur || data.filter;
8501
- stintSet$2(data, "__isFastShadow", shadow && !otherEffect && shadow.length < 2 && !shadow[0].spread && !Effect.isTransformShadow(shadow[0]) && fill && !data.__isTransparentFill && !(isArray(fill) && fill.length > 1) && (this.useFastShadow || !stroke || stroke && data.strokeAlign === "inside"));
8548
+ stintSet$4(data, "__isFastShadow", shadow && !otherEffect && shadow.length < 2 && !shadow[0].spread && !Effect.isTransformShadow(shadow[0]) && fill && !data.__isTransparentFill && !(isArray(fill) && fill.length > 1) && (this.useFastShadow || !stroke || stroke && data.strokeAlign === "inside"));
8502
8549
  data.__useEffect = !!(shadow || otherEffect);
8503
8550
  }
8504
8551
  data.__checkSingle();
8505
- stintSet$2(data, "__complex", data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect);
8552
+ stintSet$4(data, "__complex", data.__isFills || data.__isStrokes || data.cornerRadius || data.__useEffect);
8506
8553
  },
8507
8554
  __drawFast(canvas, options) {
8508
8555
  drawFast(this, canvas, options);
@@ -8613,6 +8660,12 @@ let UI = UI_1 = class UI extends Leaf {
8613
8660
  get isFrame() {
8614
8661
  return false;
8615
8662
  }
8663
+ set strokeWidthFixed(value) {
8664
+ this.strokeScaleFixed = value;
8665
+ }
8666
+ get strokeWidthFixed() {
8667
+ return this.strokeScaleFixed;
8668
+ }
8616
8669
  set scale(value) {
8617
8670
  MathHelper.assignScale(this, value);
8618
8671
  }
@@ -8668,6 +8721,9 @@ let UI = UI_1 = class UI extends Leaf {
8668
8721
  getPathString(curve, pathForRender, floatLength) {
8669
8722
  return PathConvert.stringify(this.getPath(curve, pathForRender), floatLength);
8670
8723
  }
8724
+ asPath(curve, pathForRender) {
8725
+ this.path = this.getPath(curve, pathForRender);
8726
+ }
8671
8727
  load() {
8672
8728
  this.__.__computePaint();
8673
8729
  }
@@ -8677,16 +8733,18 @@ let UI = UI_1 = class UI extends Leaf {
8677
8733
  data.lazy && !this.__inLazyBounds && !Export.running ? data.__needComputePaint = true : data.__computePaint();
8678
8734
  }
8679
8735
  }
8680
- __updateRenderPath() {
8736
+ __updateRenderPath(updateCache) {
8681
8737
  const data = this.__;
8682
8738
  if (data.path) {
8683
8739
  data.__pathForRender = data.cornerRadius ? PathCorner.smooth(data.path, data.cornerRadius, data.cornerSmoothing) : data.path;
8684
- if (data.__useArrow) PathArrow.addArrows(this);
8740
+ if (data.__useArrow) PathArrow.addArrows(this, updateCache);
8685
8741
  } else data.__pathForRender && (data.__pathForRender = undefined);
8686
8742
  }
8687
8743
  __drawRenderPath(canvas) {
8744
+ const data = this.__;
8688
8745
  canvas.beginPath();
8689
- this.__drawPathByData(canvas, this.__.__pathForRender);
8746
+ if (data.__useArrow) PathArrow.updateArrow(this);
8747
+ this.__drawPathByData(canvas, data.__pathForRender);
8690
8748
  }
8691
8749
  __drawPath(canvas) {
8692
8750
  canvas.beginPath();
@@ -8735,6 +8793,7 @@ let UI = UI_1 = class UI extends Leaf {
8735
8793
  static setEditOuter(_toolName) {}
8736
8794
  static setEditInner(_editorName) {}
8737
8795
  destroy() {
8796
+ this.__.__willDestroy = true;
8738
8797
  this.fill = this.stroke = null;
8739
8798
  if (this.__animate) this.killAnimate();
8740
8799
  super.destroy();
@@ -8851,7 +8910,7 @@ __decorate([ strokeType("inside") ], UI.prototype, "strokeAlign", void 0);
8851
8910
 
8852
8911
  __decorate([ strokeType(1, true) ], UI.prototype, "strokeWidth", void 0);
8853
8912
 
8854
- __decorate([ strokeType(false) ], UI.prototype, "strokeWidthFixed", void 0);
8913
+ __decorate([ strokeType(false) ], UI.prototype, "strokeScaleFixed", void 0);
8855
8914
 
8856
8915
  __decorate([ strokeType("none") ], UI.prototype, "strokeCap", void 0);
8857
8916
 
@@ -9352,6 +9411,9 @@ let Box = class Box extends Group {
9352
9411
  get isBranchLeaf() {
9353
9412
  return true;
9354
9413
  }
9414
+ get __useSelfBox() {
9415
+ return this.pathInputed;
9416
+ }
9355
9417
  constructor(data) {
9356
9418
  super(data);
9357
9419
  this.__layout.renderChanged || this.__layout.renderChange();
@@ -9367,7 +9429,7 @@ let Box = class Box extends Group {
9367
9429
  }
9368
9430
  __updateRectBoxBounds() {}
9369
9431
  __updateBoxBounds(_secondLayout) {
9370
- if (this.children.length && !this.pathInputed) {
9432
+ if (this.children.length && !this.__useSelfBox) {
9371
9433
  const data = this.__;
9372
9434
  if (data.__autoSide) {
9373
9435
  if (data.__hasSurface) this.__extraUpdate();
@@ -9476,38 +9538,38 @@ __decorate([ affectRenderBoundsType("hide") ], Frame.prototype, "overflow", void
9476
9538
 
9477
9539
  Frame = __decorate([ registerUI() ], Frame);
9478
9540
 
9479
- const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse} = PathCommandDataHelper;
9541
+ const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse$2} = PathCommandDataHelper;
9480
9542
 
9481
9543
  let Ellipse = class Ellipse extends UI {
9482
9544
  get __tag() {
9483
9545
  return "Ellipse";
9484
9546
  }
9485
9547
  __updatePath() {
9486
- const {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle} = this.__;
9548
+ const data = this.__, {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle} = data;
9487
9549
  const rx = width / 2, ry = height / 2;
9488
- const path = this.__.path = [];
9550
+ const path = data.path = [];
9489
9551
  let open;
9490
9552
  if (innerRadius) {
9491
9553
  if (startAngle || endAngle) {
9492
- if (innerRadius < 1) ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false); else open = true;
9493
- ellipse(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
9554
+ if (innerRadius < 1) ellipse$2(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false); else open = true;
9555
+ ellipse$2(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
9494
9556
  } else {
9495
9557
  if (innerRadius < 1) {
9496
- ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
9558
+ ellipse$2(path, rx, ry, rx * innerRadius, ry * innerRadius);
9497
9559
  moveTo$3(path, width, ry);
9498
9560
  }
9499
- ellipse(path, rx, ry, rx, ry, 0, 360, 0, true);
9561
+ ellipse$2(path, rx, ry, rx, ry, 0, 360, 0, true);
9500
9562
  }
9501
9563
  } else {
9502
9564
  if (startAngle || endAngle) {
9503
9565
  moveTo$3(path, rx, ry);
9504
- ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
9566
+ ellipse$2(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
9505
9567
  } else {
9506
- ellipse(path, rx, ry, rx, ry);
9568
+ ellipse$2(path, rx, ry, rx, ry);
9507
9569
  }
9508
9570
  }
9509
9571
  if (!open) closePath$2(path);
9510
- if (Platform.ellipseToCurve) this.__.path = this.getPath(true);
9572
+ if (Platform.ellipseToCurve || data.__useArrow) data.path = this.getPath(true);
9511
9573
  }
9512
9574
  };
9513
9575
 
@@ -9731,7 +9793,7 @@ __decorate([ resizeType() ], Canvas.prototype, "contextSettings", void 0);
9731
9793
 
9732
9794
  Canvas = __decorate([ registerUI() ], Canvas);
9733
9795
 
9734
- const {copyAndSpread: copyAndSpread$2, includes: includes, spread: spread, setList: setList} = BoundsHelper, {stintSet: stintSet$1} = DataHelper;
9796
+ const {copyAndSpread: copyAndSpread$3, includes: includes, spread: spread, setList: setList} = BoundsHelper, {stintSet: stintSet$3} = DataHelper;
9735
9797
 
9736
9798
  let Text = class Text extends UI {
9737
9799
  get __tag() {
@@ -9748,9 +9810,9 @@ let Text = class Text extends UI {
9748
9810
  data.__letterSpacing = UnitConvert.number(letterSpacing, fontSize);
9749
9811
  data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * .7) / 2;
9750
9812
  data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize || 12}px ${fontFamily || "caption"}`;
9751
- stintSet$1(data, "__padding", padding && MathHelper.fourNumber(padding));
9752
- stintSet$1(data, "__clipText", textOverflow !== "show" && !data.__autoSize);
9753
- stintSet$1(data, "__isCharMode", width || height || data.__letterSpacing || textCase !== "none");
9813
+ stintSet$3(data, "__padding", padding && MathHelper.fourNumber(padding));
9814
+ stintSet$3(data, "__clipText", textOverflow !== "show" && !data.__autoSize);
9815
+ stintSet$3(data, "__isCharMode", width || height || data.__letterSpacing || textCase !== "none");
9754
9816
  data.__textDrawData = TextConvert.getDrawData((data.__isPlacehold = data.placeholder && data.text === "") ? data.placeholder : data.text, this.__);
9755
9817
  }
9756
9818
  __updateBoxBounds() {
@@ -9785,7 +9847,7 @@ let Text = class Text extends UI {
9785
9847
  }
9786
9848
  __updateRenderBounds() {
9787
9849
  const {renderBounds: renderBounds, renderSpread: renderSpread} = this.__layout;
9788
- copyAndSpread$2(renderBounds, this.__.__textBoxBounds, renderSpread);
9850
+ copyAndSpread$3(renderBounds, this.__.__textBoxBounds, renderSpread);
9789
9851
  if (this.__box) this.__box.__layout.renderBounds = renderBounds;
9790
9852
  }
9791
9853
  __updateChange() {
@@ -10047,7 +10109,7 @@ let App = class App extends Leafer {
10047
10109
  if (this.viewReady) this.renderer.update();
10048
10110
  }
10049
10111
  __render(canvas, options) {
10050
- if (canvas.context) this.forEach(leafer => options.matrix ? leafer.__render(canvas, options) : canvas.copyWorld(leafer.canvas, options.bounds));
10112
+ if (canvas.context) this.forEach(leafer => options.matrix ? leafer.__render(canvas, options) : canvas.copyWorld(leafer.canvas, options.bounds, undefined, undefined, true));
10051
10113
  }
10052
10114
  __onResize(event) {
10053
10115
  this.forEach(leafer => leafer.resize(event));
@@ -11099,6 +11161,14 @@ class InteractionBase {
11099
11161
  stopDragAnimate() {
11100
11162
  this.dragger.stopAnimate();
11101
11163
  }
11164
+ replaceDownTarget(target) {
11165
+ const {downData: downData} = this;
11166
+ if (downData && target) {
11167
+ const {path: path} = downData;
11168
+ path.remove(path.list[0]);
11169
+ path.addAt(target, 0);
11170
+ }
11171
+ }
11102
11172
  updateDownData(data, options, merge) {
11103
11173
  const {downData: downData} = this;
11104
11174
  if (!data && downData) data = downData;
@@ -11602,8 +11672,8 @@ function fills(fills, ui, canvas, renderOptions) {
11602
11672
  canvas.save();
11603
11673
  if (item.transform) canvas.transform(item.transform);
11604
11674
  if (originPaint.scaleFixed) {
11605
- const {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true);
11606
- if (originPaint.scaleFixed === true || originPaint.scaleFixed === "zoom-in" && scaleX > 1 && scaleY > 1) canvas.scale(1 / scaleX, 1 / scaleY);
11675
+ const {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true, originPaint.scaleFixed, false);
11676
+ if (scaleX !== 1) canvas.scale(scaleX, scaleY);
11607
11677
  }
11608
11678
  if (originPaint.blendMode) canvas.blendMode = originPaint.blendMode;
11609
11679
  fillPathOrText(ui, canvas, renderOptions);
@@ -11774,7 +11844,7 @@ function drawStrokesStyle(strokes, strokeWidthScale, isText, ui, canvas, renderO
11774
11844
  }
11775
11845
  }
11776
11846
 
11777
- const {getSpread: getSpread, copyAndSpread: copyAndSpread$1, toOuterOf: toOuterOf, getOuterOf: getOuterOf, getByMove: getByMove, move: move$7, getIntersectData: getIntersectData} = BoundsHelper;
11847
+ const {getSpread: getSpread, copyAndSpread: copyAndSpread$2, toOuterOf: toOuterOf, getOuterOf: getOuterOf, getByMove: getByMove, move: move$7, getIntersectData: getIntersectData} = BoundsHelper;
11778
11848
 
11779
11849
  const tempBounds$2 = {};
11780
11850
 
@@ -11782,7 +11852,7 @@ function shape(ui, current, options) {
11782
11852
  const canvas = current.getSameCanvas();
11783
11853
  const currentBounds = current.bounds, nowWorld = ui.__nowWorld, layout = ui.__layout;
11784
11854
  const nowWorldShapeBounds = ui.__nowWorldShapeBounds || (ui.__nowWorldShapeBounds = {});
11785
- toOuterOf(layout.strokeSpread ? (copyAndSpread$1(tempBounds$2, layout.boxBounds, layout.strokeSpread),
11855
+ toOuterOf(layout.strokeSpread ? (copyAndSpread$2(tempBounds$2, layout.boxBounds, layout.strokeSpread),
11786
11856
  tempBounds$2) : layout.boxBounds, nowWorld, nowWorldShapeBounds);
11787
11857
  let bounds, renderBounds, matrix, fitMatrix, shapeBounds, worldCanvas;
11788
11858
  let {scaleX: scaleX, scaleY: scaleY} = ui.getRenderScaleData(true);
@@ -11838,7 +11908,7 @@ function shape(ui, current, options) {
11838
11908
 
11839
11909
  let recycleMap;
11840
11910
 
11841
- const {stintSet: stintSet} = DataHelper, {hasTransparent: hasTransparent$1} = ColorConvert;
11911
+ const {stintSet: stintSet$2} = DataHelper, {hasTransparent: hasTransparent$1} = ColorConvert;
11842
11912
 
11843
11913
  function compute(attrName, ui) {
11844
11914
  const data = ui.__, leafPaints = [];
@@ -11862,12 +11932,12 @@ function compute(attrName, ui) {
11862
11932
  isTransparent = true;
11863
11933
  }
11864
11934
  if (attrName === "fill") {
11865
- stintSet(data, "__isAlphaPixelFill", isAlphaPixel);
11866
- stintSet(data, "__isTransparentFill", isTransparent);
11935
+ stintSet$2(data, "__isAlphaPixelFill", isAlphaPixel);
11936
+ stintSet$2(data, "__isTransparentFill", isTransparent);
11867
11937
  } else {
11868
- stintSet(data, "__isAlphaPixelStroke", isAlphaPixel);
11869
- stintSet(data, "__isTransparentStroke", isTransparent);
11870
- stintSet(data, "__hasMultiStrokeStyle", maxChildStrokeWidth);
11938
+ stintSet$2(data, "__isAlphaPixelStroke", isAlphaPixel);
11939
+ stintSet$2(data, "__isTransparentStroke", isTransparent);
11940
+ stintSet$2(data, "__hasMultiStrokeStyle", maxChildStrokeWidth);
11871
11941
  }
11872
11942
  } else {
11873
11943
  data.__removePaint(attrName, false);
@@ -11940,12 +12010,12 @@ const PaintModule = {
11940
12010
 
11941
12011
  let cache$1, box$2 = new Bounds;
11942
12012
 
11943
- const {isSame: isSame} = BoundsHelper;
12013
+ const {isSame: isSame$1} = BoundsHelper;
11944
12014
 
11945
12015
  function image(ui, attrName, paint, boxBounds, firstUse) {
11946
12016
  let leafPaint, event;
11947
12017
  const image = ImageManager.get(paint, paint.type);
11948
- if (cache$1 && paint === cache$1.paint && isSame(boxBounds, cache$1.boxBounds)) {
12018
+ if (cache$1 && paint === cache$1.paint && isSame$1(boxBounds, cache$1.boxBounds)) {
11949
12019
  leafPaint = cache$1.leafPaint;
11950
12020
  } else {
11951
12021
  leafPaint = {
@@ -12024,6 +12094,7 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
12024
12094
  const clip = transform && !transform.onlyScale || data.path || data.cornerRadius;
12025
12095
  if (clip || opacity && opacity < 1 || blendMode) leafPaint.complex = clip ? 2 : true;
12026
12096
  }
12097
+ if (paint.filter) PaintImage.applyFilter(leafPaint, image, paint.filter, ui);
12027
12098
  return true;
12028
12099
  }
12029
12100
 
@@ -12231,7 +12302,7 @@ function layout$3(transform, box, x, y, scaleX, scaleY, rotation, skew) {
12231
12302
  translate(transform, box.x + x, box.y + y);
12232
12303
  }
12233
12304
 
12234
- const {get: get$1, scale: scale$1, copy: copy$4} = MatrixHelper;
12305
+ const {get: get$1, scale: scale$2, copy: copy$4} = MatrixHelper;
12235
12306
 
12236
12307
  const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$6} = Math;
12237
12308
 
@@ -12251,7 +12322,7 @@ function createPattern(paint, ui, canvas, renderOptions) {
12251
12322
  let {scaleX: scaleX, scaleY: scaleY} = PaintImage.getImageRenderScaleData(paint, ui, canvas, renderOptions), id = paint.film ? paint.nowIndex : scaleX + "-" + scaleY;
12252
12323
  if (paint.patternId !== id && !ui.destroyed) {
12253
12324
  if (!(Platform.image.isLarge(paint.image, scaleX, scaleY) && !paint.data.repeat)) {
12254
- const {image: image, data: data} = paint, {opacity: opacity, filters: filters} = paint.originPaint, {transform: transform, gap: gap} = data, fixScale = PaintImage.getPatternFixScale(paint, scaleX, scaleY);
12325
+ const {image: image, data: data} = paint, {opacity: opacity} = paint.originPaint, {transform: transform, gap: gap} = data, fixScale = PaintImage.getPatternFixScale(paint, scaleX, scaleY);
12255
12326
  let imageMatrix, xGap, yGap, {width: width, height: height} = image;
12256
12327
  if (fixScale) scaleX *= fixScale, scaleY *= fixScale;
12257
12328
  width *= scaleX;
@@ -12265,9 +12336,9 @@ function createPattern(paint, ui, canvas, renderOptions) {
12265
12336
  scaleY *= getFloorScale(height + (yGap || 0));
12266
12337
  imageMatrix = get$1();
12267
12338
  if (transform) copy$4(imageMatrix, transform);
12268
- scale$1(imageMatrix, 1 / scaleX, 1 / scaleY);
12339
+ scale$2(imageMatrix, 1 / scaleX, 1 / scaleY);
12269
12340
  }
12270
- const imageCanvas = image.getCanvas(width, height, opacity, filters, xGap, yGap, ui.leafer && ui.leafer.config.smooth, data.interlace);
12341
+ const imageCanvas = image.getCanvas(width, height, opacity, undefined, xGap, yGap, ui.leafer && ui.leafer.config.smooth, data.interlace);
12271
12342
  const pattern = image.getPattern(imageCanvas, data.repeat || (Platform.origin.noRepeat || "no-repeat"), imageMatrix, paint);
12272
12343
  paint.style = pattern;
12273
12344
  paint.patternId = id;
@@ -12296,7 +12367,7 @@ function checkImage(paint, drawImage, ui, canvas, renderOptions) {
12296
12367
  if (drawImage) {
12297
12368
  if (data.repeat) {
12298
12369
  drawImage = false;
12299
- } else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp" && ResizeEvent.isResizing(ui) || exporting)) {
12370
+ } else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp" || exporting)) {
12300
12371
  drawImage = Platform.image.isLarge(image, scaleX, scaleY) || image.width * scaleX > 8096 || image.height * scaleY > 8096;
12301
12372
  }
12302
12373
  }
@@ -12358,6 +12429,7 @@ function recycleImage(attrName, data) {
12358
12429
  if (!recycleMap) recycleMap = {};
12359
12430
  recycleMap[url] = true;
12360
12431
  ImageManager.recyclePaint(paint);
12432
+ if (data.__willDestroy && image.parent) PaintImage.recycleFilter(image, data.__leaf);
12361
12433
  if (image.loading) {
12362
12434
  if (!input) {
12363
12435
  input = data.__input && data.__input[attrName] || [];
@@ -12848,7 +12920,7 @@ function createRows(drawData, content, style) {
12848
12920
  }, row = {
12849
12921
  words: []
12850
12922
  };
12851
- if (__letterSpacing) content = [ ...content ];
12923
+ content = [ ...content ];
12852
12924
  for (let i = 0, len = content.length; i < len; i++) {
12853
12925
  char = content[i];
12854
12926
  if (char === "\n") {
@@ -13327,8 +13399,11 @@ function targetAttr(fn) {
13327
13399
  });
13328
13400
  if (isObject(check)) value = check; else if (check === false) return;
13329
13401
  }
13330
- t.setDimOthers(false);
13331
- t.setBright(false);
13402
+ if (t.hasDimOthers) {
13403
+ t.setDimOthers(false);
13404
+ t.setBright(false);
13405
+ t.hasDimOthers = undefined;
13406
+ }
13332
13407
  if (isArray(value) && value.length > 1 && value[0].locked) value.splice(0, 1);
13333
13408
  if (t.single) {
13334
13409
  delete t.element.syncEventer;
@@ -13353,7 +13428,8 @@ function mergeConfigAttr() {
13353
13428
  return (target, key) => {
13354
13429
  defineKey(target, key, {
13355
13430
  get() {
13356
- const {config: config, element: element, dragPoint: dragPoint, editBox: editBox, app: app} = this, mergeConfig = Object.assign({}, config);
13431
+ const {config: config, element: element, dragPoint: dragPoint, editBox: editBox, editTool: editTool, innerEditor: innerEditor, app: app} = this, mergeConfig = Object.assign({}, config);
13432
+ if (innerEditor) innerEditor.editConfig && Object.assign(mergeConfig, innerEditor.editConfig); else if (editTool) editTool.editConfig && Object.assign(mergeConfig, editTool.editConfig);
13357
13433
  if (element && element.editConfig) {
13358
13434
  let {editConfig: editConfig} = element;
13359
13435
  if (editConfig.hover || editConfig.hoverStyle) {
@@ -14256,8 +14332,11 @@ class EditBox extends Group {
14256
14332
  const {editMask: editMask} = editor;
14257
14333
  const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergeConfig;
14258
14334
  editMask.visible = mask ? true : 0;
14259
- editor.setDimOthers(dimOthers);
14260
- editor.setBright(!!dimOthers || bright);
14335
+ if (!isUndefined(dimOthers) || !isUndefined(bright)) {
14336
+ editor.setDimOthers(dimOthers);
14337
+ editor.setBright(!!dimOthers || bright);
14338
+ editor.hasDimOthers = true;
14339
+ }
14261
14340
  if (spread) BoundsHelper.spread(bounds, spread);
14262
14341
  if (this.view.worldOpacity) {
14263
14342
  const {width: width, height: height} = bounds;
@@ -14276,7 +14355,8 @@ class EditBox extends Group {
14276
14355
  resizeL = resizeLines[(i - 1) / 2];
14277
14356
  resizeL.set(point);
14278
14357
  resizeL.visible = resizeP.visible && !hideResizeLines;
14279
- resizeP.visible = rotateP.visible = showPoints && !!middlePoint;
14358
+ if (resizeP.visible) resizeP.visible = !!middlePoint;
14359
+ if (rotateP.visible) rotateP.visible = !!middlePoint;
14280
14360
  if ((i + 1) / 2 % 2) {
14281
14361
  resizeL.width = width + resizeL.height;
14282
14362
  if (hideOnSmall && resizeP.width * 2 > width) resizeP.visible = false;
@@ -14362,8 +14442,9 @@ class EditBox extends Group {
14362
14442
  onDragStart(e) {
14363
14443
  this.dragging = true;
14364
14444
  const point = this.dragPoint = e.current, {pointType: pointType} = point;
14365
- const {moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable} = this.mergeConfig;
14445
+ const {moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable, onCopy: onCopy} = this.mergeConfig;
14366
14446
  if (pointType === "move") {
14447
+ if (e.altKey && onCopy && onCopy() && this.editor.single) this.app.interaction.replaceDownTarget(this.target);
14367
14448
  moveable && (this.moving = true);
14368
14449
  } else {
14369
14450
  if (pointType.includes("rotate") || this.isHoldRotateKey(e) || !resizeable) {
@@ -14482,26 +14563,31 @@ class EditBox extends Group {
14482
14563
  updatePointCursor(this, e);
14483
14564
  }
14484
14565
  onArrow(e) {
14485
- if (this.canUse && this.mergeConfig.keyEvent) {
14566
+ if (this.canUse) {
14486
14567
  let x = 0, y = 0;
14487
- const distance = e.shiftKey ? 10 : 1;
14488
14568
  switch (e.code) {
14489
14569
  case "ArrowDown":
14490
- y = distance;
14570
+ y = 1;
14491
14571
  break;
14492
14572
 
14493
14573
  case "ArrowUp":
14494
- y = -distance;
14574
+ y = -1;
14495
14575
  break;
14496
14576
 
14497
14577
  case "ArrowLeft":
14498
- x = -distance;
14578
+ x = -1;
14499
14579
  break;
14500
14580
 
14501
14581
  case "ArrowRight":
14502
- x = distance;
14582
+ x = 1;
14583
+ }
14584
+ if (x || y) {
14585
+ const {keyEvent: keyEvent, arrowStep: arrowStep, arrowFastStep: arrowFastStep} = this.mergeConfig;
14586
+ if (keyEvent) {
14587
+ const step = e.shiftKey ? arrowFastStep : arrowStep;
14588
+ this.transformTool.move(x * step, y * step);
14589
+ }
14503
14590
  }
14504
- if (x || y) this.transformTool.move(x, y);
14505
14591
  }
14506
14592
  }
14507
14593
  onDoubleTap(e) {
@@ -14613,6 +14699,8 @@ const config$1 = {
14613
14699
  pointSize: 10,
14614
14700
  pointRadius: 16,
14615
14701
  rotateGap: 45,
14702
+ arrowStep: 1,
14703
+ arrowFastStep: 10,
14616
14704
  buttonsDirection: "bottom",
14617
14705
  buttonsMargin: 12,
14618
14706
  hideOnSmall: true,
@@ -16835,7 +16923,7 @@ Arrow = __decorate([ registerUI() ], Arrow);
16835
16923
 
16836
16924
  const {M: M$2, L: L$2, C: C$2, Q: Q$1, O: O$1} = PathCommandMap;
16837
16925
 
16838
- const {rotate: rotate$1, copyFrom: copyFrom$1, scale: scale} = PointHelper;
16926
+ const {rotate: rotate$1, copyFrom: copyFrom$1, scale: scale$1} = PointHelper;
16839
16927
 
16840
16928
  const point$1 = {};
16841
16929
 
@@ -16882,7 +16970,7 @@ const PathMatrixHelper = {
16882
16970
  function setPoint$2(data, startIndex, x, y, scaleX, scaleY, rotation, origin) {
16883
16971
  copyFrom$1(point$1, data[startIndex], data[startIndex + 1]);
16884
16972
  if (rotation) rotate$1(point$1, rotation, origin);
16885
- if (scaleX) scale(point$1, scaleX, scaleY);
16973
+ if (scaleX) scale$1(point$1, scaleX, scaleY);
16886
16974
  data[startIndex] = x + point$1.x;
16887
16975
  data[startIndex + 1] = y + point$1.y;
16888
16976
  }
@@ -16891,12 +16979,14 @@ const {layout: layout$2, rotate: rotate} = PathMatrixHelper;
16891
16979
 
16892
16980
  const {getAngle: getAngle} = PointHelper;
16893
16981
 
16894
- const half = {
16982
+ const zero = {
16983
+ x: 0
16984
+ }, half = {
16895
16985
  x: -.5
16896
16986
  };
16897
16987
 
16898
16988
  const angle = {
16899
- connect: half,
16989
+ connect: zero,
16900
16990
  offset: {
16901
16991
  x: -.71,
16902
16992
  bevelJoin: .36,
@@ -16917,73 +17007,110 @@ const angleSide = {
16917
17007
 
16918
17008
  const triangleLinePath = [ 1, -3, 0, 2, -3, -2, 2, 0, 0, 2, -3, 2, 2, -3, 0 ];
16919
17009
 
16920
- const triangle = {
16921
- connect: half,
17010
+ const triangleFill = {
17011
+ connect: zero,
16922
17012
  offset: {
16923
17013
  x: -.9,
16924
17014
  bevelJoin: .624,
16925
17015
  roundJoin: .4
16926
17016
  },
16927
- path: [ ...triangleLinePath, 1, -2.05, 1.1, 2, -2.05, -1.1 ],
16928
- dashPath: [ 1, -2, 0, 2, -.5, 0 ]
17017
+ path: [ ...triangleLinePath ]
16929
17018
  };
16930
17019
 
16931
- const arrowLinePath = [ 1, -3, 0, 2, -3.5, -1.8, 2, 0, 0, 2, -3.5, 1.8, 2, -3, 0 ];
17020
+ const triangle = DataHelper.clone(triangleFill);
16932
17021
 
16933
- const arrow = {
16934
- connect: half,
16935
- offset: {
16936
- x: -1.1,
16937
- bevelJoin: .872,
16938
- roundJoin: .6
16939
- },
16940
- path: [ ...arrowLinePath, 1, -2.25, .95, 2, -2.25, -.95 ],
16941
- dashPath: [ 1, -3, 0, 2, -.5, 0 ]
17022
+ triangle.path = [ ...triangleLinePath, 1, -2.05, 1.1, 2, -2.05, -1.1 ];
17023
+
17024
+ triangle.dashPath = [ 1, -2, 0, 2, -.5, 0 ];
17025
+
17026
+ const triangleFlipFill = {
17027
+ connect: zero,
17028
+ offset: half,
17029
+ path: [ ...triangleFill.path ]
16942
17030
  };
16943
17031
 
16944
17032
  const triangleFlip = {
17033
+ connect: zero,
16945
17034
  offset: half,
16946
17035
  path: [ ...triangle.path ],
16947
17036
  dashPath: [ 1, -2.5, 0, 2, -1, 0 ]
16948
17037
  };
16949
17038
 
17039
+ rotate(triangleFlipFill.path, 180, {
17040
+ x: -1.5,
17041
+ y: 0
17042
+ });
17043
+
16950
17044
  rotate(triangleFlip.path, 180, {
16951
17045
  x: -1.5,
16952
17046
  y: 0
16953
17047
  });
16954
17048
 
17049
+ const arrowLinePath = [ 1, -3, 0, 2, -3.5, -1.8, 2, 0, 0, 2, -3.5, 1.8, 2, -3, 0 ];
17050
+
17051
+ const arrowFill = {
17052
+ connect: zero,
17053
+ offset: {
17054
+ x: -1.1,
17055
+ bevelJoin: .872,
17056
+ roundJoin: .6
17057
+ },
17058
+ path: [ ...arrowLinePath ]
17059
+ };
17060
+
17061
+ const arrow = DataHelper.clone(arrowFill);
17062
+
17063
+ arrow.path = [ ...arrowLinePath, 1, -2.25, .95, 2, -2.25, -.95 ];
17064
+
17065
+ arrow.dashPath = [ 1, -3, 0, 2, -.5, 0 ];
17066
+
16955
17067
  const circleLine = {
16956
17068
  connect: {
16957
- x: -1.3
17069
+ x: -1.8
16958
17070
  },
16959
17071
  path: [ 1, 1.8, -.1, 2, 1.8, 0, 26, 0, 0, 1.8, 0, 359, 0 ]
16960
17072
  };
16961
17073
 
16962
- const circle = {
17074
+ const circleFill = {
16963
17075
  connect: {
16964
17076
  x: .5
16965
17077
  },
16966
- path: [ ...circleLine.path, 1, 0, 0, 26, 0, 0, 1, 0, 360, 0 ],
16967
- dashPath: [ 1, -.5, 0, 2, .5, 0 ]
17078
+ path: [ ...circleLine.path ]
16968
17079
  };
16969
17080
 
17081
+ const circle = DataHelper.clone(circleFill);
17082
+
17083
+ circle.path = [ ...circleLine.path, 1, 0, 0, 26, 0, 0, 1, 0, 360, 0 ];
17084
+
17085
+ circle.dashPath = [ 1, -.5, 0, 2, .5, 0 ];
17086
+
16970
17087
  const squareLine = {
16971
17088
  connect: {
16972
- x: -1.3
17089
+ x: -1.4
16973
17090
  },
16974
17091
  path: [ 1, -1.4, 0, 2, -1.4, -1.4, 2, 1.4, -1.4, 2, 1.4, 1.4, 2, -1.4, 1.4, 2, -1.4, 0 ]
16975
17092
  };
16976
17093
 
17094
+ const squareFill = {
17095
+ path: [ ...squareLine.path ]
17096
+ };
17097
+
16977
17098
  const square = {
16978
17099
  path: [ ...squareLine.path, 2, -1.4, -.49, 2, 1, -.49, 1, -1.4, .49, 2, 1, .49 ]
16979
17100
  };
16980
17101
 
16981
17102
  const diamondLine = DataHelper.clone(squareLine);
16982
17103
 
17104
+ diamondLine.connect.x = -1.9;
17105
+
17106
+ const diamondFill = DataHelper.clone(squareFill);
17107
+
16983
17108
  const diamond = DataHelper.clone(square);
16984
17109
 
16985
17110
  rotate(diamondLine.path, 45);
16986
17111
 
17112
+ rotate(diamondFill.path, 45);
17113
+
16987
17114
  rotate(diamond.path, 45);
16988
17115
 
16989
17116
  const mark = {
@@ -17006,19 +17133,34 @@ const arrows = {
17006
17133
  mark: mark
17007
17134
  };
17008
17135
 
17136
+ const fillArrows = {
17137
+ triangle: triangleFill,
17138
+ "triangle-flip": triangleFlipFill,
17139
+ arrow: arrowFill,
17140
+ circle: circleFill,
17141
+ square: squareFill,
17142
+ diamond: diamondFill
17143
+ };
17144
+
17009
17145
  function getArrowPath(ui, arrow, from, to, size, connectOffset, hasDashPattern) {
17010
- let pathData, scale;
17146
+ let pathData, scale = 1, rotation = 0, fill;
17011
17147
  const {strokeCap: strokeCap, strokeJoin: strokeJoin} = ui.__;
17012
17148
  if (isObject(arrow)) {
17013
17149
  if (arrow.type) {
17014
- scale = arrow.scale;
17150
+ scale = arrow.scale || 1;
17151
+ rotation = arrow.rotation || 0;
17015
17152
  pathData = arrows[arrow.type];
17153
+ if (scale > 1) {
17154
+ const fillData = fillArrows[arrow.type];
17155
+ if (fillData) pathData = fillData, fill = true;
17156
+ }
17016
17157
  } else pathData = arrow;
17017
17158
  } else {
17018
17159
  pathData = arrows[arrow];
17019
17160
  }
17161
+ if (!fill) fill = pathData.fill;
17020
17162
  const {offset: offset, connect: connect, path: path, dashPath: dashPath} = pathData;
17021
- let connectX = connect ? connect.x : 0;
17163
+ let connectX = connect ? connect.x * scale : 0;
17022
17164
  let offsetX = offset ? offset.x : 0;
17023
17165
  const data = [ ...path ];
17024
17166
  if (hasDashPattern && dashPath) data.push(...dashPath);
@@ -17026,28 +17168,38 @@ function getArrowPath(ui, arrow, from, to, size, connectOffset, hasDashPattern)
17026
17168
  if (offset) {
17027
17169
  if (strokeJoin === "round" && offset.roundJoin) offsetX += offset.roundJoin; else if (strokeJoin === "bevel" && offset.bevelJoin) offsetX += offset.bevelJoin;
17028
17170
  }
17029
- if (scale) layout$2(data, 0, 0, scale, scale);
17171
+ if (scale !== 1) layout$2(data, 0, 0, scale, scale);
17030
17172
  if (offsetX) layout$2(data, offsetX, 0);
17031
- layout$2(data, to.x, to.y, size, size, getAngle(from, to));
17173
+ layout$2(data, to.x, to.y, size, size, getAngle(from, to) + rotation);
17032
17174
  connectOffset.x = (connectX + offsetX) * size;
17033
- return data;
17175
+ const arrowData = {
17176
+ data: data
17177
+ };
17178
+ if (fill) arrowData.fill = fill;
17179
+ return arrowData;
17034
17180
  }
17035
17181
 
17036
17182
  const {M: M$1, L: L$1, C: C$1, Q: Q, Z: Z$1, N: N, D: D, X: X, G: G, F: F, O: O, P: P, U: U} = PathCommandMap;
17037
17183
 
17038
- const {copy: copy, copyFrom: copyFrom, getDistancePoint: getDistancePoint} = PointHelper;
17184
+ const {copy: copy, copyFrom: copyFrom, getDistancePoint: getDistancePoint, isSame: isSame} = PointHelper;
17185
+
17186
+ const {stintSet: stintSet$1} = DataHelper;
17039
17187
 
17040
17188
  const connectPoint = {};
17041
17189
 
17042
17190
  const first = {}, second = {};
17043
17191
 
17044
- const last = {}, now = {};
17192
+ const old = {}, last = {}, now = {};
17045
17193
 
17046
17194
  const PathArrowModule = {
17047
17195
  list: arrows,
17048
- addArrows(ui) {
17049
- const {startArrow: startArrow, endArrow: endArrow, strokeWidth: strokeWidth, dashPattern: dashPattern, __pathForRender: data, cornerRadius: cornerRadius} = ui.__;
17196
+ fillList: fillArrows,
17197
+ addArrows(ui, updateCache) {
17198
+ const uData = ui.__;
17199
+ const {startArrow: startArrow, endArrow: endArrow, __strokeWidth: strokeWidth, dashPattern: dashPattern, __pathForRender: data, cornerRadius: cornerRadius} = uData;
17050
17200
  const clonePathForArrow = !cornerRadius;
17201
+ if (!updateCache) uData.__strokeWidthCache = strokeWidth;
17202
+ let startArrowPath, singleStartArrow, endArrowPath, singleEndArrow;
17051
17203
  let command, i = 0, len = data.length, count = 0, useStartArrow = startArrow && startArrow !== "none";
17052
17204
  while (i < len) {
17053
17205
  command = data[i];
@@ -17055,6 +17207,7 @@ const PathArrowModule = {
17055
17207
  case M$1:
17056
17208
  case L$1:
17057
17209
  if (count < 2 || i + 6 >= len) {
17210
+ copy(old, now);
17058
17211
  copyFrom(now, data[i + 1], data[i + 2]);
17059
17212
  if (!count && useStartArrow) copy(first, now);
17060
17213
  }
@@ -17062,12 +17215,18 @@ const PathArrowModule = {
17062
17215
  break;
17063
17216
 
17064
17217
  case C$1:
17065
- if (count === 1 || i + 7 >= len - 3) copyPoints(data, last, now, i + 3);
17218
+ if (count === 1 || i + 7 >= len - 3) {
17219
+ copyPoints(data, last, now, i + 3);
17220
+ old.x = data[i + 1], old.y = data[i + 2];
17221
+ }
17066
17222
  i += 7;
17067
17223
  break;
17068
17224
 
17069
17225
  case Q:
17070
- if (count === 1 || i + 5 >= len - 3) copyPoints(data, last, now, i + 1);
17226
+ if (count === 1 || i + 5 >= len - 3) {
17227
+ copyPoints(data, last, now, i + 1);
17228
+ copy(old, last);
17229
+ }
17071
17230
  i += 5;
17072
17231
  break;
17073
17232
 
@@ -17105,6 +17264,7 @@ const PathArrowModule = {
17105
17264
  case U:
17106
17265
  if (count === 1 || i + 6 >= len - 3) {
17107
17266
  copyPoints(data, last, now, i + 1);
17267
+ copy(old, last);
17108
17268
  if (i + 6 !== len) {
17109
17269
  now.x -= (now.x - last.x) / 10;
17110
17270
  now.y -= (now.y - last.y) / 10;
@@ -17115,13 +17275,13 @@ const PathArrowModule = {
17115
17275
  }
17116
17276
  count++;
17117
17277
  if (count === 1 && command !== M$1) return;
17118
- if (count === 2 && useStartArrow) copy(second, command === L$1 ? now : last);
17278
+ if (count === 2 && useStartArrow) copy(second, command === L$1 ? now : isSame(old, first) ? last : old);
17119
17279
  if (i === len) {
17120
- const path = ui.__.__pathForRender = clonePathForArrow ? [ ...data ] : data;
17121
- const pathForArrow = ui.__.__pathForArrow = [];
17280
+ const path = uData.__pathForRender = clonePathForArrow ? [ ...data ] : data;
17122
17281
  if (useStartArrow) {
17123
- const startArrowPath = getArrowPath(ui, startArrow, second, first, strokeWidth, connectPoint, !!dashPattern);
17124
- dashPattern ? pathForArrow.push(...startArrowPath) : path.push(...startArrowPath);
17282
+ startArrowPath = getArrowPath(ui, startArrow, second, first, strokeWidth, connectPoint, !!dashPattern);
17283
+ singleStartArrow = startArrowPath.fill || dashPattern;
17284
+ if (!singleStartArrow) path.push(...startArrowPath.data);
17125
17285
  if (connectPoint.x) {
17126
17286
  getDistancePoint(first, second, -connectPoint.x, true);
17127
17287
  path[1] = second.x;
@@ -17129,8 +17289,10 @@ const PathArrowModule = {
17129
17289
  }
17130
17290
  }
17131
17291
  if (endArrow && endArrow !== "none") {
17132
- const endArrowPath = getArrowPath(ui, endArrow, last, now, strokeWidth, connectPoint, !!dashPattern);
17133
- dashPattern ? pathForArrow.push(...endArrowPath) : path.push(...endArrowPath);
17292
+ if (isSame(last, now)) copy(last, old);
17293
+ endArrowPath = getArrowPath(ui, endArrow, last, now, strokeWidth, connectPoint, !!dashPattern);
17294
+ singleEndArrow = endArrowPath.fill || dashPattern;
17295
+ if (!singleEndArrow) path.push(...endArrowPath.data);
17134
17296
  if (connectPoint.x) {
17135
17297
  getDistancePoint(now, last, -connectPoint.x, true);
17136
17298
  let index;
@@ -17157,10 +17319,21 @@ const PathArrowModule = {
17157
17319
  } else {
17158
17320
  copy(last, now);
17159
17321
  }
17322
+ stintSet$1(uData, "__startArrowPath", singleStartArrow && startArrowPath);
17323
+ stintSet$1(uData, "__endArrowPath", singleEndArrow && endArrowPath);
17160
17324
  }
17161
17325
  },
17162
- register(name, data) {
17326
+ updateArrow(ui) {
17327
+ const data = ui.__;
17328
+ if (data.strokeScaleFixed) {
17329
+ if (data.__strokeWidthCache !== data.__strokeWidth) {
17330
+ ui.__updateRenderPath(true);
17331
+ }
17332
+ }
17333
+ },
17334
+ register(name, data, fillData) {
17163
17335
  this.list[name] = data;
17336
+ if (fillData) this.fillList[name] = data;
17164
17337
  },
17165
17338
  get(name) {
17166
17339
  return this.list[name];
@@ -17186,12 +17359,26 @@ UI.addAttr("endArrow", "none", arrowType);
17186
17359
  Object.assign(PathArrow, PathArrowModule);
17187
17360
 
17188
17361
  Object.assign(Paint, {
17189
- strokeArrow(_stroke, ui, canvas, _renderOptions) {
17190
- if (ui.__.dashPattern) {
17362
+ strokeArrow(stroke, ui, canvas, _renderOptions) {
17363
+ const {__startArrowPath: __startArrowPath, __endArrowPath: __endArrowPath, dashPattern: dashPattern} = ui.__;
17364
+ if (dashPattern) canvas.dashPattern = null;
17365
+ if (__startArrowPath) {
17366
+ canvas.beginPath();
17367
+ ui.__drawPathByData(canvas, __startArrowPath.data);
17368
+ canvas.stroke();
17369
+ if (__startArrowPath.fill) {
17370
+ canvas.fillStyle = stroke;
17371
+ canvas.fill();
17372
+ }
17373
+ }
17374
+ if (__endArrowPath) {
17191
17375
  canvas.beginPath();
17192
- ui.__drawPathByData(canvas, ui.__.__pathForArrow);
17193
- canvas.dashPattern = null;
17376
+ ui.__drawPathByData(canvas, __endArrowPath.data);
17194
17377
  canvas.stroke();
17378
+ if (__endArrowPath.fill) {
17379
+ canvas.fillStyle = stroke;
17380
+ canvas.fill();
17381
+ }
17195
17382
  }
17196
17383
  }
17197
17384
  });
@@ -17653,7 +17840,7 @@ UI.addAttr("autoHeight", undefined, autoBoundsType);
17653
17840
 
17654
17841
  UI.addAttr("autoBox", undefined, boundsType);
17655
17842
 
17656
- const {copyAndSpread: copyAndSpread} = BoundsHelper;
17843
+ const {copyAndSpread: copyAndSpread$1} = BoundsHelper;
17657
17844
 
17658
17845
  box$1.__updateFlowLayout = function() {
17659
17846
  const {leaferIsCreated: leaferIsCreated, flow: flow} = this;
@@ -17685,7 +17872,7 @@ box$1.__updateContentBounds = function() {
17685
17872
  const same = layout.contentBounds === layout.boxBounds;
17686
17873
  if (padding) {
17687
17874
  if (same) layout.shrinkContent();
17688
- copyAndSpread(layout.contentBounds, layout.boxBounds, padding, true);
17875
+ copyAndSpread$1(layout.contentBounds, layout.boxBounds, padding, true);
17689
17876
  } else {
17690
17877
  if (!same) layout.shrinkContentCancel();
17691
17878
  }
@@ -17707,7 +17894,7 @@ box$1.__updateBoxBounds = function(secondLayout) {
17707
17894
  boxBounds.width = data.width, boxBounds.x = 0;
17708
17895
  }
17709
17896
  }
17710
- flow && secondLayout && data.padding && copyAndSpread(boxBounds, boxBounds, data.padding, false, data.__autoSize ? null : data.__autoWidth ? "width" : "height");
17897
+ flow && secondLayout && data.padding && copyAndSpread$1(boxBounds, boxBounds, data.padding, false, data.__autoSize ? null : data.__autoWidth ? "width" : "height");
17711
17898
  this.__updateNaturalSize();
17712
17899
  } else {
17713
17900
  this.__updateRectBoxBounds();
@@ -19691,9 +19878,7 @@ const {Yes: Yes, NoAndSkip: NoAndSkip, YesAndSkip: YesAndSkip} = Answer;
19691
19878
  const idCondition = {}, classNameCondition = {}, tagCondition = {};
19692
19879
 
19693
19880
  class Finder {
19694
- constructor(target) {
19695
- this.innerIdMap = {};
19696
- this.idMap = {};
19881
+ constructor(target, _config) {
19697
19882
  this.methods = {
19698
19883
  id: (leaf, name) => leaf.id === name ? (this.target && (this.idMap[name] = leaf),
19699
19884
  1) : 0,
@@ -19703,6 +19888,13 @@ class Finder {
19703
19888
  tag: (leaf, name) => leaf.__tag === name ? 1 : 0,
19704
19889
  tags: (leaf, nameMap) => nameMap[leaf.__tag] ? 1 : 0
19705
19890
  };
19891
+ this.idMap = {};
19892
+ this.innerIdMap = {};
19893
+ const app = target && target.app;
19894
+ if (app) {
19895
+ app.idMap ? this.idMap = app.idMap : app.idMap = this.idMap;
19896
+ app.innerIdMap ? this.innerIdMap = app.innerIdMap : app.innerIdMap = this.innerIdMap;
19897
+ }
19706
19898
  if (this.target = target) this.__listenEvents();
19707
19899
  }
19708
19900
  getBy(condition, branch, one, options) {
@@ -19829,8 +20021,14 @@ ui.findOne = function(condition, options) {
19829
20021
 
19830
20022
  Plugin.add("find");
19831
20023
 
19832
- Creator.finder = function(target) {
19833
- return new Finder(target);
20024
+ Creator.finder = function(target, config) {
20025
+ return new Finder(target, config);
20026
+ };
20027
+
20028
+ LeafHelper.cacheId = function(t) {
20029
+ const {leafer: leafer, id: id} = t;
20030
+ if (id) leafer.app.idMap[id] = t;
20031
+ if (leafer.cacheInnerId) leafer.app.innerIdMap[t.innerId] = t;
19834
20032
  };
19835
20033
 
19836
20034
  const {setPoint: setPoint, addPoint: addPoint, toBounds: toBounds} = TwoPointBoundsHelper;
@@ -20123,7 +20321,7 @@ const config = {
20123
20321
  style: {
20124
20322
  dragBoundsType: "outer",
20125
20323
  strokeAlign: "center",
20126
- strokeWidthFixed: "zoom-in",
20324
+ strokeScaleFixed: "zoom-in",
20127
20325
  width: 6,
20128
20326
  height: 6,
20129
20327
  opacity: .5,
@@ -20372,4 +20570,185 @@ Scroller.registerTheme("dark", {
20372
20570
  }
20373
20571
  });
20374
20572
 
20375
- 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, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferFilm, LeaferImage, LeaferTypeCreator, LeaferVideo, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, Scroller, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, UnitConvertHelper, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$3 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$4 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
20573
+ const {stintSet: stintSet} = DataHelper;
20574
+
20575
+ function scaleFixedType(defaultValue) {
20576
+ return decorateLeafAttr(defaultValue, key => attr({
20577
+ set(value) {
20578
+ if (this.__setAttr(key, value)) {
20579
+ const layout = this.__layout;
20580
+ doBoundsType(this);
20581
+ if (!isNumber(value)) value = value ? 1 : 0;
20582
+ stintSet(layout, "scaleFixed", value);
20583
+ stintSet(layout, "outerScale", value ? 1 / value : 0);
20584
+ if (!layout.outerScale && layout.localOuterBounds) layout.localOuterBounds = undefined;
20585
+ }
20586
+ }
20587
+ }));
20588
+ }
20589
+
20590
+ const {scale: scale} = MatrixHelper;
20591
+
20592
+ const {copyAndSpread: copyAndSpread} = BoundsHelper;
20593
+
20594
+ const {getScaleFixedData: getScaleFixedData} = MathHelper;
20595
+
20596
+ LeafHelper.updateScaleFixedWorld = function(t) {
20597
+ const {__world: __world, __: __} = t, {scaleX: scaleX, scaleY: scaleY} = getScaleFixedData(__world, __.scaleFixed);
20598
+ if (scaleX !== 1) {
20599
+ scale(__world, scaleX, scaleY);
20600
+ __world.scaleX *= scaleX, __world.scaleY *= scaleY;
20601
+ }
20602
+ };
20603
+
20604
+ LeafHelper.updateOuterBounds = function(t) {
20605
+ const layout = t.__layout, {localRenderBounds: localRenderBounds} = layout;
20606
+ const localOuterBounds = layout.localOuterBounds || (layout.localOuterBounds = {});
20607
+ const {width: width, height: height} = localRenderBounds;
20608
+ const scale = layout.outerScale - 1;
20609
+ copyAndSpread(localOuterBounds, localRenderBounds, [ height * scale, width * scale ]);
20610
+ if (t.parent) t.parent.__layout.renderChange();
20611
+ };
20612
+
20613
+ Plugin.add("scale-fixed");
20614
+
20615
+ UI.addAttr("scaleFixed", undefined, scaleFixedType);
20616
+
20617
+ class EllipseBoxData extends BoxData {}
20618
+
20619
+ const ellipse$1 = Ellipse.prototype;
20620
+
20621
+ let EllipseBox = class EllipseBox extends Box {
20622
+ get __tag() {
20623
+ return "EllipseBox";
20624
+ }
20625
+ __updatePath() {}
20626
+ };
20627
+
20628
+ __decorate([ dataProcessor(EllipseBoxData) ], EllipseBox.prototype, "__", void 0);
20629
+
20630
+ __decorate([ pathType(0) ], EllipseBox.prototype, "innerRadius", void 0);
20631
+
20632
+ __decorate([ pathType(0) ], EllipseBox.prototype, "startAngle", void 0);
20633
+
20634
+ __decorate([ pathType(0) ], EllipseBox.prototype, "endAngle", void 0);
20635
+
20636
+ __decorate([ rewrite(ellipse$1.__updatePath) ], EllipseBox.prototype, "__updatePath", null);
20637
+
20638
+ EllipseBox = __decorate([ rewriteAble(), registerUI() ], EllipseBox);
20639
+
20640
+ class PolygonBoxData extends BoxData {
20641
+ get __usePathBox() {
20642
+ return this.points || this.__pathInputed;
20643
+ }
20644
+ }
20645
+
20646
+ const polygon = Polygon.prototype;
20647
+
20648
+ let PolygonBox = class PolygonBox extends Box {
20649
+ get __tag() {
20650
+ return "PolygonBox";
20651
+ }
20652
+ __updatePath() {}
20653
+ };
20654
+
20655
+ __decorate([ dataProcessor(PolygonBoxData) ], PolygonBox.prototype, "__", void 0);
20656
+
20657
+ __decorate([ pathType(3) ], PolygonBox.prototype, "sides", void 0);
20658
+
20659
+ __decorate([ pathType() ], PolygonBox.prototype, "points", void 0);
20660
+
20661
+ __decorate([ pathType(0) ], PolygonBox.prototype, "curve", void 0);
20662
+
20663
+ __decorate([ rewrite(polygon.__updatePath) ], PolygonBox.prototype, "__updatePath", null);
20664
+
20665
+ PolygonBox = __decorate([ rewriteAble(), registerUI() ], PolygonBox);
20666
+
20667
+ class StarBoxData extends BoxData {}
20668
+
20669
+ const ellipse = Star.prototype;
20670
+
20671
+ let StarBox = class StarBox extends Box {
20672
+ get __tag() {
20673
+ return "StarBox";
20674
+ }
20675
+ __updatePath() {}
20676
+ };
20677
+
20678
+ __decorate([ pathType(5) ], StarBox.prototype, "corners", void 0);
20679
+
20680
+ __decorate([ pathType(.382) ], StarBox.prototype, "innerRadius", void 0);
20681
+
20682
+ __decorate([ dataProcessor(StarBoxData) ], StarBox.prototype, "__", void 0);
20683
+
20684
+ __decorate([ rewrite(ellipse.__updatePath) ], StarBox.prototype, "__updatePath", null);
20685
+
20686
+ StarBox = __decorate([ rewriteAble(), registerUI() ], StarBox);
20687
+
20688
+ class PathBoxData extends BoxData {}
20689
+
20690
+ let PathBox = class PathBox extends Box {
20691
+ get __tag() {
20692
+ return "PathBox";
20693
+ }
20694
+ };
20695
+
20696
+ __decorate([ dataProcessor(PathBoxData) ], PathBox.prototype, "__", void 0);
20697
+
20698
+ __decorate([ affectStrokeBoundsType("center") ], PathBox.prototype, "strokeAlign", void 0);
20699
+
20700
+ PathBox = __decorate([ registerUI() ], PathBox);
20701
+
20702
+ class ImageBoxData extends BoxData {
20703
+ get __urlType() {
20704
+ return "image";
20705
+ }
20706
+ setUrl(value) {
20707
+ this.__setImageFill(value);
20708
+ this._url = value;
20709
+ }
20710
+ __setImageFill(value) {
20711
+ this.fill = value ? {
20712
+ type: this.__urlType,
20713
+ mode: "stretch",
20714
+ url: value
20715
+ } : undefined;
20716
+ }
20717
+ __getData() {
20718
+ const data = super.__getData();
20719
+ if (data.url) delete data.fill;
20720
+ return data;
20721
+ }
20722
+ __getInputData(names, options) {
20723
+ const data = super.__getInputData(names, options);
20724
+ if (data.url) delete data.fill;
20725
+ return data;
20726
+ }
20727
+ }
20728
+
20729
+ let ImageBox = class ImageBox extends Box {
20730
+ get __tag() {
20731
+ return "ImageBox";
20732
+ }
20733
+ get ready() {
20734
+ const {image: image} = this;
20735
+ return image && image.ready;
20736
+ }
20737
+ get image() {
20738
+ const {fill: fill} = this.__;
20739
+ return isArray(fill) && fill[0].image;
20740
+ }
20741
+ get __useSelfBox() {
20742
+ return true;
20743
+ }
20744
+ };
20745
+
20746
+ __decorate([ dataProcessor(ImageBoxData) ], ImageBox.prototype, "__", void 0);
20747
+
20748
+ __decorate([ boundsType("") ], ImageBox.prototype, "url", void 0);
20749
+
20750
+ ImageBox = __decorate([ registerUI() ], ImageBox);
20751
+
20752
+ Plugin.add("box");
20753
+
20754
+ export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, DragEvent, Dragger, DropEvent, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseBox, EllipseBoxData, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageBox, ImageBoxData, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferFilm, LeaferImage, LeaferTypeCreator, LeaferVideo, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathBox, PathBoxData, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonBox, PolygonBoxData, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, Scroller, SelectArea, Selector, Star, StarBox, StarBoxData, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, UnitConvertHelper, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$3 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$4 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };