fix: restore waveform symmetry about the midline, cut deck_values' link to the bank model, and unit-test the column arithmetic
The waveform column's vertical extents move to pure component_geometry so the shared primitive stops being untested; PlaySeconds hoists into a header-only play_seconds target.
This commit is contained in:
@@ -97,4 +97,31 @@ int waveformColumnCount(const KitBox& box) {
|
||||
return w > 0 ? w : 0;
|
||||
}
|
||||
|
||||
WaveformBand waveformBand(int bandTop, int bandHeight) {
|
||||
WaveformBand b;
|
||||
b.top = bandTop;
|
||||
b.height = bandHeight;
|
||||
b.midY = bandTop + bandHeight / 2;
|
||||
b.halfSpan = (bandHeight / 2) - 2; // matches drawWaveform's 2px vertical breathing room
|
||||
return b;
|
||||
}
|
||||
|
||||
WaveformColumnSpan waveformColumnSpan(const WaveformBand& band,
|
||||
double compressedMax, double compressedMin) {
|
||||
const int lo = band.top;
|
||||
const int hi = band.top + band.height - 1;
|
||||
|
||||
WaveformColumnSpan s;
|
||||
s.top = band.midY - static_cast<int>(compressedMax * band.halfSpan);
|
||||
s.bottom = band.midY - static_cast<int>(compressedMin * band.halfSpan);
|
||||
s.topF = band.midY - compressedMax * band.halfSpan;
|
||||
s.bottomF = band.midY - compressedMin * band.halfSpan;
|
||||
|
||||
if (s.top < lo) s.top = lo;
|
||||
if (s.bottom > hi) s.bottom = hi;
|
||||
if (s.topF < lo) s.topF = lo;
|
||||
if (s.bottomF > hi) s.bottomF = hi;
|
||||
return s;
|
||||
}
|
||||
|
||||
} // namespace reasampler::ui
|
||||
|
||||
Reference in New Issue
Block a user