From f6d0dd6cdbba0ee7223acd24dd69b78c5cf42260 Mon Sep 17 00:00:00 2001 From: Dmitry Vedenko Date: Fri, 13 Oct 2023 16:17:33 +0300 Subject: [PATCH] When TrackPanel::OnPaint detects selection change - repaint all Selection is baked into the track bitmaps, so we must repaint them --- src/TrackPanel.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 007ba2b05b11..8088d1277aca 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -331,7 +331,7 @@ TrackPanel::TrackPanel(wxWindow * parent, wxWindowID id, .Subscribe([this](const RealtimeEffectManagerMessage& msg) { if (auto pTrack = dynamic_cast(msg.group)) - //update "effects" button + //update "effects" button RefreshTrack(pTrack); }); @@ -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); @@ -1443,7 +1449,7 @@ struct ChannelStack final : TrackPanelGroup { .emplace_back(yy, std::make_shared(hgroup)); yy += kAffordancesAreaHeight; } - + auto height = *pHeight++; rect.SetTop(yy); rect.SetHeight(height - kChannelSeparatorThickness);