From 3511673e74cd90e051e8627590085ddf06107452 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 14 Aug 2023 16:09:52 +0200 Subject: [PATCH] Don't catch clicks and drags on axes --- crates/egui/src/widgets/plot/axis.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/egui/src/widgets/plot/axis.rs b/crates/egui/src/widgets/plot/axis.rs index 077a1dab1..e210cf3d8 100644 --- a/crates/egui/src/widgets/plot/axis.rs +++ b/crates/egui/src/widgets/plot/axis.rs @@ -196,8 +196,8 @@ impl AxisWidget { impl Widget for AxisWidget { fn ui(self, ui: &mut Ui) -> Response { - // --- add label --- - let response = ui.allocate_rect(self.rect, Sense::click_and_drag()); + let response = ui.allocate_rect(self.rect, Sense::hover()); + if ui.is_rect_visible(response.rect) { let visuals = ui.style().visuals.clone(); let text = self.hints.label; @@ -316,6 +316,7 @@ impl Widget for AxisWidget { } } } + response } }