! * Fills the area between the lines and the bottom of the panel with the given * color. */
| 186 | * color. |
| 187 | */ |
| 188 | void 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 | |
| 206 | void DrawLegend(size_t height, wxPaintDC& dc, wxGraphicsContext& gc) |
| 207 | { |