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:
2026-08-01 10:01:40 -04:00
parent ca464397b2
commit 47f2a063e7
8 changed files with 57 additions and 10 deletions
+3 -1
View File
@@ -193,7 +193,9 @@ DeckHit hitTestDeck(const DeckLayout& layout, int x, int y) {
bool inKnobFace(const Rect& knob, int x, int y) {
const double dx = x - (knob.x + knob.width / 2.0);
const double dy = y - (knob.y + knob.height / 2.0);
const double r = knob.width / 2.0;
// Matches computeKnob's radius rule (param_slider.cpp) so the hit rule never claims more
// circle than is actually drawn when a caller's rect is non-square (e.g. a squashed chrome row).
const double r = (std::min)(knob.width, knob.height) / 2.0;
return dx * dx + dy * dy < r * r;
}