MCPcopy Create free account
hub / github.com/audacity/audacity / OnPaint

Method OnPaint

src/effects/CompressionMeterPanel.cpp:103–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void CompressionMeterPanel::OnPaint(wxPaintEvent& evt)
104{
105 using namespace DynamicRangeProcessorPanel;
106
107 wxPaintDC dc(this);
108
109 const auto rect = DynamicRangeProcessorPanel::GetPanelRect(*this);
110 const auto gc = MakeGraphicsContext(dc);
111 const auto left = rect.GetLeft();
112 const auto top = rect.GetTop();
113 const auto width = rect.GetWidth();
114 const auto height = rect.GetHeight();
115
116 gc->SetPen(*wxTRANSPARENT_PEN);
117 gc->SetBrush(GetGraphBackgroundBrush(*gc, height));
118 gc->DrawRectangle(left, top, width, height);
119
120 auto leftRect = rect;
121 leftRect.SetWidth(rect.GetWidth() / 2 - 2);
122 leftRect.Offset(1, 0);
123 PaintMeter(dc, actualCompressionColor, leftRect, *mCompressionMeter);
124
125 auto rightRect = leftRect;
126 rightRect.Offset(leftRect.GetWidth(), 0);
127 PaintMeter(dc, outputColor, rightRect, *mOutputMeter);
128
129 gc->SetPen(lineColor);
130 gc->SetBrush(wxNullBrush);
131 gc->DrawRectangle(left, top, width, height);
132}
133
134void CompressionMeterPanel::PaintMeter(
135 wxPaintDC& dc, const wxColor& color, const wxRect& rect,

Callers

nothing calls this directly

Calls 5

GetPanelRectFunction · 0.85
MakeGraphicsContextFunction · 0.85
GetGraphBackgroundBrushFunction · 0.85
GetHeightMethod · 0.80
GetWidthMethod · 0.45

Tested by

no test coverage detected