1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-03 17:39:25 +02:00

Merge pull request #351 from akleja/edit-cursor

Draw edit cursor across entire track area
This commit is contained in:
Sol Fisher Romanoff 2021-07-25 15:40:10 +03:00 committed by GitHub
commit a74e072062
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 24 deletions

View File

@ -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
auto rect = panel.GetRect();
AColor::Line(dc,
mOldQPIndicatorPos,
rect.GetTop(),
mOldQPIndicatorPos,
rect.GetBottom());
} );
}
}

View File

@ -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)) {