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

Function draw_selection

src/plot_renderer/canvas.rs:348–359  ·  view source on GitHub ↗
(frame: &mut Frame, state: &PlotState)

Source from the content-addressed store, hash-verified

346}
347
348fn 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
361fn draw_crosshairs(frame: &mut Frame, state: &PlotState) {
362 if !state.crosshairs_enabled {

Callers 1

drawFunction · 0.85

Calls 2

selection_fill_colorFunction · 0.85
newFunction · 0.50

Tested by

no test coverage detected