fix(draw_kit): reclaim 4x waveform oversample; relocate waveformColumnCount to component_geometry
kWaveformOversample set to 1 (was 4) — overbinning produced byte-identical pixels because columnMinMax exact partition already makes the draw gap-free. Comments credit columnMinMax, not oversampling.
This commit is contained in:
@@ -173,6 +173,22 @@ static void testListRowLayoutHitAgreement() {
|
||||
}
|
||||
}
|
||||
|
||||
// --- waveformColumnCount -----------------------------------------------------
|
||||
|
||||
static void testWaveformColumnCount() {
|
||||
// Normal box: width minus the two 2px side insets.
|
||||
CHECK(waveformColumnCount(KitBox{0, 0, 100, 40}) == 96);
|
||||
CHECK(waveformColumnCount(KitBox{10, 5, 50, 20}) == 46);
|
||||
// Minimum: a 5-wide box yields exactly 1 drawable column.
|
||||
CHECK(waveformColumnCount(KitBox{0, 0, 5, 10}) == 1);
|
||||
// Too narrow to have any drawable columns: 4 or fewer columns returns 0.
|
||||
CHECK(waveformColumnCount(KitBox{0, 0, 4, 10}) == 0);
|
||||
CHECK(waveformColumnCount(KitBox{0, 0, 1, 10}) == 0);
|
||||
// Degenerate (empty) box returns 0 — graceful suppression.
|
||||
CHECK(waveformColumnCount(KitBox{}) == 0);
|
||||
CHECK(waveformColumnCount(KitBox{0, 0, 0, 40}) == 0);
|
||||
}
|
||||
|
||||
int main() {
|
||||
testHitTestBoxHalfOpen();
|
||||
testButtonBoxInset();
|
||||
@@ -190,6 +206,7 @@ int main() {
|
||||
testListRowHitTest();
|
||||
testListRowHitTestBoundedByCount();
|
||||
testListRowLayoutHitAgreement();
|
||||
testWaveformColumnCount();
|
||||
|
||||
if (g_fail == 0) std::printf("component_geometry: all tests passed\n");
|
||||
else std::printf("component_geometry: %d CHECK(s) FAILED\n", g_fail);
|
||||
|
||||
Reference in New Issue
Block a user