1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-04-02 12:35:11 +02:00

Remove TrackPanel::EnsureVisible; TrackList sends an event instead

This commit is contained in:
Paul Licameli
2019-06-10 11:20:07 -04:00
parent d236507682
commit 2257fa642a
12 changed files with 116 additions and 81 deletions

View File

@@ -1604,6 +1604,7 @@ void ProjectWindow::OnMouseEvent(wxMouseEvent & event)
void ProjectWindow::ZoomAfterImport(Track *pTrack)
{
auto &project = mProject;
auto &tracks = TrackList::Get( project );
auto &trackPanel = TrackPanel::Get( project );
DoZoomFit();
@@ -1611,8 +1612,11 @@ void ProjectWindow::ZoomAfterImport(Track *pTrack)
trackPanel.SetFocus();
RedrawProject();
if (!pTrack)
pTrack = trackPanel.GetFirstSelectedTrack();
trackPanel.EnsureVisible(pTrack);
pTrack = *tracks.Selected().begin();
if (!pTrack)
pTrack = *tracks.Any().begin();
if (pTrack)
pTrack->EnsureVisible();
}
// Utility function called by other zoom methods