mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-02 00:49:33 +02:00
Bug 2389 - At some zoom levels the light-blue/white selection visual cue disappears
This commit is contained in:
parent
053e60eedf
commit
9ad06aeeb1
@ -428,6 +428,13 @@ void TrackArt::DrawBackgroundWithSelection(
|
|||||||
within.width = 1 + rect.GetRight() - within.x;
|
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 (within.width > 0) {
|
||||||
if (track->GetSelected()) {
|
if (track->GetSelected()) {
|
||||||
dc->SetBrush(selBrush);
|
dc->SetBrush(selBrush);
|
||||||
|
@ -180,6 +180,9 @@ void DrawWaveformBackground(TrackPanelDrawingContext &context,
|
|||||||
dc.SetBrush(blankBrush);
|
dc.SetBrush(blankBrush);
|
||||||
dc.DrawRectangle(rect);
|
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;
|
double time = zoomInfo.PositionToTime(0, -leftOffset), nextTime;
|
||||||
for (xx = 0; xx < rect.width; ++xx, time = nextTime) {
|
for (xx = 0; xx < rect.width; ++xx, time = nextTime) {
|
||||||
nextTime = zoomInfo.PositionToTime(xx + 1, -leftOffset);
|
nextTime = zoomInfo.PositionToTime(xx + 1, -leftOffset);
|
||||||
@ -207,8 +210,10 @@ void DrawWaveformBackground(TrackPanelDrawingContext &context,
|
|||||||
mintop = halfHeight;
|
mintop = halfHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sel = (t0 <= time && nextTime < t1);
|
||||||
|
sel = sel || (xx == selectedX);
|
||||||
// We don't draw selection color for sync-lock selected tracks.
|
// We don't draw selection color for sync-lock selected tracks.
|
||||||
sel = (t0 <= time && nextTime < t1) && !bIsSyncLockSelected;
|
sel = sel && !bIsSyncLockSelected;
|
||||||
|
|
||||||
if (lmaxtop == maxtop &&
|
if (lmaxtop == maxtop &&
|
||||||
lmintop == mintop &&
|
lmintop == mintop &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user