@leafer-draw/worker 2.1.6 → 2.1.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.
package/dist/worker.js CHANGED
@@ -268,7 +268,7 @@ var LeaferUI = function(exports) {
268
268
  return to;
269
269
  },
270
270
  setTemp(top, right, bottom, left) {
271
- return set$2(tempFour, top, right, bottom, left);
271
+ return set$3(tempFour, top, right, bottom, left);
272
272
  },
273
273
  toTempAB(a, b, change) {
274
274
  tempTo = change ? isNumber(a) ? b : a : [];
@@ -308,21 +308,21 @@ var LeaferUI = function(exports) {
308
308
  max(t, other, change) {
309
309
  if (isNumber(t) && isNumber(other)) return max$4(t, other);
310
310
  toTempAB(t, other, change);
311
- return set$2(tempTo, max$4(tempA[0], tempB[0]), max$4(tempA[1], tempB[1]), max$4(tempA[2], tempB[2]), max$4(tempA[3], tempB[3]));
311
+ return set$3(tempTo, max$4(tempA[0], tempB[0]), max$4(tempA[1], tempB[1]), max$4(tempA[2], tempB[2]), max$4(tempA[3], tempB[3]));
312
312
  },
313
313
  add(t, other, change) {
314
314
  if (isNumber(t) && isNumber(other)) return t + other;
315
315
  toTempAB(t, other, change);
316
- return set$2(tempTo, tempA[0] + tempB[0], tempA[1] + tempB[1], tempA[2] + tempB[2], tempA[3] + tempB[3]);
316
+ return set$3(tempTo, tempA[0] + tempB[0], tempA[1] + tempB[1], tempA[2] + tempB[2], tempA[3] + tempB[3]);
317
317
  },
318
318
  swapAndScale(t, scaleX, scaleY, change) {
319
319
  if (isNumber(t)) return scaleX === scaleY ? t * scaleX : [ t * scaleY, t * scaleX ];
320
320
  const to = change ? t : [];
321
321
  const [top, right, bottom, left] = t.length === 4 ? t : get$5(t);
322
- return set$2(to, bottom * scaleY, left * scaleX, top * scaleY, right * scaleX);
322
+ return set$3(to, bottom * scaleY, left * scaleX, top * scaleY, right * scaleX);
323
323
  }
324
324
  };
325
- const {set: set$2, get: get$5, setTemp: setTemp, toTempAB: toTempAB} = FourNumberHelper;
325
+ const {set: set$3, get: get$5, setTemp: setTemp, toTempAB: toTempAB} = FourNumberHelper;
326
326
  const {round: round$3, pow: pow$1, max: max$3, floor: floor$2, PI: PI$3} = Math;
327
327
  const tempScaleData$1 = {};
328
328
  const MathHelper = {
@@ -434,7 +434,7 @@ var LeaferUI = function(exports) {
434
434
  }
435
435
  const {sin: sin$5, cos: cos$5, acos: acos, sqrt: sqrt$3} = Math;
436
436
  const {float: float$2} = MathHelper;
437
- const tempPoint$3 = {};
437
+ const tempPoint$4 = {};
438
438
  function getWorld() {
439
439
  return Object.assign(Object.assign(Object.assign({}, getMatrixData()), getBoundsData()), {
440
440
  scaleX: 1,
@@ -491,8 +491,8 @@ var LeaferUI = function(exports) {
491
491
  to.f = t.f * pixelRatio;
492
492
  },
493
493
  scaleOfOuter(t, origin, scaleX, scaleY) {
494
- M$6.toInnerPoint(t, origin, tempPoint$3);
495
- M$6.scaleOfInner(t, tempPoint$3, scaleX, scaleY);
494
+ M$6.toInnerPoint(t, origin, tempPoint$4);
495
+ M$6.scaleOfInner(t, tempPoint$4, scaleX, scaleY);
496
496
  },
497
497
  scaleOfInner(t, origin, scaleX, scaleY = scaleX) {
498
498
  M$6.translateInner(t, origin.x, origin.y);
@@ -510,8 +510,8 @@ var LeaferUI = function(exports) {
510
510
  t.d = c * sinR + d * cosR;
511
511
  },
512
512
  rotateOfOuter(t, origin, rotation) {
513
- M$6.toInnerPoint(t, origin, tempPoint$3);
514
- M$6.rotateOfInner(t, tempPoint$3, rotation);
513
+ M$6.toInnerPoint(t, origin, tempPoint$4);
514
+ M$6.rotateOfInner(t, tempPoint$4, rotation);
515
515
  },
516
516
  rotateOfInner(t, origin, rotation) {
517
517
  M$6.translateInner(t, origin.x, origin.y);
@@ -532,8 +532,8 @@ var LeaferUI = function(exports) {
532
532
  }
533
533
  },
534
534
  skewOfOuter(t, origin, skewX, skewY) {
535
- M$6.toInnerPoint(t, origin, tempPoint$3);
536
- M$6.skewOfInner(t, tempPoint$3, skewX, skewY);
535
+ M$6.toInnerPoint(t, origin, tempPoint$4);
536
+ M$6.skewOfInner(t, tempPoint$4, skewX, skewY);
537
537
  },
538
538
  skewOfInner(t, origin, skewX, skewY = 0) {
539
539
  M$6.translateInner(t, origin.x, origin.y);
@@ -730,7 +730,7 @@ var LeaferUI = function(exports) {
730
730
  const M$6 = MatrixHelper;
731
731
  const {float: float$1} = MathHelper;
732
732
  const {toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3} = MatrixHelper;
733
- const {sin: sin$4, cos: cos$4, abs: abs$4, sqrt: sqrt$2, atan2: atan2$2, min: min$1, round: round$2} = Math;
733
+ const {sin: sin$4, cos: cos$4, abs: abs$5, sqrt: sqrt$2, atan2: atan2$2, min: min$1, round: round$2} = Math;
734
734
  const PointHelper = {
735
735
  defaultPoint: getPointData(),
736
736
  tempPoint: {},
@@ -766,15 +766,15 @@ var LeaferUI = function(exports) {
766
766
  t.x += (t.x - origin.x) * (scaleX - 1);
767
767
  t.y += (t.y - origin.y) * (scaleY - 1);
768
768
  },
769
- rotate(t, rotation, origin) {
769
+ rotate(t, rotation, origin, radiusX = 1, radiusY = 1) {
770
770
  if (!origin) origin = P$5.defaultPoint;
771
771
  rotation *= OneRadian;
772
772
  const cosR = cos$4(rotation);
773
773
  const sinR = sin$4(rotation);
774
- const rx = t.x - origin.x;
775
- const ry = t.y - origin.y;
776
- t.x = origin.x + rx * cosR - ry * sinR;
777
- t.y = origin.y + rx * sinR + ry * cosR;
774
+ const rx = (t.x - origin.x) / radiusX;
775
+ const ry = (t.y - origin.y) / radiusY;
776
+ t.x = origin.x + (rx * cosR - ry * sinR) * radiusX;
777
+ t.y = origin.y + (rx * sinR + ry * cosR) * radiusY;
778
778
  },
779
779
  tempToInnerOf(t, matrix) {
780
780
  const {tempPoint: temp} = P$5;
@@ -827,15 +827,15 @@ var LeaferUI = function(exports) {
827
827
  return getDistanceFrom(t.x, t.y, point.x, point.y);
828
828
  },
829
829
  getDistanceFrom(x1, y1, x2, y2) {
830
- const x = abs$4(x2 - x1);
831
- const y = abs$4(y2 - y1);
830
+ const x = abs$5(x2 - x1);
831
+ const y = abs$5(y2 - y1);
832
832
  return sqrt$2(x * x + y * y);
833
833
  },
834
834
  getMinDistanceFrom(x1, y1, x2, y2, x3, y3) {
835
835
  return min$1(getDistanceFrom(x1, y1, x2, y2), getDistanceFrom(x2, y2, x3, y3));
836
836
  },
837
- getAngle(t, to) {
838
- return getAtan2(t, to) / OneRadian;
837
+ getAngle(t, to, radiusX, radiusY) {
838
+ return getAtan2(t, to, radiusX, radiusY) / OneRadian;
839
839
  },
840
840
  getRotation(t, origin, to, toOrigin) {
841
841
  if (!toOrigin) toOrigin = origin;
@@ -849,8 +849,8 @@ var LeaferUI = function(exports) {
849
849
  const d = toY - toOriginY;
850
850
  return Math.atan2(a * d - b * c, a * c + b * d);
851
851
  },
852
- getAtan2(t, to) {
853
- return atan2$2(to.y - t.y, to.x - t.x);
852
+ getAtan2(t, to, radiusX = 1, radiusY = 1) {
853
+ return atan2$2((to.y - t.y) / radiusY, (to.x - t.x) / radiusX);
854
854
  },
855
855
  getDistancePoint(t, to, distance, changeTo, fromTo) {
856
856
  const r = getAtan2(t, to);
@@ -904,12 +904,12 @@ var LeaferUI = function(exports) {
904
904
  PointHelper.scaleOf(this, origin, scaleX, scaleY);
905
905
  return this;
906
906
  }
907
- rotate(rotation, origin) {
908
- PointHelper.rotate(this, rotation, origin);
907
+ rotate(rotation, origin, radiusX, radiusY) {
908
+ PointHelper.rotate(this, rotation, origin, radiusX, radiusY);
909
909
  return this;
910
910
  }
911
- rotateOf(origin, rotation) {
912
- PointHelper.rotate(this, rotation, origin);
911
+ rotateOf(origin, rotation, radiusX, radiusY) {
912
+ PointHelper.rotate(this, rotation, origin, radiusX, radiusY);
913
913
  return this;
914
914
  }
915
915
  getRotation(origin, to, toOrigin) {
@@ -932,11 +932,11 @@ var LeaferUI = function(exports) {
932
932
  getDistancePoint(to, distance, changeTo, fromTo) {
933
933
  return new Point(PointHelper.getDistancePoint(this, to, distance, changeTo, fromTo));
934
934
  }
935
- getAngle(to) {
936
- return PointHelper.getAngle(this, to);
935
+ getAngle(to, radiusX, radiusY) {
936
+ return PointHelper.getAngle(this, to, radiusX, radiusY);
937
937
  }
938
- getAtan2(to) {
939
- return PointHelper.getAtan2(this, to);
938
+ getAtan2(to, radiusX, radiusY) {
939
+ return PointHelper.getAtan2(this, to, radiusX, radiusY);
940
940
  }
941
941
  isSame(point, quick) {
942
942
  return PointHelper.isSame(this, point, quick);
@@ -946,7 +946,7 @@ var LeaferUI = function(exports) {
946
946
  return this;
947
947
  }
948
948
  }
949
- const tempPoint$2 = new Point;
949
+ const tempPoint$3 = new Point;
950
950
  class Matrix {
951
951
  constructor(a, b, c, d, e, f) {
952
952
  this.set(a, b, c, d, e, f);
@@ -2520,11 +2520,11 @@ var LeaferUI = function(exports) {
2520
2520
  data[0] ? drawer.arcTo(x, y, right, y, data[0]) : drawer.lineTo(x, y);
2521
2521
  }
2522
2522
  };
2523
- const {sin: sin$3, cos: cos$3, hypot: hypot, atan2: atan2$1, ceil: ceil, abs: abs$3, PI: PI$2, sqrt: sqrt$1, pow: pow} = Math;
2523
+ const {sin: sin$3, cos: cos$3, hypot: hypot, atan2: atan2$1, ceil: ceil, abs: abs$4, PI: PI$2, sqrt: sqrt$1, pow: pow} = Math;
2524
2524
  const {setPoint: setPoint$1, addPoint: addPoint$1} = TwoPointBoundsHelper;
2525
- const {set: set$1, toNumberPoints: toNumberPoints} = PointHelper;
2525
+ const {set: set$2, toNumberPoints: toNumberPoints} = PointHelper;
2526
2526
  const {M: M$5, L: L$6, C: C$4, Q: Q$4, Z: Z$5} = PathCommandMap;
2527
- const tempPoint$1 = {};
2527
+ const tempPoint$2 = {};
2528
2528
  const BezierHelper = {
2529
2529
  points(data, originPoints, curve, close) {
2530
2530
  let points = toNumberPoints(originPoints);
@@ -2592,14 +2592,14 @@ var LeaferUI = function(exports) {
2592
2592
  const lenCB = hypot(CBx, CBy);
2593
2593
  let totalRadian = endRadian - startRadian;
2594
2594
  if (totalRadian < 0) totalRadian += PI2;
2595
- if (lenBA < 1e-12 || lenCB < 1e-12 || totalRadian < 1e-12 || abs$3(totalRadian - PI$2) < 1e-12) {
2595
+ if (lenBA < 1e-12 || lenCB < 1e-12 || totalRadian < 1e-12 || abs$4(totalRadian - PI$2) < 1e-12) {
2596
2596
  if (data) data.push(L$6, x1, y1);
2597
2597
  if (setPointBounds) {
2598
2598
  setPoint$1(setPointBounds, fromX, fromY);
2599
2599
  addPoint$1(setPointBounds, x1, y1);
2600
2600
  }
2601
- if (setStartPoint) set$1(setStartPoint, fromX, fromY);
2602
- if (setEndPoint) set$1(setEndPoint, x1, y1);
2601
+ if (setStartPoint) set$2(setStartPoint, fromX, fromY);
2602
+ if (setEndPoint) set$2(setEndPoint, x1, y1);
2603
2603
  return;
2604
2604
  }
2605
2605
  const anticlockwise = BAx * CBy - CBx * BAy < 0;
@@ -2625,7 +2625,7 @@ var LeaferUI = function(exports) {
2625
2625
  let totalRadian = endRadian - startRadian;
2626
2626
  if (totalRadian < 0) totalRadian += PI2; else if (totalRadian > PI2) totalRadian -= PI2;
2627
2627
  if (anticlockwise) totalRadian -= PI2;
2628
- const parts = ceil(abs$3(totalRadian / PI_2));
2628
+ const parts = ceil(abs$4(totalRadian / PI_2));
2629
2629
  const partRadian = totalRadian / parts;
2630
2630
  const partRadian4Sin = sin$3(partRadian / 4);
2631
2631
  const control = 8 / 3 * partRadian4Sin * partRadian4Sin / sin$3(partRadian / 2);
@@ -2639,7 +2639,7 @@ var LeaferUI = function(exports) {
2639
2639
  let fromX = cx + x, fromY = cy + y;
2640
2640
  if (data) data.push(data.length ? L$6 : M$5, fromX, fromY);
2641
2641
  if (setPointBounds) setPoint$1(setPointBounds, fromX, fromY);
2642
- if (setStartPoint) set$1(setStartPoint, fromX, fromY);
2642
+ if (setStartPoint) set$2(setStartPoint, fromX, fromY);
2643
2643
  for (let i = 0; i < parts; i++) {
2644
2644
  endCos = cos$3(endRadian);
2645
2645
  endSin = sin$3(endRadian);
@@ -2658,7 +2658,7 @@ var LeaferUI = function(exports) {
2658
2658
  startRadian = endRadian;
2659
2659
  endRadian += partRadian;
2660
2660
  }
2661
- if (setEndPoint) set$1(setEndPoint, cx + x, cy + y);
2661
+ if (setEndPoint) set$2(setEndPoint, cx + x, cy + y);
2662
2662
  },
2663
2663
  quadraticCurveTo(data, fromX, fromY, x1, y1, toX, toY) {
2664
2664
  data.push(C$4, (fromX + 2 * x1) / 3, (fromY + 2 * y1) / 3, (toX + 2 * x1) / 3, (toY + 2 * y1) / 3, toX, toY);
@@ -2694,8 +2694,8 @@ var LeaferUI = function(exports) {
2694
2694
  addMode ? addPoint$1(pointBounds, fromX, fromY) : setPoint$1(pointBounds, fromX, fromY);
2695
2695
  addPoint$1(pointBounds, toX, toY);
2696
2696
  for (let i = 0, len = tList.length; i < len; i++) {
2697
- getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$1);
2698
- addPoint$1(pointBounds, tempPoint$1.x, tempPoint$1.y);
2697
+ getPointAndSet(tList[i], fromX, fromY, x1, y1, x2, y2, toX, toY, tempPoint$2);
2698
+ addPoint$1(pointBounds, tempPoint$2.x, tempPoint$2.y);
2699
2699
  }
2700
2700
  },
2701
2701
  getPointAndSet(t, fromX, fromY, x1, y1, x2, y2, toX, toY, setPoint) {
@@ -3119,7 +3119,7 @@ var LeaferUI = function(exports) {
3119
3119
  const {current: current, pushData: pushData, copyData: copyData} = PathConvert;
3120
3120
  const {M: M$3, L: L$4, C: C$2, Q: Q$2, Z: Z$3, N: N$2, D: D$2, X: X$2, G: G$2, F: F$3, O: O$2, P: P$2, U: U$2} = PathCommandMap;
3121
3121
  const {getMinDistanceFrom: getMinDistanceFrom, getRadianFrom: getRadianFrom} = PointHelper;
3122
- const {tan: tan, min: min, abs: abs$2} = Math;
3122
+ const {tan: tan, min: min, abs: abs$3} = Math;
3123
3123
  const startPoint = {};
3124
3124
  const PathCommandDataHelper = {
3125
3125
  beginPath(data) {
@@ -3177,7 +3177,7 @@ var LeaferUI = function(exports) {
3177
3177
  arcTo(data, x1, y1, x2, y2, radius, lastX, lastY, fullRadius) {
3178
3178
  if (!isUndefined(lastX)) {
3179
3179
  const r = getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2) / (fullRadius ? 1 : 2);
3180
- radius = min(radius, min(r, r * abs$2(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
3180
+ radius = min(radius, min(r, r * abs$3(tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2))));
3181
3181
  }
3182
3182
  data.push(U$2, x1, y1, x2, y2, radius);
3183
3183
  },
@@ -4310,7 +4310,9 @@ var LeaferUI = function(exports) {
4310
4310
  set(value) {
4311
4311
  if (this.__setAttr(key, value)) {
4312
4312
  this.waitParent(() => {
4313
- this.parent.__layout.childrenSortChange();
4313
+ const {parent: parent} = this;
4314
+ parent.__layout.childrenSortChange();
4315
+ if (parent.__.flow) parent.__layout.boxChange();
4314
4316
  });
4315
4317
  }
4316
4318
  }
@@ -4691,7 +4693,7 @@ var LeaferUI = function(exports) {
4691
4693
  p = p.parent;
4692
4694
  }
4693
4695
  },
4694
- animateMove(t, move, speed = .3) {
4696
+ animateMove(t, move, speed = .3, onAnimate) {
4695
4697
  if (!move.x && !move.y) return;
4696
4698
  if (Math.abs(move.x) < 1 && Math.abs(move.y) < 1) {
4697
4699
  t.move(move);
@@ -4699,8 +4701,9 @@ var LeaferUI = function(exports) {
4699
4701
  const x = move.x * speed, y = move.y * speed;
4700
4702
  move.x -= x, move.y -= y;
4701
4703
  t.move(x, y);
4702
- Platform.requestRender(() => L.animateMove(t, move, speed));
4704
+ Platform.requestRender(() => L.animateMove(t, move, speed, onAnimate));
4703
4705
  }
4706
+ onAnimate && onAnimate();
4704
4707
  }
4705
4708
  };
4706
4709
  const L = LeafHelper;
@@ -5649,7 +5652,7 @@ var LeaferUI = function(exports) {
5649
5652
  }
5650
5653
  };
5651
5654
  const {setLayout: setLayout, multiplyParent: multiplyParent$2, translateInner: translateInner, defaultWorld: defaultWorld} = MatrixHelper;
5652
- const {toPoint: toPoint$3, tempPoint: tempPoint} = AroundHelper;
5655
+ const {toPoint: toPoint$3, tempPoint: tempPoint$1} = AroundHelper;
5653
5656
  const LeafMatrix = {
5654
5657
  __updateWorldMatrix() {
5655
5658
  const {parent: parent, __layout: __layout, __world: __world, __scrollWorld: __scrollWorld, __: __} = this;
@@ -5669,8 +5672,8 @@ var LeaferUI = function(exports) {
5669
5672
  local.e = data.x + data.offsetX;
5670
5673
  local.f = data.y + data.offsetY;
5671
5674
  if (data.around || data.origin) {
5672
- toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint);
5673
- translateInner(local, -tempPoint.x, -tempPoint.y, !data.around);
5675
+ toPoint$3(data.around || data.origin, layout.boxBounds, tempPoint$1);
5676
+ translateInner(local, -tempPoint$1.x, -tempPoint$1.y, !data.around);
5674
5677
  }
5675
5678
  }
5676
5679
  this.__layout.matrixChanged = undefined;
@@ -5774,6 +5777,7 @@ var LeaferUI = function(exports) {
5774
5777
  if (this.isBranch) {
5775
5778
  this.__extraUpdate();
5776
5779
  if (this.__.flow) {
5780
+ if (this.__layout.childrenSortChanged) this.__updateSortChildren();
5777
5781
  if (this.__layout.boxChanged) this.__updateFlowLayout();
5778
5782
  updateAllMatrix$2(this);
5779
5783
  updateBounds$1(this, this);
@@ -5842,11 +5846,7 @@ var LeaferUI = function(exports) {
5842
5846
  const {excludeRenderBounds: excludeRenderBounds$1} = LeafBoundsHelper, {hasSize: hasSize} = BoundsHelper;
5843
5847
  const BranchRender = {
5844
5848
  __updateChange() {
5845
- const {__layout: layout} = this;
5846
- if (layout.childrenSortChanged) {
5847
- this.__updateSortChildren();
5848
- layout.childrenSortChanged = false;
5849
- }
5849
+ if (this.__layout.childrenSortChanged) this.__updateSortChildren();
5850
5850
  this.__.__checkSingle();
5851
5851
  },
5852
5852
  __render(canvas, options) {
@@ -6336,6 +6336,7 @@ var LeaferUI = function(exports) {
6336
6336
  children.sort(sort);
6337
6337
  this.__layout.affectChildrenSort = affectSort;
6338
6338
  }
6339
+ this.__layout.childrenSortChanged = false;
6339
6340
  }
6340
6341
  add(child, index) {
6341
6342
  if (child === this || child.destroyed) return debug$4.warn("add self or destroyed");
@@ -6567,7 +6568,7 @@ var LeaferUI = function(exports) {
6567
6568
  this.levelMap = null;
6568
6569
  }
6569
6570
  }
6570
- const version = "2.1.6";
6571
+ const version = "2.1.8";
6571
6572
  class LeaferCanvas extends LeaferCanvasBase {
6572
6573
  get allowBackgroundColor() {
6573
6574
  return true;
@@ -7857,6 +7858,7 @@ var LeaferUI = function(exports) {
7857
7858
  this.set(keyframe);
7858
7859
  return Plugin.need("animate");
7859
7860
  }
7861
+ killAnimate(_type, _nextStyle) {}
7860
7862
  export(_filename, _options) {
7861
7863
  return Plugin.need("export");
7862
7864
  }
@@ -8504,31 +8506,55 @@ var LeaferUI = function(exports) {
8504
8506
  __decorate([ surfaceType("#FFFFFF") ], exports.Frame.prototype, "fill", void 0);
8505
8507
  __decorate([ affectRenderBoundsType("hide") ], exports.Frame.prototype, "overflow", void 0);
8506
8508
  exports.Frame = __decorate([ registerUI() ], exports.Frame);
8507
- const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse} = PathCommandDataHelper;
8509
+ const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse} = PathCommandDataHelper, {tempPoint: tempPoint, set: set$1, rotate: rotate$2} = PointHelper, {abs: abs$2} = Math, tempCenter = {};
8508
8510
  exports.Ellipse = class Ellipse extends exports.UI {
8509
8511
  get __tag() {
8510
8512
  return "Ellipse";
8511
8513
  }
8512
8514
  __updatePath() {
8513
- const data = this.__, {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle} = data;
8515
+ const data = this.__, {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle, closed: closed} = data;
8514
8516
  const rx = width / 2, ry = height / 2;
8515
8517
  const path = data.path = [];
8516
- let open;
8518
+ let open, hasAngle, closedAngle;
8519
+ if (startAngle || endAngle) hasAngle = true;
8520
+ if (hasAngle) closedAngle = abs$2(endAngle - startAngle) === 360;
8517
8521
  if (innerRadius) {
8518
- if (startAngle || endAngle) {
8519
- if (innerRadius < 1) ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false); else open = true;
8520
- ellipse(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
8522
+ const drawInnerEllipse = innerRadius < 1 || closed;
8523
+ let outerStartAngle = startAngle, outerEndAngle = endAngle, outerAnticlockwise;
8524
+ if (hasAngle) {
8525
+ if (drawInnerEllipse) {
8526
+ ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle);
8527
+ if (closedAngle) {
8528
+ set$1(tempPoint, width, ry);
8529
+ set$1(tempCenter, rx, ry);
8530
+ rotate$2(tempPoint, endAngle, tempCenter, rx, ry);
8531
+ moveTo$3(path, tempPoint.x, tempPoint.y);
8532
+ }
8533
+ outerStartAngle = endAngle;
8534
+ outerEndAngle = startAngle;
8535
+ outerAnticlockwise = true;
8536
+ } else {
8537
+ if (!closedAngle) open = true;
8538
+ }
8521
8539
  } else {
8522
- if (innerRadius < 1) {
8540
+ if (drawInnerEllipse) {
8523
8541
  ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
8542
+ closePath$2(path);
8524
8543
  moveTo$3(path, width, ry);
8544
+ outerStartAngle = 360;
8545
+ outerAnticlockwise = true;
8546
+ } else {
8547
+ outerEndAngle = 360;
8525
8548
  }
8526
- ellipse(path, rx, ry, rx, ry, 0, 360, 0, true);
8527
8549
  }
8550
+ ellipse(path, rx, ry, rx, ry, 0, outerStartAngle, outerEndAngle, outerAnticlockwise);
8528
8551
  } else {
8529
- if (startAngle || endAngle) {
8530
- moveTo$3(path, rx, ry);
8531
- ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
8552
+ if (hasAngle) {
8553
+ if (!closedAngle) {
8554
+ if (!closed) open = true;
8555
+ if (!open) moveTo$3(path, rx, ry);
8556
+ }
8557
+ ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle);
8532
8558
  } else {
8533
8559
  ellipse(path, rx, ry, rx, ry);
8534
8560
  }
@@ -9284,6 +9310,7 @@ var LeaferUI = function(exports) {
9284
9310
  if (data.__autoSide) {
9285
9311
  ui.forceUpdate("width");
9286
9312
  LeafHelper.updateBounds(ui);
9313
+ ui.__layout.boundsChanged = true;
9287
9314
  if (ui.__proxyData) {
9288
9315
  ui.setProxyAttr("width", data.width);
9289
9316
  ui.setProxyAttr("height", data.height);
@@ -9291,7 +9318,7 @@ var LeaferUI = function(exports) {
9291
9318
  needUpdate = false;
9292
9319
  }
9293
9320
  }
9294
- if (paint.mode === "brush") PaintImage.brush(leafPaint, ui, attrName);
9321
+ if (paint.mode === "brush") PaintImage.brush(ui, attrName, leafPaint);
9295
9322
  if (!leafPaint.data) {
9296
9323
  PaintImage.createData(leafPaint, image, paint, boxBounds);
9297
9324
  const {transform: transform} = leafPaint.data, {opacity: opacity} = paint;
@@ -10599,7 +10626,7 @@ var LeaferUI = function(exports) {
10599
10626
  exports.surfaceType = surfaceType;
10600
10627
  exports.tempBounds = tempBounds$2;
10601
10628
  exports.tempMatrix = tempMatrix$2;
10602
- exports.tempPoint = tempPoint$2;
10629
+ exports.tempPoint = tempPoint$3;
10603
10630
  exports.tryToNumber = tryToNumber;
10604
10631
  exports.useCanvas = useCanvas;
10605
10632
  exports.useModule = useModule;