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

Function FillUpTo

src/effects/DynamicRangeProcessorHistoryPanel.cpp:188–204  ·  view source on GitHub ↗

! * Fills the area between the lines and the bottom of the panel with the given * color. */

Source from the content-addressed store, hash-verified

186 * color.
187 */
188void FillUpTo(
189 std::vector<wxPoint2DDouble> lines, const wxColor& color,
190 wxGraphicsContext& gc, const wxRect& rect)
191{
192 const auto height = rect.GetHeight();
193 const auto left = std::max<double>(rect.GetX(), lines.front().m_x);
194 const auto right = std::min<double>(rect.GetWidth(), lines.back().m_x);
195 auto area = gc.CreatePath();
196 area.MoveToPoint(right, height);
197 area.AddLineToPoint(left, height);
198 std::for_each(lines.begin(), lines.end(), [&area](const auto& p) {
199 area.AddLineToPoint(p);
200 });
201 area.CloseSubpath();
202 gc.SetBrush(color);
203 gc.FillPath(area);
204}
205
206void DrawLegend(size_t height, wxPaintDC& dc, wxGraphicsContext& gc)
207{

Callers 1

OnPaintMethod · 0.85

Calls 4

GetHeightMethod · 0.80
GetWidthMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected