Ω-W1-T5: one overlay↔waveform mapping, and loop marks that tell the truth about their mode

This commit is contained in:
2026-08-03 12:39:41 -04:00
parent 0eb2c67875
commit a3853231a7
9 changed files with 293 additions and 67 deletions
+11
View File
@@ -192,6 +192,16 @@ static void testWaveformColumnCount() {
CHECK(waveformColumnCount(KitBox{0, 0, 0, 40}) == 0);
}
// The instrument's waveform overlay rides this exact column band, and derives its own left
// inset by halving what this leaves (waveform_view's waveformOverlayArea) rather than keeping a
// second copy of the inset. That halving is only correct while the inset is symmetric, so pin
// it: every drawable width loses exactly 4, two per side.
static void testTheColumnBandIsInsetSymmetrically() {
for (int w = 5; w <= 400; ++w) {
CHECK(w - waveformColumnCount(KitBox{0, 0, w, 40}) == 4);
}
}
// --- waveform column span ----------------------------------------------------
// The regression this exists to catch: rounding applied to the resulting y instead of to the
@@ -293,6 +303,7 @@ int main() {
testListRowHitTestBoundedByCount();
testListRowLayoutHitAgreement();
testWaveformColumnCount();
testTheColumnBandIsInsetSymmetrically();
testSymmetricColumnDrawsEqualHeightAboveAndBelowTheZeroLine();
testSilentColumnCollapsesOntoTheZeroLine();
testTallerAmplitudeNeverDrawsAShorterColumn();