MCPcopy Create free account
hub / github.com/donkeyteethUX/iced_plot / draw_fills

Function draw_fills

src/plot_renderer/canvas.rs:117–134  ·  view source on GitHub ↗
(frame: &mut Frame, state: &PlotState, bounds: Rectangle)

Source from the content-addressed store, hash-verified

115}
116
117fn 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
136fn draw_lines(frame: &mut Frame, state: &PlotState, bounds: Rectangle) {
137 for series in state.series.iter() {

Callers 1

drawFunction · 0.85

Calls 2

world_to_canvas_pointFunction · 0.85
newFunction · 0.50

Tested by

no test coverage detected