(frame: &mut Frame, state: &PlotState)
| 346 | } |
| 347 | |
| 348 | fn draw_selection(frame: &mut Frame, state: &PlotState) { |
| 349 | if !(state.selection.active || state.selection.moved) { |
| 350 | return; |
| 351 | } |
| 352 | |
| 353 | let start = state.selection.start; |
| 354 | let end = state.selection.end; |
| 355 | let top_left = iced::Point::new(start.x.min(end.x), start.y.min(end.y)); |
| 356 | let size = iced::Size::new((start.x - end.x).abs(), (start.y - end.y).abs()); |
| 357 | let rect = canvas::Path::rectangle(top_left, size); |
| 358 | frame.fill(&rect, selection_fill_color()); |
| 359 | } |
| 360 | |
| 361 | fn draw_crosshairs(frame: &mut Frame, state: &PlotState) { |
| 362 | if !state.crosshairs_enabled { |
no test coverage detected