@leafer/miniapp 2.0.7 → 2.0.8

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.
@@ -735,7 +735,7 @@ const {float: float$5} = MathHelper;
735
735
 
736
736
  const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
737
737
 
738
- const {sin: sin$5, cos: cos$5, abs: abs$a, sqrt: sqrt$4, atan2: atan2$2, min: min$3, round: round$5} = Math;
738
+ const {sin: sin$5, cos: cos$5, abs: abs$b, sqrt: sqrt$4, atan2: atan2$2, min: min$3, round: round$5} = Math;
739
739
 
740
740
  const PointHelper = {
741
741
  defaultPoint: getPointData(),
@@ -833,8 +833,8 @@ const PointHelper = {
833
833
  return getDistanceFrom(t.x, t.y, point.x, point.y);
834
834
  },
835
835
  getDistanceFrom(x1, y1, x2, y2) {
836
- const x = abs$a(x2 - x1);
837
- const y = abs$a(y2 - y1);
836
+ const x = abs$b(x2 - x1);
837
+ const y = abs$b(y2 - y1);
838
838
  return sqrt$4(x * x + y * y);
839
839
  },
840
840
  getMinDistanceFrom(x1, y1, x2, y2, x3, y3) {
@@ -2700,7 +2700,7 @@ const RectHelper = {
2700
2700
  }
2701
2701
  };
2702
2702
 
2703
- const {sin: sin$4, cos: cos$4, hypot: hypot$1, atan2: atan2$1, ceil: ceil$1, abs: abs$9, PI: PI$3, sqrt: sqrt$3, pow: pow$1} = Math;
2703
+ const {sin: sin$4, cos: cos$4, hypot: hypot$1, atan2: atan2$1, ceil: ceil$1, abs: abs$a, PI: PI$3, sqrt: sqrt$3, pow: pow$1} = Math;
2704
2704
 
2705
2705
  const {setPoint: setPoint$4, addPoint: addPoint$2} = TwoPointBoundsHelper;
2706
2706
 
@@ -2777,7 +2777,7 @@ const BezierHelper = {
2777
2777
  const lenCB = hypot$1(CBx, CBy);
2778
2778
  let totalRadian = endRadian - startRadian;
2779
2779
  if (totalRadian < 0) totalRadian += PI2;
2780
- if (lenBA < 1e-12 || lenCB < 1e-12 || totalRadian < 1e-12 || abs$9(totalRadian - PI$3) < 1e-12) {
2780
+ if (lenBA < 1e-12 || lenCB < 1e-12 || totalRadian < 1e-12 || abs$a(totalRadian - PI$3) < 1e-12) {
2781
2781
  if (data) data.push(L$b, x1, y1);
2782
2782
  if (setPointBounds) {
2783
2783
  setPoint$4(setPointBounds, fromX, fromY);
@@ -2810,7 +2810,7 @@ const BezierHelper = {
2810
2810
  let totalRadian = endRadian - startRadian;
2811
2811
  if (totalRadian < 0) totalRadian += PI2; else if (totalRadian > PI2) totalRadian -= PI2;
2812
2812
  if (anticlockwise) totalRadian -= PI2;
2813
- const parts = ceil$1(abs$9(totalRadian / PI_2));
2813
+ const parts = ceil$1(abs$a(totalRadian / PI_2));
2814
2814
  const partRadian = totalRadian / parts;
2815
2815
  const partRadian4Sin = sin$4(partRadian / 4);
2816
2816
  const control = 8 / 3 * partRadian4Sin * partRadian4Sin / sin$4(partRadian / 2);
@@ -3316,7 +3316,7 @@ const {M: M$9, L: L$9, C: C$7, Q: Q$5, Z: Z$7, N: N$4, D: D$5, X: X$4, G: G$4, F
3316
3316
 
3317
3317
  const {getMinDistanceFrom: getMinDistanceFrom, getRadianFrom: getRadianFrom} = PointHelper;
3318
3318
 
3319
- const {tan: tan, min: min$2, abs: abs$8} = Math;
3319
+ const {tan: tan, min: min$2, abs: abs$9} = Math;
3320
3320
 
3321
3321
  const startPoint = {};
3322
3322
 
@@ -3376,7 +3376,7 @@ const PathCommandDataHelper = {
3376
3376
  arcTo(data, x1, y1, x2, y2, radius, lastX, lastY, fullRadius) {
3377
3377
  if (!isUndefined(lastX)) {
3378
3378
  const r = getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2) / (fullRadius ? 1 : 2);
3379
- radius = min$2(radius, min$2(r, r * abs$8(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
3379
+ radius = min$2(radius, min$2(r, r * abs$9(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
3380
3380
  }
3381
3381
  data.push(U$4, x1, y1, x2, y2, radius);
3382
3382
  },
@@ -7079,7 +7079,7 @@ class LeafLevelList {
7079
7079
  }
7080
7080
  }
7081
7081
 
7082
- const version = "2.0.7";
7082
+ const version = "2.0.8";
7083
7083
 
7084
7084
  class LeaferCanvas extends LeaferCanvasBase {
7085
7085
  get allowBackgroundColor() {
@@ -10247,7 +10247,7 @@ class UIEvent extends Event {
10247
10247
  }
10248
10248
  }
10249
10249
 
10250
- const {min: min$1, max: max$3, abs: abs$7} = Math, {float: float$3, sign: sign$2} = MathHelper, {minX: minX, maxX: maxX, minY: minY, maxY: maxY} = BoundsHelper;
10250
+ const {min: min$1, max: max$3, abs: abs$8} = Math, {float: float$3, sign: sign$2} = MathHelper, {minX: minX, maxX: maxX, minY: minY, maxY: maxY} = BoundsHelper;
10251
10251
 
10252
10252
  const tempContent = new Bounds, tempDragBounds = new Bounds;
10253
10253
 
@@ -10324,7 +10324,7 @@ const DragBoundsHelper = {
10324
10324
  bScale = originBottomScale && bSize > 0 ? 1 + bSize / (originBottomScale * tempContent.height) : 1;
10325
10325
  correctScaleY *= max$3(aScale, bScale);
10326
10326
  if (lockRatio) {
10327
- aScale = max$3(abs$7(correctScaleX), abs$7(correctScaleY));
10327
+ aScale = max$3(abs$8(correctScaleX), abs$8(correctScaleY));
10328
10328
  correctScaleX = sign$2(correctScaleX) * aScale;
10329
10329
  correctScaleY = sign$2(correctScaleY) * aScale;
10330
10330
  }
@@ -12037,12 +12037,12 @@ const PaintModule = {
12037
12037
 
12038
12038
  let cache$1, box$2 = new Bounds;
12039
12039
 
12040
- const {isSame: isSame$1} = BoundsHelper;
12040
+ const {isSame: isSame$2} = BoundsHelper;
12041
12041
 
12042
12042
  function image(ui, attrName, paint, boxBounds, firstUse) {
12043
12043
  let leafPaint, event;
12044
12044
  const image = ImageManager.get(paint, paint.type);
12045
- if (cache$1 && paint === cache$1.paint && isSame$1(boxBounds, cache$1.boxBounds)) {
12045
+ if (cache$1 && paint === cache$1.paint && isSame$2(boxBounds, cache$1.boxBounds)) {
12046
12046
  leafPaint = cache$1.leafPaint;
12047
12047
  } else {
12048
12048
  leafPaint = {
@@ -12333,7 +12333,7 @@ function layout$3(transform, box, x, y, scaleX, scaleY, rotation, skew) {
12333
12333
 
12334
12334
  const {get: get$1, scale: scale$2, copy: copy$4} = MatrixHelper;
12335
12335
 
12336
- const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$6} = Math;
12336
+ const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$7} = Math;
12337
12337
 
12338
12338
  function createPatternTask(paint, ui, canvas, renderOptions) {
12339
12339
  if (!paint.patternTask) {
@@ -12357,8 +12357,8 @@ function createPattern(paint, ui, canvas, renderOptions) {
12357
12357
  width *= scaleX;
12358
12358
  height *= scaleY;
12359
12359
  if (gap) {
12360
- xGap = gap.x * scaleX / abs$6(data.scaleX || 1);
12361
- yGap = gap.y * scaleY / abs$6(data.scaleY || 1);
12360
+ xGap = gap.x * scaleX / abs$7(data.scaleX || 1);
12361
+ yGap = gap.y * scaleY / abs$7(data.scaleY || 1);
12362
12362
  }
12363
12363
  if (transform || scaleX !== 1 || scaleY !== 1) {
12364
12364
  scaleX *= getFloorScale(width + (xGap || 0));
@@ -12595,7 +12595,7 @@ const PaintGradientModule = {
12595
12595
  getTransform: getTransform
12596
12596
  };
12597
12597
 
12598
- const {copy: copy$3, move: move$6, toOffsetOutBounds: toOffsetOutBounds$1} = BoundsHelper, {max: max$2, abs: abs$5} = Math;
12598
+ const {copy: copy$3, move: move$6, toOffsetOutBounds: toOffsetOutBounds$1} = BoundsHelper, {max: max$2, abs: abs$6} = Math;
12599
12599
 
12600
12600
  const tempBounds$1 = {}, tempMatrix = new Matrix;
12601
12601
 
@@ -12639,7 +12639,7 @@ function shadow$1(ui, current, shape) {
12639
12639
  function getShadowRenderSpread(_ui, shadow) {
12640
12640
  let top = 0, right = 0, bottom = 0, left = 0, x, y, spread, blur;
12641
12641
  shadow.forEach(item => {
12642
- x = item.x || 0, y = item.y || 0, blur = (item.blur || 0) * 1.5, spread = abs$5(item.spread || 0);
12642
+ x = item.x || 0, y = item.y || 0, blur = (item.blur || 0) * 1.5, spread = abs$6(item.spread || 0);
12643
12643
  top = max$2(top, spread + blur - y);
12644
12644
  right = max$2(right, spread + blur + x);
12645
12645
  bottom = max$2(bottom, spread + blur + y);
@@ -13480,7 +13480,7 @@ function mergeConfigAttr() {
13480
13480
  };
13481
13481
  }
13482
13482
 
13483
- const {abs: abs$4} = Math;
13483
+ const {abs: abs$5} = Math;
13484
13484
 
13485
13485
  const {copy: copy$2} = MatrixHelper;
13486
13486
 
@@ -13523,7 +13523,7 @@ class Stroker extends UI {
13523
13523
  leaf = list[i];
13524
13524
  const {worldTransform: worldTransform, worldRenderBounds: worldRenderBounds} = leaf;
13525
13525
  if (worldRenderBounds.width && worldRenderBounds.height && (!bounds || bounds.hit(worldRenderBounds, options.matrix))) {
13526
- const aScaleX = abs$4(worldTransform.scaleX), aScaleY = abs$4(worldTransform.scaleY);
13526
+ const aScaleX = abs$5(worldTransform.scaleX), aScaleY = abs$5(worldTransform.scaleY);
13527
13527
  copy$2(matrix$1, worldTransform);
13528
13528
  matrix$1.half = strokeWidth % 2;
13529
13529
  canvas.setWorld(matrix$1, options.matrix);
@@ -13836,7 +13836,7 @@ class EditSelect extends Group {
13836
13836
 
13837
13837
  const {topLeft: topLeft$1, top: top$1, topRight: topRight$1, right: right$2, bottomRight: bottomRight, bottom: bottom$1, bottomLeft: bottomLeft, left: left$2} = Direction9;
13838
13838
 
13839
- const {toPoint: toPoint} = AroundHelper, {within: within$3, sign: sign$1} = MathHelper, {abs: abs$3} = Math;
13839
+ const {toPoint: toPoint} = AroundHelper, {within: within$3, sign: sign$1} = MathHelper, {abs: abs$4} = Math;
13840
13840
 
13841
13841
  const EditDataHelper = {
13842
13842
  getScaleData(target, startBounds, direction, totalMoveOrScale, lockRatio, around, flipable, scaleMode) {
@@ -13922,7 +13922,7 @@ const EditDataHelper = {
13922
13922
  break;
13923
13923
 
13924
13924
  default:
13925
- lockScale = Math.sqrt(abs$3(scaleX * scaleY));
13925
+ lockScale = Math.sqrt(abs$4(scaleX * scaleY));
13926
13926
  scaleX = sign$1(scaleX) * lockScale;
13927
13927
  scaleY = sign$1(scaleY) * lockScale;
13928
13928
  }
@@ -13955,10 +13955,10 @@ const EditDataHelper = {
13955
13955
  const nowHeight = boxBounds.height * target.scaleY;
13956
13956
  scaleY = within$3(nowHeight * scaleY, heightRange) / nowHeight;
13957
13957
  }
13958
- if (useScaleX && abs$3(scaleX * worldBoxBounds.width) < 1) scaleX = sign$1(scaleX) / worldBoxBounds.width;
13959
- if (useScaleY && abs$3(scaleY * worldBoxBounds.height) < 1) scaleY = sign$1(scaleY) / worldBoxBounds.height;
13958
+ if (useScaleX && abs$4(scaleX * worldBoxBounds.width) < 1) scaleX = sign$1(scaleX) / worldBoxBounds.width;
13959
+ if (useScaleY && abs$4(scaleY * worldBoxBounds.height) < 1) scaleY = sign$1(scaleY) / worldBoxBounds.height;
13960
13960
  if (lockRatio && scaleX !== scaleY) {
13961
- lockScale = Math.min(abs$3(scaleX), abs$3(scaleY));
13961
+ lockScale = Math.min(abs$4(scaleX), abs$4(scaleY));
13962
13962
  scaleX = sign$1(scaleX) * lockScale;
13963
13963
  scaleY = sign$1(scaleY) * lockScale;
13964
13964
  }
@@ -16313,7 +16313,7 @@ const MultiTouchHelper = {
16313
16313
 
16314
16314
  const M$4 = MultiTouchHelper;
16315
16315
 
16316
- const {abs: abs$2, max: max$1} = Math, {sign: sign, within: within$2} = MathHelper;
16316
+ const {abs: abs$3, max: max$1} = Math, {sign: sign, within: within$2} = MathHelper;
16317
16317
 
16318
16318
  const WheelEventHelper = {
16319
16319
  getMove(event, config) {
@@ -16323,7 +16323,7 @@ const WheelEventHelper = {
16323
16323
  deltaX = deltaY;
16324
16324
  deltaY = 0;
16325
16325
  }
16326
- const absX = abs$2(deltaX), absY = abs$2(deltaY);
16326
+ const absX = abs$3(deltaX), absY = abs$3(deltaY);
16327
16327
  if (absX > 50) deltaX = max$1(50, absX / 3) * sign(deltaX);
16328
16328
  if (absY > 50) deltaY = max$1(50, absY / 3) * sign(deltaY);
16329
16329
  return {
@@ -16345,7 +16345,7 @@ const WheelEventHelper = {
16345
16345
  if (zoom) {
16346
16346
  zoomSpeed = within$2(zoomSpeed, 0, 1);
16347
16347
  const min = event.deltaY ? config.delta.y : config.delta.x;
16348
- const absScale = within$2(1 - abs$2(delta) / (min * 4) * zoomSpeed, .5, 2);
16348
+ const absScale = within$2(1 - abs$3(delta) / (min * 4) * zoomSpeed, .5, 2);
16349
16349
  scale = delta > 0 ? absScale : 1 / absScale;
16350
16350
  }
16351
16351
  return scale;
@@ -16584,7 +16584,7 @@ interaction.multiTouch = function(data, list) {
16584
16584
 
16585
16585
  const dragger = Dragger.prototype;
16586
16586
 
16587
- const {abs: abs$1, min: min, max: max, hypot: hypot} = Math;
16587
+ const {abs: abs$2, min: min, max: max, hypot: hypot} = Math;
16588
16588
 
16589
16589
  dragger.checkDragEndAnimate = function(data) {
16590
16590
  const {interaction: interaction} = this;
@@ -16613,7 +16613,7 @@ dragger.checkDragEndAnimate = function(data) {
16613
16613
  moveX *= boost;
16614
16614
  moveY *= boost;
16615
16615
  }
16616
- const maxAbs = max(abs$1(moveX), abs$1(moveY));
16616
+ const maxAbs = max(abs$2(moveX), abs$2(moveY));
16617
16617
  if (maxAbs > maxMove) {
16618
16618
  s = maxMove / maxAbs;
16619
16619
  moveX *= s;
@@ -16623,7 +16623,7 @@ dragger.checkDragEndAnimate = function(data) {
16623
16623
  moveX *= inertia;
16624
16624
  moveY *= inertia;
16625
16625
  data = Object.assign({}, data);
16626
- if (abs$1(moveX) < stopMove && abs$1(moveY) < stopMove) return this.dragEndReal(data);
16626
+ if (abs$2(moveX) < stopMove && abs$2(moveY) < stopMove) return this.dragEndReal(data);
16627
16627
  PointHelper.move(data, moveX, moveY);
16628
16628
  this.drag(data);
16629
16629
  this.animate(step);
@@ -17213,7 +17213,7 @@ function getArrowPath(ui, arrow, from, to, size, connectOffset, hasDashPattern)
17213
17213
 
17214
17214
  const {M: M$2, L: L$2, C: C$2, Q: Q, Z: Z$2, N: N, D: D, X: X, G: G, F: F, O: O, P: P, U: U} = PathCommandMap;
17215
17215
 
17216
- const {copy: copy, copyFrom: copyFrom, getDistancePoint: getDistancePoint, isSame: isSame} = PointHelper;
17216
+ const {copy: copy, copyFrom: copyFrom, getDistancePoint: getDistancePoint, isSame: isSame$1} = PointHelper;
17217
17217
 
17218
17218
  const {stintSet: stintSet$1} = DataHelper;
17219
17219
 
@@ -17307,7 +17307,7 @@ const PathArrowModule = {
17307
17307
  }
17308
17308
  count++;
17309
17309
  if (count === 1 && command !== M$2) return;
17310
- if (count === 2 && useStartArrow) copy(second, command === L$2 ? now : isSame(old, first) ? last : old);
17310
+ if (count === 2 && useStartArrow) copy(second, command === L$2 ? now : isSame$1(old, first) ? last : old);
17311
17311
  if (i === len) {
17312
17312
  const path = uData.__pathForRender = clonePathForArrow ? [ ...data ] : data;
17313
17313
  if (useStartArrow) {
@@ -17321,7 +17321,7 @@ const PathArrowModule = {
17321
17321
  }
17322
17322
  }
17323
17323
  if (endArrow && endArrow !== "none") {
17324
- if (isSame(last, now)) copy(last, old);
17324
+ if (isSame$1(last, now)) copy(last, old);
17325
17325
  endArrowPath = getArrowPath(ui, endArrow, last, now, strokeWidth, connectPoint, !!dashPattern);
17326
17326
  singleEndArrow = endArrowPath.fill || dashPattern;
17327
17327
  if (!singleEndArrow) path.push(...endArrowPath.data);
@@ -17937,7 +17937,7 @@ box$1.__updateBoxBounds = function(secondLayout) {
17937
17937
  }
17938
17938
  };
17939
17939
 
17940
- const {cos: cos, sin: sin, pow: pow, sqrt: sqrt$1, abs: abs, ceil: ceil, floor: floor, round: round$2, PI: PI} = Math;
17940
+ const {cos: cos, sin: sin, pow: pow, sqrt: sqrt$1, abs: abs$1, ceil: ceil, floor: floor, round: round$2, PI: PI} = Math;
17941
17941
 
17942
17942
  const PIx5 = PI * 5;
17943
17943
 
@@ -17975,7 +17975,7 @@ function cubicBezier(x1, y1, x2, y2) {
17975
17975
  o = 1 - v;
17976
17976
  x = bezier(v, x1, x2) - t;
17977
17977
  dx = 3 * o * o * x1 + 6 * o * v * (x2 - x1) + 3 * v * v * (1 - x2);
17978
- if (abs(dx) < 1e-6) break;
17978
+ if (abs$1(dx) < 1e-6) break;
17979
17979
  v -= x / dx;
17980
17980
  }
17981
17981
  return cache[key] = bezier(v, y1, y2);
@@ -20834,7 +20834,7 @@ function getCorrectT(d, x, y, x1, y1, x2, y2, toX, toY) {
20834
20834
  return Math.max(0, Math.min(.5, t));
20835
20835
  }
20836
20836
 
20837
- const {M: M, L: L, C: C, Z: Z} = PathCommandMap;
20837
+ const {M: M, L: L, C: C, Z: Z} = PathCommandMap, {abs: abs} = Math;
20838
20838
 
20839
20839
  const {getCenterX: getCenterX, getCenterY: getCenterY} = PointHelper;
20840
20840
 
@@ -20842,7 +20842,7 @@ const {arcTo: arcTo} = PathCommandDataHelper;
20842
20842
 
20843
20843
  PathCorner.smooth = function smooth(data, cornerRadius, _cornerSmoothing) {
20844
20844
  const radius = data.radius;
20845
- if (isNeedConvert(data)) data = PathConvert.toCanvasData(data, true);
20845
+ if (isNeedConvert(data)) data = PathConvert.toCanvasData(data, true); else data = [ ...data ];
20846
20846
  let command, lastCommand, commandLen;
20847
20847
  let i = 0, countCommand = 0, x = 0, y = 0, startX = 0, startY = 0, startR = 0, secondX = 0, secondY = 0, lastX = 0, lastY = 0, r, x1, y1, x2, y2, toX, toY;
20848
20848
  if (isArray(cornerRadius)) cornerRadius = cornerRadius[0] || 0;
@@ -20928,6 +20928,9 @@ PathCorner.smooth = function smooth(data, cornerRadius, _cornerSmoothing) {
20928
20928
  toX = startX, toY = startY;
20929
20929
  setBeforeC(smooth, r, lastX, lastY, x1, y1, x2, y2, x, y, toX, toY, three);
20930
20930
  break;
20931
+
20932
+ default:
20933
+ smooth.push(C, x1, y1, x2, y2, x, y);
20931
20934
  }
20932
20935
  lastX = x;
20933
20936
  lastY = y;
@@ -21017,7 +21020,16 @@ function findEndPoint(data, i) {
21017
21020
  }
21018
21021
 
21019
21022
  function setAfterC(data, i, cornerRadius, lastX, lastY, fromX, fromY, x1, y1, x2, y2, toX, toY) {
21020
- const d = getTangentDistance(cornerRadius, fromX, fromY, lastX, lastY, x1, y1);
21023
+ let targetX = x1, targetY = y1;
21024
+ if (isSame(x1, fromX) && isSame(y1, fromY)) {
21025
+ targetX = x2;
21026
+ targetY = y2;
21027
+ if (isSame(x2, fromX) && isSame(y2, fromY)) {
21028
+ targetX = toX;
21029
+ targetY = toY;
21030
+ }
21031
+ }
21032
+ const d = getTangentDistance(cornerRadius, fromX, fromY, lastX, lastY, targetX, targetY);
21021
21033
  const t = getCorrectT(d, fromX, fromY, x1, y1, x2, y2, toX, toY);
21022
21034
  const two = BezierHelper.cut(t, fromX, fromY, x1, y1, x2, y2, toX, toY);
21023
21035
  const {left: left, right: right} = two;
@@ -21031,7 +21043,16 @@ function setAfterC(data, i, cornerRadius, lastX, lastY, fromX, fromY, x1, y1, x2
21031
21043
  }
21032
21044
 
21033
21045
  function setBeforeC(smooth, cornerRadius, fromX, fromY, x1, y1, x2, y2, toX, toY, nextX, nextY, three) {
21034
- const d = getTangentDistance(cornerRadius, toX, toY, x2, y2, nextX, nextY);
21046
+ let targetX = x2, targetY = y2;
21047
+ if (isSame(targetX, toX) && isSame(targetY, toY)) {
21048
+ targetX = x1;
21049
+ targetY = y1;
21050
+ if (isSame(targetX, toX) && isSame(targetY, toY)) {
21051
+ targetX = fromX;
21052
+ targetY = fromY;
21053
+ }
21054
+ }
21055
+ const d = getTangentDistance(cornerRadius, toX, toY, targetX, targetY, nextX, nextY);
21035
21056
  const t = getCorrectT(d, toX, toY, x2, y2, x1, y1, fromX, fromY);
21036
21057
  const {left: left, right: right} = BezierHelper.cut(1 - t, fromX, fromY, x1, y1, x2, y2, toX, toY);
21037
21058
  if (left && right) {
@@ -21042,6 +21063,10 @@ function setBeforeC(smooth, cornerRadius, fromX, fromY, x1, y1, x2, y2, toX, toY
21042
21063
  }
21043
21064
  }
21044
21065
 
21066
+ function isSame(a, b) {
21067
+ return abs(a - b) < .01;
21068
+ }
21069
+
21045
21070
  Plugin.add("corner");
21046
21071
 
21047
21072
  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 };