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

Method sync_highlighted_points_from_widget

src/plot_state.rs:139–152  ·  view source on GitHub ↗

Sync hover/pick highlight overlay points from the widget without rebuilding plot geometry. Returns true if the overlay data changed.

(&mut self, widget: &PlotWidget)

Source from the content-addressed store, hash-verified

137 last_point_y: None,
138 prev_last_point_y: None,
139 }
140 }
141}
142
143impl PlotState {
144 /// Sync hover/pick highlight overlay points from the widget without rebuilding plot geometry.
145 ///
146 /// Returns true if the overlay data changed.
147 pub(crate) fn sync_highlighted_points_from_widget(&mut self, widget: &PlotWidget) -> bool {
148 let highlighted_points: Vec<_> = widget
149 .visible_highlighted_points()
150 .map(|(highlight_point, _)| highlight_point.clone())
151 .collect();
152
153 if self.highlighted_points.as_ref() != highlighted_points.as_slice() {
154 self.highlight_version = self.highlight_version.wrapping_add(1);
155 self.highlighted_points = highlighted_points.into();

Callers 2

rebuild_from_widgetMethod · 0.80
update_plot_programFunction · 0.80

Calls 3

mapMethod · 0.80
as_sliceMethod · 0.80

Tested by

no test coverage detected