Loop-crossfade-ux review fixes: parked-drag no longer fakes LOOP OFF, waveform label contrast fixed, hover memoizes its bank read

Also corrects the cap-area, em-dash, glyph-overhang and heuristic-comment findings noted in review.
This commit is contained in:
2026-08-02 05:50:38 -04:00
parent a7c3c7a828
commit 1b4d0e67b7
10 changed files with 125 additions and 27 deletions
+10 -2
View File
@@ -45,8 +45,16 @@ LoopWrite applyLoopMarks(const LoopMarks& m) {
LoopWrite w;
const bool spanAlive = m.loopEnd > m.loopStart;
w.loop.hasLoop = m.hasLoop && spanAlive;
w.loop.start = m.loopStart;
w.loop.end = m.loopEnd;
if (m.parked && !m.hasLoop) {
// A parked pair (never set) must round-trip back to parked, not to a real "LOOP OFF"
// span — resolveLoopMarks only re-parks a span spanUsable would refuse, so collapse it
// deliberately rather than writing back the default bounds' own alive span.
w.loop.start = m.loopStart;
w.loop.end = m.loopStart;
} else {
w.loop.start = m.loopStart;
w.loop.end = m.loopEnd;
}
w.crossfade = (spanAlive && m.crossfade > 0) ? m.crossfade : 0;
w.start = m.start;
return w;
+8
View File
@@ -104,6 +104,14 @@ inline constexpr double kLoopSpanFillAlpha = 0.20;
// body floor Font::Micro answers to.
inline constexpr double kCardNameScrimAlpha = 0.75;
// The waveform mark caption/label scrim: bg/base composited at this alpha UNDER the loop-state
// caption and the four mark labels, so text/dim (Font::Micro, body class) stays readable when
// the envelope's accent/primary peak reaches into the label's rect. Higher than
// kCardNameScrimAlpha because text/dim needs more cover than text/primary to clear the same
// 4.5:1 body floor against the same lime worst case — test_theme.cpp composes this exact value
// against accent/primary to pin the floor both roles answer to.
inline constexpr double kWaveformLabelScrimAlpha = 0.90;
// Relative luminance per WCAG 2.1 (sRGB linearization + 0.2126/0.7152/0.0722 weighting). Alpha
// is ignored — a translucent overlay's effective color is the caller's to compose first
// (compositeOver).