mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 23:00:04 -04:00
Don't catch clicks and drags on axes
This commit is contained in:
@@ -196,8 +196,8 @@ impl<const AXIS: usize> AxisWidget<AXIS> {
|
|||||||
|
|
||||||
impl<const AXIS: usize> Widget for AxisWidget<AXIS> {
|
impl<const AXIS: usize> Widget for AxisWidget<AXIS> {
|
||||||
fn ui(self, ui: &mut Ui) -> Response {
|
fn ui(self, ui: &mut Ui) -> Response {
|
||||||
// --- add label ---
|
let response = ui.allocate_rect(self.rect, Sense::hover());
|
||||||
let response = ui.allocate_rect(self.rect, Sense::click_and_drag());
|
|
||||||
if ui.is_rect_visible(response.rect) {
|
if ui.is_rect_visible(response.rect) {
|
||||||
let visuals = ui.style().visuals.clone();
|
let visuals = ui.style().visuals.clone();
|
||||||
let text = self.hints.label;
|
let text = self.hints.label;
|
||||||
@@ -316,6 +316,7 @@ impl<const AXIS: usize> Widget for AxisWidget<AXIS> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
response
|
response
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user