1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-17 09:07:41 +02:00

Override TrackPanelDrawable::DrawingArea() properly for track names

This commit is contained in:
Paul Licameli 2019-12-28 13:22:17 -05:00
parent 71b3fc0647
commit 8905e52ee0
2 changed files with 20 additions and 0 deletions

View File

@ -187,6 +187,22 @@ static void DrawTrackName(
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(
TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass )
{

View File

@ -34,6 +34,10 @@ public:
void TimeShiftHitTest();
// TrackPanelDrawable implementation
wxRect DrawingArea(
TrackPanelDrawingContext &context,
const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
void Draw(
TrackPanelDrawingContext &context,
const wxRect &rect, unsigned iPass ) override;