1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 08:27:13 +01:00

Move Y position, height, and minimized state into TrackView...

... and eliminate some unnecessary calls to SubstitutePendingChangedTrack,
because the track and the substitute store Y and height in their shared
TrackView object.

Also make GetMinimizedHeight() virtual to avoid inclusion of TrackPanel.h in
TrackView.cpp.
This commit is contained in:
Paul Licameli
2019-06-18 11:32:26 -04:00
parent 3797a5227a
commit 66e32ca35d
28 changed files with 244 additions and 225 deletions

View File

@@ -203,15 +203,17 @@ void DoZoomFitV(AudacityProject &project)
height -= 28;
// The height of minimized and non-audio tracks cannot be apportioned
const auto GetHeight = []( const Track *track )
{ return TrackView::Get( *track ).GetHeight(); };
height -=
tracks.Any().sum( &Track::GetHeight ) - range.sum( &Track::GetHeight );
tracks.Any().sum( GetHeight ) - range.sum( GetHeight );
// Give each resized track the average of the remaining height
height = height / count;
height = std::max( (int)TrackInfo::MinimumTrackHeight(), height );
for (auto t : range)
t->SetHeight(height);
TrackView::Get( *t ).SetHeight(height);
}
}