Show legend widget and update memory with legend state.
(
legend: Option<LegendWidget>,
ui: &mut Ui,
mem: &mut PlotMemory,
hovered_plot_item: &mut Option<Id>,
)
| 974 | |
| 975 | /// Show legend widget and update memory with legend state. |
| 976 | fn show_legend_and_update_memory( |
| 977 | legend: Option<LegendWidget>, |
| 978 | ui: &mut Ui, |
| 979 | mem: &mut PlotMemory, |
| 980 | hovered_plot_item: &mut Option<Id>, |
| 981 | ) { |
| 982 | if let Some(mut legend) = legend { |
| 983 | ui.add(&mut legend); |
| 984 | mem.hidden_items = legend.hidden_items(); |
| 985 | mem.hovered_legend_item = legend.hovered_item(); |
| 986 | if let Some(item_id) = &mem.hovered_legend_item { |
| 987 | hovered_plot_item.get_or_insert(*item_id); |
| 988 | } |
| 989 | } |
| 990 | } |
| 991 | |
| 992 | fn compute_bounds(&self, ui: &Ui, mem: &mut PlotMemory, plot_ui: &PlotUi<'a>, plot_rect: Rect) { |
| 993 | // Find the cursors from other plots we need to draw |
nothing calls this directly
no test coverage detected