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

Function update_cursor_overlay_on_move

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

Source from the content-addressed store, hash-verified

1331fn clear_hover_effect(widget: &PlotWidget, state: &mut PlotState, effects: &mut UpdateEffects) {
1332 let should_clear_hover =
1333 state.picking.last_hover_cache.is_some() || !widget.hovered_points.is_empty();
1334
1335 if effects.hover_pick.is_none() && should_clear_hover {
1336 state.picking.last_hover_cache = None;
1337 effects.hover_pick = Some(HoverPickEvent::ClearHover);
1338 }
1339}
1340
1341fn maybe_submit_hover_request(
1342 widget: &PlotWidget,
1343 state: &mut PlotState,
1344 effects: &mut UpdateEffects,
1345) {
1346 if !state.hover_enabled || state.pan.active || state.selection.active {
1347 return;
1348 }
1349 if !state.cursor_inside() {
1350 clear_hover_effect(widget, state, effects);
1351 return;
1352 }
1353
1354 if effects.hover_pick.is_some() {
1355 return;
1356 }
1357
1358 let PlotState {
1359 picking: pick_state,
1360 cursor_position,
1361 hover_radius_px,
1362 points,
1363 series,
1364 camera,
1365 bounds,
1366 ..
1367 } = state;
1368 let force_cpu_picking = widget.render_strategy.force_cpu_picking();
1369
1370 match pick_state.request_hover(
1371 widget.instance_id,
1372 *cursor_position,
1373 *hover_radius_px,

Callers 1

update_plot_programFunction · 0.85

Calls 4

cursor_insideMethod · 0.80
screen_to_worldMethod · 0.80
plot_point_to_dataFunction · 0.70
newFunction · 0.50

Tested by

no test coverage detected