1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 09:20:16 +01:00

Rewrite WaveTrackView::GetSubViews to cache last computed heights

This commit is contained in:
Paul Licameli
2019-07-11 12:50:00 -04:00
parent 125b8ad0da
commit af9959dc98
2 changed files with 24 additions and 11 deletions

View File

@@ -923,6 +923,7 @@ void TrackPanel::UpdateTrackVRuler(Track *t)
for (auto channel : TrackList::Channels(t)) {
auto &view = TrackView::Get( *channel );
const auto height = view.GetHeight() - (kTopMargin + kBottomMargin);
rect.SetHeight( height );
const auto subViews = view.GetSubViews( rect );
if (subViews.empty())
continue;
@@ -1142,7 +1143,7 @@ struct ChannelGroup final : TrackPanelGroup {
auto &view = TrackView::Get( *channel );
auto height = view.GetHeight();
rect.SetTop( yy );
rect.SetHeight( height );
rect.SetHeight( height - kSeparatorThickness );
const auto subViews = TrackView::Get( *channel ).GetSubViews( rect );
auto y1 = yy;
for ( const auto &subView : subViews ) {