(frame: &mut Frame, state: &PlotState, bounds: Rectangle)
| 77 | } |
| 78 | |
| 79 | fn draw_grid(frame: &mut Frame, state: &PlotState, bounds: Rectangle) { |
| 80 | for tick in &state.x_ticks { |
| 81 | let color = match tick.tick.line_type { |
| 82 | TickWeight::Major => state.grid_style.major, |
| 83 | TickWeight::Minor => state.grid_style.minor, |
| 84 | TickWeight::SubMinor => state.grid_style.sub_minor, |
| 85 | }; |
| 86 | let line = canvas::Path::line( |
| 87 | iced::Point::new(tick.screen_pos, 0.0), |
| 88 | iced::Point::new(tick.screen_pos, bounds.height), |
| 89 | ); |
| 90 | frame.stroke( |
| 91 | &line, |
| 92 | canvas::Stroke::default() |
| 93 | .with_width(GRID_STROKE_WIDTH) |
| 94 | .with_color(color), |
| 95 | ); |
| 96 | } |
| 97 | |
| 98 | for tick in &state.y_ticks { |
| 99 | let color = match tick.tick.line_type { |
| 100 | TickWeight::Major => state.grid_style.major, |
| 101 | TickWeight::Minor => state.grid_style.minor, |
| 102 | TickWeight::SubMinor => state.grid_style.sub_minor, |
| 103 | }; |
| 104 | let line = canvas::Path::line( |
| 105 | iced::Point::new(0.0, tick.screen_pos), |
| 106 | iced::Point::new(bounds.width, tick.screen_pos), |
| 107 | ); |
| 108 | frame.stroke( |
| 109 | &line, |
| 110 | canvas::Stroke::default() |
| 111 | .with_width(GRID_STROKE_WIDTH) |
| 112 | .with_color(color), |
| 113 | ); |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | fn draw_fills(frame: &mut Frame, state: &PlotState, bounds: Rectangle) { |
| 118 | for fill in state.fills.iter() { |
no test coverage detected