From cecb48af0340c665d1a70ba0256c172d70a83bf1 Mon Sep 17 00:00:00 2001 From: zam-5 <90490360+zam-5@users.noreply.github.com> Date: Sat, 19 Mar 2022 08:00:18 -0400 Subject: [PATCH] Added plot_ui::plot_clicked() (#1372) --- egui/src/widgets/plot/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/egui/src/widgets/plot/mod.rs b/egui/src/widgets/plot/mod.rs index c0254c12..3885fc11 100644 --- a/egui/src/widgets/plot/mod.rs +++ b/egui/src/widgets/plot/mod.rs @@ -767,6 +767,11 @@ impl PlotUi { self.response.hovered() } + /// Returns `true` if the plot was clicked by the primary button. + pub fn plot_clicked(&self) -> bool { + self.response.clicked() + } + /// The pointer position in plot coordinates. Independent of whether the pointer is in the plot area. pub fn pointer_coordinate(&self) -> Option { // We need to subtract the drag delta to keep in sync with the frame-delayed screen transform: