diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index b8f0210c4..21a759a1b 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -1906,8 +1906,9 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context, #endif } - if (mUIHandle) - mUIHandle->DrawExtras(UIHandle::Cells, dc, region, clip); + auto target = Target(); + if (target) + target->DrawExtras(UIHandle::Cells, dc, region, clip); // Paint over the part below the tracks trackRect.y += trackRect.height; @@ -1929,8 +1930,8 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context, HighlightFocusedTrack(dc, focusRect); } - if (mUIHandle) - mUIHandle->DrawExtras(UIHandle::Panel, dc, region, clip); + if (target) + target->DrawExtras(UIHandle::Panel, dc, region, clip); } // Make this #include go away! diff --git a/src/UIHandle.h b/src/UIHandle.h index b824931f5..28d3eda22 100644 --- a/src/UIHandle.h +++ b/src/UIHandle.h @@ -89,6 +89,8 @@ public: // If pass is Cells, then any drawing that extends outside the cells // is later overlaid with the cell bevels and the empty background color. // Otherwise (Panel), it is a later drawing pass that will not be overlaid. + // This is invoked on the hit test target even before it is clicked, + // and also during drag. virtual void DrawExtras (DrawingPass pass, wxDC * dc, const wxRegion &updateRegion, const wxRect &panelRect);