fix: stop annotation labels overlapping, drop click-to-pin

Every box drew its label unconditionally, so overlapping transmissions
stacked their text into an unreadable smear — several frame names painted
over each other at the same pixels.

DrawBoxLabel now claims a screen-space rect before drawing and skips the
label if it would intersect one already placed this frame. Draw order
decides the winner, so the topmost box keeps its text and the ones beneath
go quiet instead of smearing. The claim is clipped to the box width, so a
long label reserves only what the scissor actually paints rather than
silencing neighbours over space it never uses. Nothing is lost: hovering
still reports every box under the cursor.

The stacked-hover tooltip now sits above the cursor and centred on it,
flipping below only when there is no room. It previously opened down and
to the right, covering the very boxes being described.

Also removes click-to-pin. It was never asked for, it did not reliably
work, and hover alone answers the question it was meant to serve.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8ZWfr5XZyyDttvkhJUgHN
This commit is contained in:
2026-08-12 12:50:30 -07:00
parent 8017954aa1
commit 8026d10547
3 changed files with 49 additions and 40 deletions
-12
View File
@@ -842,7 +842,6 @@ int main(int argc, char* argv[])
app.hoveredTimelineEvent = -1;
app.selectedAnnotation = -1;
app.hoverStackCount = 0;
app.hoverStackPinned = false;
for (int i = 0; i < MLNL_KIND_MAX; i++) app.annotationKindEnabled[i] = true;
app.showScope = true;
app.dividerY = 0.6f; // Start with 60% spectro, 40% scope
@@ -1172,10 +1171,6 @@ int main(int argc, char* argv[])
app.showAbout = false;
} else if (app.showFileBrowser) {
app.showFileBrowser = false;
} else if (app.hoverStackPinned) {
// Release a pinned annotation stack before touching the
// selection — it's the most recently opened thing on screen.
app.hoverStackPinned = false;
} else if (app.markerMode && app.marker.active) {
// Clear the marker measurement first when the ruler is active.
app.marker.active = false;
@@ -1356,13 +1351,6 @@ int main(int argc, char* argv[])
app.sel.freqStart = app.sel.freqEnd;
app.sel.freqEnd = tmp;
}
} else if (app.hoverStackPinned || app.hoverStackCount > 1) {
// A click on stacked annotations pins (or unpins) the
// hit list instead of touching the selection — with
// boxes piled up, "what is under here?" is what the
// click means. Pinning freezes the stack so it can be
// read without holding the cursor perfectly still.
app.hoverStackPinned = !app.hoverStackPinned;
} else if (!hoverInsideSelection) {
// Sub-threshold drag outside any existing selection: treat
// as a click on empty space and reset to full range. A