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

Method request_hover

src/picking.rs:70–96  ·  view source on GitHub ↗
(
        &mut self,
        instance_id: u64,
        cursor: Vec2,
        hover_radius_px: f32,
        force_cpu: bool,
        points: &[Point],
        series: &[SeriesSpan],
        camera: &Ca

Source from the content-addressed store, hash-verified

68 /// CPU vs GPU is decided internally based on point count.
69 #[allow(clippy::too_many_arguments)]
70 pub(crate) fn request_hover(
71 &mut self,
72 instance_id: u64,
73 cursor: Vec2,
74 hover_radius_px: f32,
75 force_cpu: bool,
76 points: &[Point],
77 series: &[SeriesSpan],
78 camera: &Camera,
79 bounds: &Rectangle,
80 valid_point_id: impl Fn(&PointId) -> bool,
81 ) -> HoverRequest {
82 if force_cpu || points.len() < CPU_PICK_THRESHOLD {
83 if let Some(point) =
84 cpu_pick_hit(points, series, camera, bounds, cursor, hover_radius_px)
85 && valid_point_id(&point)
86 {
87 self.last_hover_cache = Some(point);
88 HoverRequest::CpuHit(point)
89 } else {
90 HoverRequest::CpuMiss
91 }
92 } else {
93 self.submit_gpu_request(instance_id, cursor, hover_radius_px);
94 HoverRequest::RequestedGpu
95 }
96 }
97
98 /// Request a click-to-pick hit at the current cursor position.
99 ///

Callers 1

Calls 2

cpu_pick_hitFunction · 0.85
submit_gpu_requestMethod · 0.80

Tested by

no test coverage detected