mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-02 08:59:28 +02:00
Draw cursors across entire track area
As long as there are tracks present, draw edit cursor, scrub cursor and quick play cursor across the entire track area. Fixes problems introduced by Track Affodances, and also makes the cursors behave like the play and record cursors. Signed-off-by: akleja <storspov@gmail.com>
This commit is contained in:
parent
f30d516a64
commit
15fbecbc56
@ -339,25 +339,13 @@ void AdornedRulerPanel::QuickPlayIndicatorOverlay::Draw(
|
||||
: AColor::Light(&dc, false)
|
||||
;
|
||||
|
||||
// Draw indicator in all visible tracks
|
||||
auto pCellularPanel = dynamic_cast<CellularPanel*>( &panel );
|
||||
if ( !pCellularPanel ) {
|
||||
wxASSERT( false );
|
||||
return;
|
||||
}
|
||||
pCellularPanel
|
||||
->VisitCells( [&]( const wxRect &rect, TrackPanelCell &cell ) {
|
||||
const auto pTrackView = dynamic_cast<TrackView*>(&cell);
|
||||
if (!pTrackView)
|
||||
return;
|
||||
|
||||
// Draw the NEW indicator in its NEW location
|
||||
AColor::Line(dc,
|
||||
mOldQPIndicatorPos,
|
||||
rect.GetTop(),
|
||||
mOldQPIndicatorPos,
|
||||
rect.GetBottom());
|
||||
} );
|
||||
auto rect = panel.GetRect();
|
||||
AColor::Line(dc,
|
||||
mOldQPIndicatorPos,
|
||||
rect.GetTop(),
|
||||
mOldQPIndicatorPos,
|
||||
rect.GetBottom());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,15 +108,11 @@ void EditCursorOverlay::Draw(OverlayPanel &panel, wxDC &dc)
|
||||
const auto pTrackView = dynamic_cast<TrackView*>(&cell);
|
||||
if (!pTrackView)
|
||||
return;
|
||||
const auto pTrack = pTrackView->FindTrack();
|
||||
if (pTrack->GetSelected() ||
|
||||
TrackFocus::Get( *mProject ).IsFocused( pTrack.get() ))
|
||||
{
|
||||
auto r = tp->GetRect();
|
||||
// AColor::Line includes both endpoints so use GetBottom()
|
||||
AColor::Line(dc, mLastCursorX, rect.GetTop(), mLastCursorX, rect.GetBottom());
|
||||
AColor::Line(dc, mLastCursorX, r.GetTop(), mLastCursorX, r.GetBottom());
|
||||
// ^^^ The whole point of this routine.
|
||||
|
||||
}
|
||||
} );
|
||||
}
|
||||
else if (auto ruler = dynamic_cast<AdornedRulerPanel*>(&panel)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user