1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-28 14:18:41 +02:00

Iterate over the pending tracks for drawing and sizing the scrollbars

This commit is contained in:
Paul Licameli 2018-01-10 16:02:51 -05:00
parent d08ae18ca4
commit 28eeca5fa7
3 changed files with 23 additions and 2 deletions

View File

@ -1896,8 +1896,20 @@ void AudacityProject::FixScrollbars()
panelHeight = 0; panelHeight = 0;
} }
double LastTime = auto LastTime = -std::numeric_limits<double>::max();
std::max(mTracks->GetEndTime(), mViewInfo.selectedRegion.t1()); auto &tracks = *GetTracks();
for (auto track : tracks) {
// Iterate over pending changed tracks if present.
{
auto other =
tracks.FindPendingChangedTrack(track->GetId());
if (other)
track = other.get();
}
LastTime = std::max( LastTime, track->GetEndTime() );
}
LastTime =
std::max(LastTime, mViewInfo.selectedRegion.t1());
const double screen = GetScreenEndTime() - mViewInfo.h; const double screen = GetScreenEndTime() - mViewInfo.h;
const double halfScreen = screen / 2.0; const double halfScreen = screen / 2.0;

View File

@ -357,6 +357,9 @@ void TrackArtist::DrawTracks(TrackPanelDrawingContext &context,
bool hasSolo = false; bool hasSolo = false;
for (t = iter.First(); t; t = iter.Next()) { for (t = iter.First(); t; t = iter.Next()) {
auto other = tracks->FindPendingChangedTrack(t->GetId());
if (other)
t = other.get();
auto pt = dynamic_cast<const PlayableTrack *>(t); auto pt = dynamic_cast<const PlayableTrack *>(t);
if (pt && pt->GetSolo()) { if (pt && pt->GetSolo()) {
hasSolo = true; hasSolo = true;
@ -381,6 +384,9 @@ void TrackArtist::DrawTracks(TrackPanelDrawingContext &context,
t = iter.StartWith(start); t = iter.StartWith(start);
while (t) { while (t) {
auto other = tracks->FindPendingChangedTrack(t->GetId());
if (other)
t = other.get();
trackRect.y = t->GetY() - zoomInfo.vpos; trackRect.y = t->GetY() - zoomInfo.vpos;
trackRect.height = t->GetHeight(); trackRect.height = t->GetHeight();

View File

@ -1871,6 +1871,9 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
VisibleTrackIterator iter(GetProject()); VisibleTrackIterator iter(GetProject());
for (Track *t = iter.First(); t; t = iter.Next()) { for (Track *t = iter.First(); t; t = iter.Next()) {
auto other = GetTracks()->FindPendingChangedTrack(t->GetId());
if (other)
t = other.get();
trackRect.y = t->GetY() - mViewInfo->vpos; trackRect.y = t->GetY() - mViewInfo->vpos;
trackRect.height = t->GetHeight(); trackRect.height = t->GetHeight();