@leafer-draw/miniapp 2.2.3 → 2.2.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.
@@ -2816,7 +2816,10 @@ const BezierHelper = {
2816
2816
  if (endRadian < 0) endRadian += PI2;
2817
2817
  let totalRadian = endRadian - startRadian;
2818
2818
  if (totalRadian < 0) totalRadian += PI2; else if (totalRadian > PI2) totalRadian -= PI2;
2819
- if (anticlockwise) totalRadian -= PI2;
2819
+ if (anticlockwise) {
2820
+ const closedAngle = abs$4(endAngle - startAngle) === 360;
2821
+ if (closedAngle) totalRadian = -PI2; else totalRadian -= PI2;
2822
+ }
2820
2823
  const parts = ceil(abs$4(totalRadian / PI_2));
2821
2824
  const partRadian = totalRadian / parts;
2822
2825
  const partRadian4Sin = sin$3(partRadian / 4);
@@ -6802,11 +6805,11 @@ let Branch = class Branch extends Leaf {
6802
6805
  childLayout.boxChanged || childLayout.boxChange();
6803
6806
  childLayout.matrixChanged || childLayout.matrixChange();
6804
6807
  if (child.__bubbleMap) child.__emitLifeEvent(ChildEvent.ADD);
6808
+ if (this.isFrame) child.__bindFrame(this);
6805
6809
  if (this.leafer) {
6806
6810
  child.__bindLeafer(this.leafer);
6807
6811
  if (this.leafer.created) this.__emitChildEvent(ChildEvent.ADD, child);
6808
6812
  }
6809
- if (this.isFrame) child.__bindFrame(this);
6810
6813
  this.__layout.affectChildrenSort && this.__layout.childrenSortChange();
6811
6814
  }
6812
6815
  addMany(...children) {
@@ -7020,7 +7023,7 @@ class LeafLevelList {
7020
7023
  }
7021
7024
  }
7022
7025
 
7023
- const version = "2.2.3";
7026
+ const version = "2.2.4";
7024
7027
 
7025
7028
  class LeaferCanvas extends LeaferCanvasBase {
7026
7029
  get allowBackgroundColor() {
@@ -9319,34 +9322,28 @@ let Ellipse = class Ellipse extends UI {
9319
9322
  if (hasAngle) closedAngle = abs$2(endAngle - startAngle) === 360;
9320
9323
  if (innerRadius) {
9321
9324
  const drawInnerEllipse = innerRadius < 1 || closed;
9322
- let outerStartAngle = startAngle, outerEndAngle = endAngle, outerAnticlockwise;
9325
+ const innerRx = rx * innerRadius, innerRy = ry * innerRadius;
9323
9326
  if (hasAngle) {
9327
+ ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle);
9324
9328
  if (drawInnerEllipse) {
9325
- ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle);
9326
9329
  if (closedAngle) {
9327
- set$1(tempPoint, width, ry);
9328
- set$1(tempCenter, rx, ry);
9330
+ closePath$2(path);
9331
+ set$1(tempPoint, rx + innerRx, ry), set$1(tempCenter, rx, ry);
9329
9332
  rotate$2(tempPoint, endAngle, tempCenter, rx, ry);
9330
9333
  moveTo$3(path, tempPoint.x, tempPoint.y);
9331
9334
  }
9332
- outerStartAngle = endAngle;
9333
- outerEndAngle = startAngle;
9334
- outerAnticlockwise = true;
9335
+ ellipse(path, rx, ry, innerRx, innerRy, 0, endAngle, startAngle, true);
9335
9336
  } else {
9336
9337
  if (!closedAngle) open = true;
9337
9338
  }
9338
9339
  } else {
9340
+ ellipse(path, rx, ry, rx, ry);
9339
9341
  if (drawInnerEllipse) {
9340
- ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
9341
9342
  closePath$2(path);
9342
- moveTo$3(path, width, ry);
9343
- outerStartAngle = 360;
9344
- outerAnticlockwise = true;
9345
- } else {
9346
- outerEndAngle = 360;
9343
+ moveTo$3(path, rx + innerRx, ry);
9344
+ ellipse(path, rx, ry, innerRx, innerRy, 0, 360, 0, true);
9347
9345
  }
9348
9346
  }
9349
- ellipse(path, rx, ry, rx, ry, 0, outerStartAngle, outerEndAngle, outerAnticlockwise);
9350
9347
  } else {
9351
9348
  if (hasAngle) {
9352
9349
  if (!closedAngle) {