Skip to content

Commit

Permalink
When TrackPanel::OnPaint detects selection change - repaint all
Browse files Browse the repository at this point in the history
Selection is baked into the track bitmaps, so we must
repaint them
  • Loading branch information
crsib committed Oct 13, 2023
1 parent 7d95e1e commit f6d0dd6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/TrackPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ TrackPanel::TrackPanel(wxWindow * parent, wxWindowID id,
.Subscribe([this](const RealtimeEffectManagerMessage& msg)
{
if (auto pTrack = dynamic_cast<Track *>(msg.group))
//update "effects" button
//update "effects" button
RefreshTrack(pTrack);
});

Expand Down Expand Up @@ -475,7 +475,13 @@ void TrackPanel::OnUndoReset(UndoRedoMessage message)
/// completing a repaint operation.
void TrackPanel::OnPaint(wxPaintEvent & /* event */)
{
mLastDrawnSelectedRegion = mViewInfo->selectedRegion;
// If the selected region changes - we must repaint the tracks, because the
// selection is baked into track image
if (mLastDrawnSelectedRegion != mViewInfo->selectedRegion)
{
mRefreshBacking = true;
mLastDrawnSelectedRegion = mViewInfo->selectedRegion;
}

auto sw =
FrameStatistics::CreateStopwatch(FrameStatistics::SectionID::TrackPanel);
Expand Down Expand Up @@ -1443,7 +1449,7 @@ struct ChannelStack final : TrackPanelGroup {
.emplace_back(yy, std::make_shared<HorizontalGroup>(hgroup));
yy += kAffordancesAreaHeight;
}

auto height = *pHeight++;
rect.SetTop(yy);
rect.SetHeight(height - kChannelSeparatorThickness);
Expand Down

0 comments on commit f6d0dd6

Please sign in to comment.