@euphrasiologist/lwphylo 1.2.22 → 1.2.23

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.
@@ -459,9 +459,6 @@ function getChildArcsFan(pd) {
459
459
  const TAU = Math.PI * 2;
460
460
  const norm = (t) => ((t % TAU) + TAU) % TAU;
461
461
 
462
- const ccwDelta = (a0, a1) => (a1 - a0 + TAU) % TAU;
463
- const cwDelta = (a0, a1) => (a0 - a1 + TAU) % TAU;
464
-
465
462
  // Circular midpoint that travels CCW from a -> b by half the CCW span
466
463
  function midCCW(a, b) {
467
464
  const d = (b - a + TAU) % TAU; // CCW delta in [0, 2π)
@@ -510,14 +507,12 @@ function getChildArcsFan(pd) {
510
507
  const cur = A[i];
511
508
  const next = A[(i + 1) % N];
512
509
 
513
- // “fan” wedge around the child: midpoint(prev→cur) .. midpoint(cur→next), CCW
514
510
  const start = midCCW(prev.a, cur.a);
515
511
  const end = midCCW(cur.a, next.a);
516
512
 
517
- // Choose the **shorter** sweep (0 = CCW, 1 = CW in our math-angle convention)
518
- const ccw = ccwDelta(start, end);
519
- const cw = cwDelta(start, end);
520
- const sweep = ccw <= cw ? 0 : 1;
513
+ // Use SVG-conforming sweep logic
514
+ const delta = (end - start + TAU) % TAU;
515
+ const sweep = delta > Math.PI ? 0 : 1;
521
516
 
522
517
  child_arcs.push({
523
518
  parentId: pid,
@@ -528,6 +523,7 @@ function getChildArcsFan(pd) {
528
523
  sweep
529
524
  });
530
525
  }
526
+
531
527
  }
532
528
 
533
529
  return child_arcs;