leafer-ui 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$5(endAngle - startAngle) === 360;
2821
+ if (closedAngle) totalRadian = -PI2; else totalRadian -= PI2;
2822
+ }
2820
2823
  const parts = ceil(abs$5(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
  const debug$5 = Debug.get("LeaferCanvas");
7026
7029
 
@@ -9550,34 +9553,28 @@ let Ellipse = class Ellipse extends UI {
9550
9553
  if (hasAngle) closedAngle = abs$3(endAngle - startAngle) === 360;
9551
9554
  if (innerRadius) {
9552
9555
  const drawInnerEllipse = innerRadius < 1 || closed;
9553
- let outerStartAngle = startAngle, outerEndAngle = endAngle, outerAnticlockwise;
9556
+ const innerRx = rx * innerRadius, innerRy = ry * innerRadius;
9554
9557
  if (hasAngle) {
9558
+ ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle);
9555
9559
  if (drawInnerEllipse) {
9556
- ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle);
9557
9560
  if (closedAngle) {
9558
- set$1(tempPoint, width, ry);
9559
- set$1(tempCenter, rx, ry);
9561
+ closePath$2(path);
9562
+ set$1(tempPoint, rx + innerRx, ry), set$1(tempCenter, rx, ry);
9560
9563
  rotate$2(tempPoint, endAngle, tempCenter, rx, ry);
9561
9564
  moveTo$3(path, tempPoint.x, tempPoint.y);
9562
9565
  }
9563
- outerStartAngle = endAngle;
9564
- outerEndAngle = startAngle;
9565
- outerAnticlockwise = true;
9566
+ ellipse(path, rx, ry, innerRx, innerRy, 0, endAngle, startAngle, true);
9566
9567
  } else {
9567
9568
  if (!closedAngle) open = true;
9568
9569
  }
9569
9570
  } else {
9571
+ ellipse(path, rx, ry, rx, ry);
9570
9572
  if (drawInnerEllipse) {
9571
- ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
9572
9573
  closePath$2(path);
9573
- moveTo$3(path, width, ry);
9574
- outerStartAngle = 360;
9575
- outerAnticlockwise = true;
9576
- } else {
9577
- outerEndAngle = 360;
9574
+ moveTo$3(path, rx + innerRx, ry);
9575
+ ellipse(path, rx, ry, innerRx, innerRy, 0, 360, 0, true);
9578
9576
  }
9579
9577
  }
9580
- ellipse(path, rx, ry, rx, ry, 0, outerStartAngle, outerEndAngle, outerAnticlockwise);
9581
9578
  } else {
9582
9579
  if (hasAngle) {
9583
9580
  if (!closedAngle) {
@@ -11477,7 +11474,8 @@ ui$1.__hit = function(inner, forceHitFill) {
11477
11474
  const {hitFill: hitFill} = data;
11478
11475
  const needHitFillPath = (data.fill || data.__isCanvas) && (hitFill === "path" || hitFill === "pixel" && !(data.__isAlphaPixelFill || data.__isCanvas)) || hitFill === "all" || forceHitFill;
11479
11476
  if (needHitFillPath && this.__hitFill(inner)) return true;
11480
- const {hitStroke: hitStroke, __maxStrokeWidth: strokeWidth} = data;
11477
+ const {hitStroke: hitStroke, strokeScaleFixed: strokeScaleFixed} = data;
11478
+ const strokeWidth = data.__maxStrokeWidth * (strokeScaleFixed ? this.getRenderScaleData(true, strokeScaleFixed, false).scaleX : 1);
11481
11479
  const needHitStrokePath = data.stroke && (hitStroke === "path" || hitStroke === "pixel" && !data.__isAlphaPixelStroke) || hitStroke === "all";
11482
11480
  if (!needHitFillPath && !needHitStrokePath) return false;
11483
11481
  const radiusWidth = inner.radiusX * 2;