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

Function draw

src/plot_renderer/canvas.rs:50–77  ·  view source on GitHub ↗
(
    renderer: &iced::Renderer,
    caches: &CanvasCaches,
    state: &PlotState,
    bounds: Rectangle,
)

Source from the content-addressed store, hash-verified

48}
49
50pub(crate) fn draw(
51 renderer: &iced::Renderer,
52 caches: &CanvasCaches,
53 state: &PlotState,
54 bounds: Rectangle,
55) -> Vec<Geometry> {
56 let frame_bounds = Rectangle::with_size(bounds.size());
57
58 let static_layer = caches
59 .static_layer
60 .draw_with_bounds(renderer, frame_bounds, |frame| {
61 draw_grid(frame, state, bounds);
62 draw_fills(frame, state, bounds);
63 draw_lines(frame, state, bounds);
64 draw_reference_lines(frame, state, bounds);
65 draw_markers(frame, state, bounds);
66 });
67
68 let overlay_layer = caches
69 .overlay_layer
70 .draw_with_bounds(renderer, frame_bounds, |frame| {
71 draw_highlights(frame, state, bounds);
72 draw_selection(frame, state);
73 draw_crosshairs(frame, state);
74 });
75
76 vec![static_layer, overlay_layer]
77}
78
79fn draw_grid(frame: &mut Frame, state: &PlotState, bounds: Rectangle) {
80 for tick in &state.x_ticks {

Callers 1

drawMethod · 0.85

Calls 9

draw_gridFunction · 0.85
draw_fillsFunction · 0.85
draw_linesFunction · 0.85
draw_reference_linesFunction · 0.85
draw_markersFunction · 0.85
draw_highlightsFunction · 0.85
draw_selectionFunction · 0.85
draw_crosshairsFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected