Pass TrackPanelDrawingContext into TrackPanelDrawable::DrawingArea()
This commit is contained in:
parent
996d60de81
commit
7c70d78430
|
@ -1125,7 +1125,8 @@ void CellularPanel::Draw( TrackPanelDrawingContext &context, unsigned nPasses )
|
|||
VisitPostorder( [&]( const wxRect &rect, TrackPanelNode &node ) {
|
||||
|
||||
// Draw the node
|
||||
const auto newRect = node.DrawingArea( rect, panelRect, iPass );
|
||||
const auto newRect = node.DrawingArea(
|
||||
context, rect, panelRect, iPass );
|
||||
if ( newRect.Intersects( panelRect ) )
|
||||
node.Draw( context, newRect, iPass );
|
||||
|
||||
|
@ -1134,7 +1135,7 @@ void CellularPanel::Draw( TrackPanelDrawingContext &context, unsigned nPasses )
|
|||
auto target = Target();
|
||||
if ( target ) {
|
||||
const auto targetRect =
|
||||
target->DrawingArea( rect, panelRect, iPass );
|
||||
target->DrawingArea( context, rect, panelRect, iPass );
|
||||
if ( targetRect.Intersects( panelRect ) )
|
||||
target->Draw( context, targetRect, iPass );
|
||||
}
|
||||
|
|
|
@ -1240,6 +1240,7 @@ struct LabeledChannelGroup final : TrackPanelGroup {
|
|||
}
|
||||
|
||||
wxRect DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &, unsigned iPass ) override
|
||||
{
|
||||
if ( iPass == TrackArtist::PassBorders )
|
||||
|
@ -1393,6 +1394,7 @@ void TrackPanelDrawable::Draw(
|
|||
}
|
||||
|
||||
wxRect TrackPanelDrawable::DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &, unsigned )
|
||||
{
|
||||
return rect;
|
||||
|
|
|
@ -33,7 +33,10 @@ public:
|
|||
// hit-test purposes, spilling over into other parts of the partition of the
|
||||
// panel area.
|
||||
// Default implementation returns rect unchanged.
|
||||
// TrackPanelContext is passed in because sometimes a drawing context is
|
||||
// needed for text extent calculations.
|
||||
virtual wxRect DrawingArea(
|
||||
TrackPanelDrawingContext &context,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass );
|
||||
|
||||
// Utilities for implementing DrawingArea:
|
||||
|
|
|
@ -372,6 +372,7 @@ void NoteTrackVZoomHandle::Draw(
|
|||
}
|
||||
|
||||
wxRect NoteTrackVZoomHandle::DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass )
|
||||
{
|
||||
if ( iPass == TrackArtist::PassZooming )
|
||||
|
|
|
@ -61,6 +61,7 @@ private:
|
|||
const wxRect &rect, unsigned iPass ) override;
|
||||
|
||||
wxRect DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
|
||||
|
||||
std::weak_ptr<NoteTrack> mpTrack;
|
||||
|
|
|
@ -90,6 +90,7 @@ void SpectrumVZoomHandle::Draw(
|
|||
}
|
||||
|
||||
wxRect SpectrumVZoomHandle::DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass )
|
||||
{
|
||||
return WaveTrackVZoomHandle::DoDrawingArea( rect, panelRect, iPass );
|
||||
|
|
|
@ -62,6 +62,7 @@ private:
|
|||
const wxRect &rect, unsigned iPass ) override;
|
||||
|
||||
wxRect DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
|
||||
|
||||
std::weak_ptr<WaveTrack> mpTrack;
|
||||
|
|
|
@ -89,6 +89,7 @@ void WaveformVZoomHandle::Draw(
|
|||
}
|
||||
|
||||
wxRect WaveformVZoomHandle::DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass )
|
||||
{
|
||||
return WaveTrackVZoomHandle::DoDrawingArea( rect, panelRect, iPass );
|
||||
|
|
|
@ -62,6 +62,7 @@ private:
|
|||
const wxRect &rect, unsigned iPass ) override;
|
||||
|
||||
wxRect DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
|
||||
|
||||
std::weak_ptr<WaveTrack> mpTrack;
|
||||
|
|
|
@ -134,6 +134,7 @@ void BackgroundCell::Draw(
|
|||
}
|
||||
|
||||
wxRect BackgroundCell::DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &, unsigned iPass )
|
||||
{
|
||||
if ( iPass == TrackArtist::PassBackground )
|
||||
|
|
|
@ -51,6 +51,7 @@ private:
|
|||
const wxRect &rect, unsigned iPass ) override;
|
||||
|
||||
wxRect DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
|
||||
|
||||
AudacityProject *mpProject;
|
||||
|
|
|
@ -401,6 +401,7 @@ void CommonTrackControls::Draw(
|
|||
}
|
||||
|
||||
wxRect CommonTrackControls::DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &, unsigned iPass )
|
||||
{
|
||||
if ( iPass == TrackArtist::PassControls )
|
||||
|
|
|
@ -62,6 +62,7 @@ protected:
|
|||
const wxRect &rect, unsigned iPass ) override;
|
||||
|
||||
wxRect DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
|
||||
|
||||
std::weak_ptr<CloseButtonHandle> mCloseHandle;
|
||||
|
|
|
@ -1050,6 +1050,7 @@ void SelectHandle::Draw(
|
|||
}
|
||||
|
||||
wxRect SelectHandle::DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass )
|
||||
{
|
||||
if ( iPass == TrackArtist::PassSnapping )
|
||||
|
|
|
@ -121,6 +121,7 @@ private:
|
|||
const wxRect &rect, unsigned iPass ) override;
|
||||
|
||||
wxRect DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
|
||||
|
||||
//void ResetFreqSelectionPin
|
||||
|
|
|
@ -863,6 +863,7 @@ void TimeShiftHandle::Draw(
|
|||
}
|
||||
|
||||
wxRect TimeShiftHandle::DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass )
|
||||
{
|
||||
if ( iPass == TrackArtist::PassSnapping )
|
||||
|
|
|
@ -111,6 +111,7 @@ private:
|
|||
const wxRect &rect, unsigned iPass ) override;
|
||||
|
||||
wxRect DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
|
||||
|
||||
std::shared_ptr<Track> mCapturedTrack;
|
||||
|
|
|
@ -121,6 +121,7 @@ void TrackVRulerControls::Draw(
|
|||
}
|
||||
|
||||
wxRect TrackVRulerControls::DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &, unsigned iPass )
|
||||
{
|
||||
// Common area change for all subclasses when drawing the controls
|
||||
|
|
|
@ -55,6 +55,7 @@ protected:
|
|||
const wxRect &rect, unsigned iPass ) override;
|
||||
|
||||
wxRect DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
|
||||
|
||||
Track *GetTrack() const;
|
||||
|
|
|
@ -208,6 +208,7 @@ void ZoomHandle::Draw(
|
|||
}
|
||||
|
||||
wxRect ZoomHandle::DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass )
|
||||
{
|
||||
if ( iPass == TrackArtist::PassZooming )
|
||||
|
|
|
@ -58,6 +58,7 @@ private:
|
|||
const wxRect &rect, unsigned iPass ) override;
|
||||
|
||||
wxRect DrawingArea(
|
||||
TrackPanelDrawingContext &,
|
||||
const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
|
||||
|
||||
bool IsDragZooming() const;
|
||||
|
|
Loading…
Reference in New Issue