Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit 321782dae1249b50b942a775efabf758b8214d76
parent d1c3fcc10c2f6487642b2d85f6e27693f1aa61f9
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri,  6 Nov 2026 01:25:24 -0500

umtool: beside the instruments' column the measure extras move clear of each other

With scale-dial on main, the extras' anchors are the 1248×702 clip box when
the column is on, and there five homes overlap (the streak on the diet
badge, the moving start on the goal stack). measurePlacements now treats an
earlier extra's home (DODGE_ORDER) as a cover for a later one while both are
up, and no slot is taken onto any extra that is up in a cover's span. Post
cards and chapter bands are dodged inside the same clip box (deckGeometry's
footage, as the post segment is framed: deckFraming).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Mumtool/report-to-video/measure-extras.mjs | 28+++++++++++++++++++++++++---
Mumtool/report-to-video/measure-extras.test.mjs | 15+++++++++++++++
2 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/umtool/report-to-video/measure-extras.mjs b/umtool/report-to-video/measure-extras.mjs @@ -787,20 +787,42 @@ export function measurePlacements(schedule, render) { const out = {}; for (const id of MEASURE_EXTRAS) { const home = measureExtraGeometry(id, render, { feed }); - out[id] = { home, region: home, moves: [], up: covers.length && schedule ? upOf(id, schedule, render) : [] }; + out[id] = { home, region: home, moves: [], up: covers.length && schedule && resolveMeasureExtra(id, render) ? upOf(id, schedule, render) : [] }; + } + // Two extras whose homes overlap (the clip box is smaller beside the + // instruments' column) while both are up: the later in DODGE_ORDER moves + // clear of the earlier, as of a cover of its own. + if (schedule) { + for (const id of MEASURE_EXTRAS) if (!out[id].up.length && resolveMeasureExtra(id, render)) out[id].up = upOf(id, schedule, render); + DODGE_ORDER.forEach((a, i) => { + for (const b of DODGE_ORDER.slice(i + 1)) { + if (!resolveMeasureExtra(a, render) || !resolveMeasureExtra(b, render) || !intersects(out[a].home, out[b].home)) continue; + for (const sa of out[a].up) for (const sb of out[b].up) { + const from = Math.max(sa.in, sb.in); + const to = Math.min(sa.out, sb.out); + if (to - from > 1e-3) covers.push({ kind: "module", only: b, from, to, rects: [out[a].home] }); + } + } + }); + covers.sort((x, y) => x.from - y.from); } for (const c of covers) { const hit = (r) => c.rects.some((b) => intersects(r, b)); - const active = DODGE_ORDER.filter((id) => resolveMeasureExtra(id, render) && overlapsSpan(out[id].up, c.from, c.to)); + const active = DODGE_ORDER.filter((id) => resolveMeasureExtra(id, render) && overlapsSpan(out[id].up, c.from, c.to) && (!c.only || c.only === id)); // The modules that stay where they are take their homes first. const taken = []; const toMove = []; for (const id of active) { const cfg = resolveMeasureExtra(id, render); - const mode = c.kind === "post" ? cfg.onPosts : cfg.onChapters; + const mode = c.kind === "post" ? cfg.onPosts : c.kind === "chapter" ? cfg.onChapters : "dodge"; if (mode === "show" || !hit(out[id].home)) taken.push(out[id].home); else toMove.push({ id, cfg, mode }); } + // Every other extra up in the span keeps its place: no slot onto it. + for (const id of DODGE_ORDER) { + if (active.includes(id) || !resolveMeasureExtra(id, render) || !overlapsSpan(out[id].up, c.from, c.to)) continue; + taken.push(out[id].home); + } const footage = feed ? feedGeometry(render).footage : deckGeometry(render).footage; for (const { id, cfg, mode } of toMove) { let move = null; diff --git a/umtool/report-to-video/measure-extras.test.mjs b/umtool/report-to-video/measure-extras.test.mjs @@ -350,3 +350,18 @@ test("moverSteps: overlapping moves (two post items crossfading, a band inside a assert.equal(cues[0].to.autoAlpha, 0); assert.deepEqual(cues.find((c) => c.to.x === 10).to, { x: 10, y: 10, scale: 0.6 }); }); + +test("measurePlacements beside the instruments' column (the clip box 1248×702): extras whose homes overlap move clear of each other while both are up", () => { + const r = withDeck({ dial: true }); + const p = measurePlacements(schedule(), r); + const homes = Object.fromEntries(IDS.map((id) => [id, measureExtraGeometry(id, r)])); + const box = { x: 24, y: 94, width: 1248, height: 702 }; + for (const id of IDS) assert.ok(homes[id].x >= box.x && homes[id].x + homes[id].width <= box.x + box.width, `${id} inside the clip box`); + // diet and streak overlap at home: the streak (later in the order) moves, the diet stays. + assert.equal(p.diet.moves.length, 0); + assert.ok(p.streak.moves.length > 0); + for (const m of p.streak.moves.filter((x) => x.rect)) { + assert.ok(!(m.rect.x < homes.diet.x + homes.diet.width && homes.diet.x < m.rect.x + m.rect.width && m.rect.y < homes.diet.y + homes.diet.height && homes.diet.y < m.rect.y + m.rect.height), "never onto the diet badge"); + assert.ok(m.rect.x >= box.x && m.rect.x + m.rect.width <= box.x + box.width, "inside the clip box"); + } +});