mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-19 14:17:41 +02:00
Override TrackPanelDrawable::DrawingArea() properly for track names
This commit is contained in:
parent
71b3fc0647
commit
8905e52ee0
@ -187,6 +187,22 @@ static void DrawTrackName(
|
|||||||
nameRect.y + MarginY);
|
nameRect.y + MarginY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxRect CommonTrackView::DrawingArea(
|
||||||
|
TrackPanelDrawingContext &context,
|
||||||
|
const wxRect &rect, const wxRect &panelRect, unsigned iPass )
|
||||||
|
{
|
||||||
|
auto result = rect;
|
||||||
|
if ( iPass == TrackArtist::PassBorders ) {
|
||||||
|
if ( true ) {
|
||||||
|
wxCoord textWidth, textHeight;
|
||||||
|
GetTrackNameExtent( context.dc, FindTrack().get(),
|
||||||
|
&textWidth, &textHeight );
|
||||||
|
result = GetTrackNameRect( rect, textWidth, textHeight );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rect;
|
||||||
|
}
|
||||||
|
|
||||||
void CommonTrackView::Draw(
|
void CommonTrackView::Draw(
|
||||||
TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass )
|
TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass )
|
||||||
{
|
{
|
||||||
|
@ -34,6 +34,10 @@ public:
|
|||||||
void TimeShiftHitTest();
|
void TimeShiftHitTest();
|
||||||
|
|
||||||
// TrackPanelDrawable implementation
|
// TrackPanelDrawable implementation
|
||||||
|
wxRect DrawingArea(
|
||||||
|
TrackPanelDrawingContext &context,
|
||||||
|
const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
|
||||||
|
|
||||||
void Draw(
|
void Draw(
|
||||||
TrackPanelDrawingContext &context,
|
TrackPanelDrawingContext &context,
|
||||||
const wxRect &rect, unsigned iPass ) override;
|
const wxRect &rect, unsigned iPass ) override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user