1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-04-05 22:07:42 +02:00

Extras like snap guidelines can be drawn for targets not yet clicked

This commit is contained in:
Paul Licameli
2017-07-12 11:29:44 -04:00
parent 33c6a77f8c
commit 4eece4b0b1
2 changed files with 7 additions and 4 deletions

View File

@@ -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!

View File

@@ -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);