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

Function consume_gpu_pick_results

src/plot_widget.rs:1388–1418  ·  view source on GitHub ↗
(
    widget: &PlotWidget,
    state: &mut PlotState,
    effects: &mut UpdateEffects,
)

Source from the content-addressed store, hash-verified

1386 }
1387 picking::HoverRequest::RequestedGpu => {
1388 // Keep drawing until the result arrives.
1389 effects.needs_redraw = true;
1390 }
1391 }
1392}
1393
1394fn update_cursor_overlay_on_move(
1395 widget: &PlotWidget,
1396 state: &PlotState,
1397 effects: &mut UpdateEffects,
1398) {
1399 if !widget.cursor_overlay {
1400 return;
1401 }
1402 if state.cursor_inside() {
1403 let viewport = Vec2::new(state.bounds.width, state.bounds.height);
1404 let plot = state.camera.screen_to_world(
1405 DVec2::new(
1406 state.cursor_position.x as f64,
1407 state.cursor_position.y as f64,
1408 ),
1409 DVec2::new(viewport.x as f64, viewport.y as f64),
1410 );
1411 let Some(world) =
1412 plot_point_to_data([plot.x, plot.y], widget.x_axis_scale, widget.y_axis_scale)
1413 else {
1414 effects.clear_cursor_position = true;
1415 return;
1416 };
1417 let text = if let Some(p) = &widget.cursor_provider {
1418 (p)(world[0], world[1])
1419 } else {
1420 format!("{:.4}, {:.4}", world[0], world[1])
1421 };

Callers 1

update_plot_programFunction · 0.85

Calls 3

clear_hover_effectFunction · 0.85
consume_gpu_resultMethod · 0.80
valid_point_idMethod · 0.80

Tested by

no test coverage detected