1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-01 08:29:27 +02:00

Bug 2389 - At some zoom levels the light-blue/white selection visual cue disappears

This commit is contained in:
James Crook 2020-04-21 14:00:46 +01:00
parent 053e60eedf
commit 9ad06aeeb1
2 changed files with 13 additions and 1 deletions

View File

@ -428,6 +428,13 @@ void TrackArt::DrawBackgroundWithSelection(
within.width = 1 + rect.GetRight() - within.x;
}
// Bug 2389 - Selection can disappear
// This handles case where no waveform is visible.
if (within.width < 1)
{
within.width = 1;
}
if (within.width > 0) {
if (track->GetSelected()) {
dc->SetBrush(selBrush);

View File

@ -180,6 +180,9 @@ void DrawWaveformBackground(TrackPanelDrawingContext &context,
dc.SetBrush(blankBrush);
dc.DrawRectangle(rect);
// Bug 2389 - always draw at least one pixel of selection.
int selectedX = zoomInfo.TimeToPosition(t0, -leftOffset);
double time = zoomInfo.PositionToTime(0, -leftOffset), nextTime;
for (xx = 0; xx < rect.width; ++xx, time = nextTime) {
nextTime = zoomInfo.PositionToTime(xx + 1, -leftOffset);
@ -207,8 +210,10 @@ void DrawWaveformBackground(TrackPanelDrawingContext &context,
mintop = halfHeight;
}
sel = (t0 <= time && nextTime < t1);
sel = sel || (xx == selectedX);
// We don't draw selection color for sync-lock selected tracks.
sel = (t0 <= time && nextTime < t1) && !bIsSyncLockSelected;
sel = sel && !bIsSyncLockSelected;
if (lmaxtop == maxtop &&
lmintop == mintop &&