From 286b53d2fb84067149c933b3062fe8ad94b5df83 Mon Sep 17 00:00:00 2001 From: laundmo Date: Fri, 26 Aug 2022 19:20:51 +0200 Subject: [PATCH] fix jumping on egui click, extend example --- examples/egui.rs | 4 ++++ src/lib.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/examples/egui.rs b/examples/egui.rs index 17b1c46..d161b63 100644 --- a/examples/egui.rs +++ b/examples/egui.rs @@ -21,6 +21,10 @@ fn egui_setup(mut egui_context: ResMut) { .resizable(false) .show(egui_context.ctx_mut(), |ui| { ScrollArea::vertical().show(ui, |ui| { + ui.add_space(100.); + ui.color_edit_button_rgb(&mut [0., 0., 0.]); + ui.add(egui::Slider::new(&mut 0.0, 0.0..=1.0).step_by(0.001)); + ui.checkbox(&mut true, "Test"); ui.vertical(|ui| { for i in 0..50 { ui.label(format!("list entry number {i}")); diff --git a/src/lib.rs b/src/lib.rs index 57ff793..afa1dc6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -78,6 +78,7 @@ fn camera_movement( #[cfg(feature = "bevy_egui")] if let Some(mut egui_ctx) = egui_ctx { if egui_ctx.ctx_mut().wants_pointer_input() || egui_ctx.ctx_mut().wants_keyboard_input() { + *last_pos = None; return; } }