From f7c9aa1fde79a2b2a89dc5a2f59c079b3ec1b0d7 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Thu, 17 Nov 2022 16:32:35 +0100 Subject: [PATCH] add plot_secondary_clicked to plot_ui --- crates/egui/src/widgets/plot/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/egui/src/widgets/plot/mod.rs b/crates/egui/src/widgets/plot/mod.rs index a0d72dba6428..33331d110f28 100644 --- a/crates/egui/src/widgets/plot/mod.rs +++ b/crates/egui/src/widgets/plot/mod.rs @@ -1055,6 +1055,11 @@ impl PlotUi { self.response.clicked() } + /// Returns `true` if the plot was clicked by the secondary button. + pub fn plot_secondary_clicked(&self) -> bool { + self.response.secondary_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: