1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 14:02:57 +02:00

Carry more information in TrackPanelDrawingContext; fewer arguments

This commit is contained in:
Paul Licameli
2018-11-03 13:34:48 -04:00
parent c866ed4bf7
commit 99106e3ed3
12 changed files with 227 additions and 176 deletions

View File

@@ -88,7 +88,10 @@ bool AudacityPrintout::OnPrintPage(int WXUNUSED(page))
artist.SetBackgroundBrushes(*wxWHITE_BRUSH, *wxWHITE_BRUSH,
*wxWHITE_PEN, *wxWHITE_PEN);
const double screenDuration = mTracks->GetEndTime();
SelectedRegion region{};
artist.pSelectedRegion = &region;
ZoomInfo zoomInfo(0.0, width / screenDuration);
artist.pZoomInfo = &zoomInfo;
int y = rulerPageHeight;
for (auto n : mTracks->Any()) {
@@ -98,9 +101,10 @@ bool AudacityPrintout::OnPrintPage(int WXUNUSED(page))
r.width = width;
r.height = (int)(n->GetHeight() * scale);
TrackPanelDrawingContext context{ *dc, {}, {} };
artist.DrawTrack(
context, n, r, SelectedRegion(), zoomInfo, false, false, false, false);
TrackPanelDrawingContext context{
*dc, {}, {}, &artist
};
artist.DrawTrack( context, n, r );
dc->SetPen(*wxBLACK_PEN);
AColor::Line(*dc, 0, r.y, width, r.y);