@cardenelabs/dragon 0.45.3 → 0.45.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.
package/dist/export.js CHANGED
@@ -11317,13 +11317,15 @@ function meterField(field, keys2, ctx) {
11317
11317
  function timeFocus(layout, timeline, step, parts, vw, vh) {
11318
11318
  const span = timeline.steps[step];
11319
11319
  const position = valueAt(timeline.needle ?? [], span.end - MOTION.still);
11320
- const nx = layout.axis.x + position * layout.axis.unit;
11320
+ const badge2 = layout.badges.find((b) => b.step === step);
11321
+ const anchored = badge2 && valueAt(timeline.needle ?? [], span.start) === position && !(layout.strip && badge2.y >= layout.strip.y);
11322
+ const ax = anchored ? badge2.x : layout.axis.x + position * layout.axis.unit;
11321
11323
  const top = Math.min(...layout.rows.map((r) => r.y));
11322
11324
  const bottom = Math.max(...layout.rows.map((r) => r.y + r.h));
11323
- let held = { x: nx - 1, y: top, w: 2, h: bottom - top };
11324
- const badge2 = layout.badges.find((b) => b.step === step);
11325
- const near = (p) => Math.hypot(Math.max(0, p.x - nx, nx - p.x - p.w), Math.max(0, p.y - top, top - p.y - p.h));
11326
- const extra = [...badge2 ? [{ x: badge2.x - LOOK.badge.r, y: badge2.y - LOOK.badge.r, w: LOOK.badge.r * 2, h: LOOK.badge.r * 2 }] : [], ...[...parts].sort((a, b) => near(a) - near(b))];
11325
+ let held = { x: ax - 1, y: top, w: 2, h: bottom - top };
11326
+ const near = (p) => Math.hypot(Math.max(0, p.x - ax, ax - p.x - p.w), Math.max(0, p.y - top, top - p.y - p.h));
11327
+ const changed = layout.points.filter((point) => point.changes.some((change) => change.step === step)).map((point) => ({ x: point.cx - point.r, y: point.cy - point.r, w: point.text.x + point.text.w - point.cx + point.r, h: point.r * 2 }));
11328
+ const extra = [...badge2 ? [{ x: badge2.x - LOOK.badge.r, y: badge2.y - LOOK.badge.r, w: LOOK.badge.r * 2, h: LOOK.badge.r * 2 }] : [], ...[...parts, ...changed].sort((a, b) => near(a) - near(b))];
11327
11329
  for (const p of extra) {
11328
11330
  const x = Math.min(held.x, p.x);
11329
11331
  const y = Math.min(held.y, p.y);