@leafer-draw/worker 2.2.3 → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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);
@@ -4770,7 +4773,7 @@ function useModule(module, exclude) {
4770
4773
  if (!excludeNames.includes(name) && (!exclude || !exclude.includes(name))) {
4771
4774
  if (module.prototype) {
4772
4775
  const d = getDescriptor(module.prototype, name);
4773
- if (d.writable) target.prototype[name] = module.prototype[name];
4776
+ if (d) Object.defineProperty(target.prototype, name, d);
4774
4777
  } else {
4775
4778
  target.prototype[name] = module[name];
4776
4779
  }
@@ -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.5";
7024
7027
 
7025
7028
  class LeaferCanvas extends LeaferCanvasBase {
7026
7029
  get allowBackgroundColor() {
@@ -9160,34 +9163,28 @@ let Ellipse = class Ellipse extends UI {
9160
9163
  if (hasAngle) closedAngle = abs$2(endAngle - startAngle) === 360;
9161
9164
  if (innerRadius) {
9162
9165
  const drawInnerEllipse = innerRadius < 1 || closed;
9163
- let outerStartAngle = startAngle, outerEndAngle = endAngle, outerAnticlockwise;
9166
+ const innerRx = rx * innerRadius, innerRy = ry * innerRadius;
9164
9167
  if (hasAngle) {
9168
+ ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle);
9165
9169
  if (drawInnerEllipse) {
9166
- ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle);
9167
9170
  if (closedAngle) {
9168
- set$1(tempPoint, width, ry);
9169
- set$1(tempCenter, rx, ry);
9171
+ closePath$2(path);
9172
+ set$1(tempPoint, rx + innerRx, ry), set$1(tempCenter, rx, ry);
9170
9173
  rotate$2(tempPoint, endAngle, tempCenter, rx, ry);
9171
9174
  moveTo$3(path, tempPoint.x, tempPoint.y);
9172
9175
  }
9173
- outerStartAngle = endAngle;
9174
- outerEndAngle = startAngle;
9175
- outerAnticlockwise = true;
9176
+ ellipse(path, rx, ry, innerRx, innerRy, 0, endAngle, startAngle, true);
9176
9177
  } else {
9177
9178
  if (!closedAngle) open = true;
9178
9179
  }
9179
9180
  } else {
9181
+ ellipse(path, rx, ry, rx, ry);
9180
9182
  if (drawInnerEllipse) {
9181
- ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
9182
9183
  closePath$2(path);
9183
- moveTo$3(path, width, ry);
9184
- outerStartAngle = 360;
9185
- outerAnticlockwise = true;
9186
- } else {
9187
- outerEndAngle = 360;
9184
+ moveTo$3(path, rx + innerRx, ry);
9185
+ ellipse(path, rx, ry, innerRx, innerRy, 0, 360, 0, true);
9188
9186
  }
9189
9187
  }
9190
- ellipse(path, rx, ry, rx, ry, 0, outerStartAngle, outerEndAngle, outerAnticlockwise);
9191
9188
  } else {
9192
9189
  if (hasAngle) {
9193
9190
  if (!closedAngle) {