diff --git a/egui/src/widgets/plot/mod.rs b/egui/src/widgets/plot/mod.rs index 50e7cfe1..79c2350f 100644 --- a/egui/src/widgets/plot/mod.rs +++ b/egui/src/widgets/plot/mod.rs @@ -489,6 +489,14 @@ impl Plot { /// Interact with and add items to the plot and finally draw it. pub fn show(self, ui: &mut Ui, build_fn: impl FnOnce(&mut PlotUi) -> R) -> InnerResponse { + self.show_dyn(ui, Box::new(build_fn)) + } + + fn show_dyn<'a, R>( + self, + ui: &mut Ui, + build_fn: Box R + 'a>, + ) -> InnerResponse { let Self { id_source, center_x_axis,