Sync hover/pick highlight overlay points from the widget without rebuilding plot geometry. Returns true if the overlay data changed.
(&mut self, widget: &PlotWidget)
| 137 | last_point_y: None, |
| 138 | prev_last_point_y: None, |
| 139 | } |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | impl 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(); |
no test coverage detected