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