(frame: &mut Frame, state: &PlotState, bounds: Rectangle)
| 115 | } |
| 116 | |
| 117 | fn draw_fills(frame: &mut Frame, state: &PlotState, bounds: Rectangle) { |
| 118 | for fill in state.fills.iter() { |
| 119 | for triangle in fill.vertices.chunks_exact(3) { |
| 120 | let points = [ |
| 121 | world_to_canvas_point(triangle[0], &state.camera, &bounds), |
| 122 | world_to_canvas_point(triangle[1], &state.camera, &bounds), |
| 123 | world_to_canvas_point(triangle[2], &state.camera, &bounds), |
| 124 | ]; |
| 125 | let path = canvas::Path::new(|builder| { |
| 126 | builder.move_to(points[0]); |
| 127 | builder.line_to(points[1]); |
| 128 | builder.line_to(points[2]); |
| 129 | builder.close(); |
| 130 | }); |
| 131 | frame.fill(&path, fill.color); |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | fn draw_lines(frame: &mut Frame, state: &PlotState, bounds: Rectangle) { |
| 137 | for series in state.series.iter() { |
no test coverage detected