mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-02 08:39:46 +02:00
Bug1994: Crashes in append-record...
... The crash happened in drawing code. The recently submitted but long developed rewriting of track and channel iterations wasn't all reconciled with the early 2.3.0 development relating to temporary track objects for display purposes, which was for fixing the interactions of recording and undo.
This commit is contained in:
parent
565fef2ba9
commit
0a55b27d2d
@ -1169,9 +1169,9 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
|
||||
|
||||
for ( auto t :
|
||||
GetTracks()->Any< const Track >() + IsVisibleTrack{ GetProject() } ) {
|
||||
t = t->SubstitutePendingChangedTrack().get();
|
||||
trackRect.y = t->GetY() - mViewInfo->vpos;
|
||||
trackRect.height = t->GetHeight();
|
||||
auto visibleT = t->SubstitutePendingChangedTrack().get();
|
||||
trackRect.y = visibleT->GetY() - mViewInfo->vpos;
|
||||
trackRect.height = visibleT->GetHeight();
|
||||
|
||||
auto leaderTrack = *GetTracks()->FindLeader( t );
|
||||
// If the previous track is linked to this one but isn't on the screen
|
||||
@ -1181,11 +1181,15 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
|
||||
|
||||
if (drawBorder) {
|
||||
wxRect teamRect = trackRect;
|
||||
teamRect.y = leaderTrack->GetY() - mViewInfo->vpos;
|
||||
// danger with pending tracks?
|
||||
teamRect.height =
|
||||
TrackList::Channels(leaderTrack)
|
||||
.sum( &Track::GetHeight );
|
||||
auto visibleLeaderTrack =
|
||||
leaderTrack->SubstitutePendingChangedTrack().get();
|
||||
teamRect.y = visibleLeaderTrack->GetY() - mViewInfo->vpos;
|
||||
teamRect.height = TrackList::Channels(leaderTrack).sum(
|
||||
[&] (const Track *channel) {
|
||||
channel = channel->SubstitutePendingChangedTrack().get();
|
||||
return channel->GetHeight();
|
||||
}
|
||||
);
|
||||
|
||||
if (mAx->IsFocused(t)) {
|
||||
focusRect = teamRect;
|
||||
@ -1209,7 +1213,7 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
|
||||
rect.y += kTopMargin;
|
||||
rect.width = GetVRulerWidth();
|
||||
rect.height -= (kTopMargin + kBottomMargin);
|
||||
mTrackArtist->DrawVRuler(context, t, rect);
|
||||
mTrackArtist->DrawVRuler(context, visibleT, rect);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user