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:
commit
a74e072062
@ -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());
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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