fix: close review findings on spline EGs — engine, codec, and popup/overlay UI grammar

Live pitch depth, Gate/Spline enable-rule agreement, inert kTrigLength, NaN wire guards, hard-flag-tail corruption no longer wipes the record, RT/cold spline tie-break, retired alt-click, marker-shadow fix, plus new test coverage.
This commit is contained in:
2026-07-31 22:27:41 -04:00
parent e44bd42dd9
commit 1c774226d3
22 changed files with 414 additions and 88 deletions
+36
View File
@@ -205,6 +205,41 @@ static void testInnerDialHit() {
CHECK(h.kind == DeckHitKind::Knob && h.id == c.id && !h.inner);
}
// captionToggle2 sits immediately left of captionToggle when both are present (no overlap, and
// the caption text stops before the LEFTMOST one), and takes captionToggle's own slot when
// captionToggle is absent — the shipped FILTER ENV group's exact shape (deck_groups.cpp).
static void testCaptionToggle2() {
const DeckGroupDesc both{9, 40, {}, {300, 30}, {301, 20}, {1, 2, 3}, {}};
std::vector<DeckGroupDesc> g{both};
const DeckLayout dl = layoutDeck(g, 0, 0, 800);
const DeckGroupLayout& lay = dl.groups[0];
CHECK(lay.captionToggle.id == 300);
CHECK(lay.captionToggle2.id == 301);
CHECK(lay.captionToggle2.seg0.width == 20 && lay.captionToggle2.seg1.width == 20);
// Left of the first, with exactly one gap between — no overlap by construction.
CHECK(lay.captionToggle2.seg1.right() == lay.captionToggle.seg0.x - kDeckToggleGap);
// Caption text stops before the LEFTMOST toggle (toggle2), not just the first-placed one.
CHECK(lay.caption.right() <= lay.captionToggle2.seg0.x);
DeckHit h = hitTestDeck(dl, lay.captionToggle2.seg0.right() - 1,
lay.captionToggle2.seg0.y + 1);
CHECK(h.kind == DeckHitKind::CaptionToggle && h.id == 301 && h.segment == 0);
h = hitTestDeck(dl, lay.captionToggle2.seg1.x, lay.captionToggle2.seg1.y + 1);
CHECK(h.kind == DeckHitKind::CaptionToggle && h.id == 301 && h.segment == 1);
// FILTER ENV's real shape: captionToggle absent, captionToggle2 present with a radio — it
// takes the first (rightmost) slot rather than leaving a gap where captionToggle would sit.
const DeckGroupDesc filterEnvLike{10, 66, {200}, {}, {302, 23}, {1, 2, 3, 4, 5}, {}};
std::vector<DeckGroupDesc> g2{filterEnvLike};
const DeckLayout dl2 = layoutDeck(g2, 0, 0, 800);
const DeckGroupLayout& fe = dl2.groups[0];
CHECK(fe.captionToggle.id == -1);
CHECK(fe.captionToggle2.id == 302);
CHECK(fe.captionToggle2.seg1.right() == fe.captionRadio.box.x - kDeckToggleGap);
h = hitTestDeck(dl2, fe.captionToggle2.seg1.x, fe.captionToggle2.seg1.y + 1);
CHECK(h.kind == DeckHitKind::CaptionToggle && h.id == 302 && h.segment == 1);
}
static void testEmptyDeck() {
const std::vector<DeckGroupDesc> none;
CHECK(deckRowCount(none, 800) == 0);
@@ -221,6 +256,7 @@ int main() {
testHitTest();
testCaptionRadioGeometryAndHit();
testInnerDialHit();
testCaptionToggle2();
testEmptyDeck();
if (g_fail) {
std::printf("%d FAILURE(S)\n", g_fail);