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 } }