fix: close five Θ-W6-T1 review minors — headroom figure, knob-face radius, degenerate band clamp
Aligns inKnobFace's hit radius with computeKnob's draw-side min(w,h) rule and adds a non-square-rect test; clamps halfSpan for degenerate waveform bands with a test; fixes stale docs/comments and annotates an uncommitted perf measurement.
This commit is contained in:
@@ -102,7 +102,13 @@ WaveformBand waveformBand(int bandTop, int bandHeight) {
|
||||
b.top = bandTop;
|
||||
b.height = bandHeight;
|
||||
b.midY = bandTop + bandHeight / 2;
|
||||
b.halfSpan = (bandHeight / 2) - 2; // matches drawWaveform's 2px vertical breathing room
|
||||
// matches drawWaveform's 2px vertical breathing room; clamped at 0 so a degenerate band
|
||||
// (height <= 3, where this would otherwise go negative) can't flip a positive peak below
|
||||
// the zero line.
|
||||
const int rawHalfSpan = (bandHeight / 2) - 2;
|
||||
b.halfSpan = rawHalfSpan > 0 ? rawHalfSpan : 0;
|
||||
// lo/hi (waveformColumnSpan) are midY-height/2 .. midY+height/2-1 — asymmetric by one px for
|
||||
// even heights. Unreachable while |compressAmplitudeForDisplay| <= 1, so left as-is.
|
||||
return b;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user