Skip to content

Commit

Permalink
avoid crash on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
rlidwka committed Dec 16, 2024
1 parent b5d0c42 commit 3c9e8eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/common/debug_render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ fn display_debug_render_ui(
mut settings: ResMut<DebugRenderSettings>,
) {
const TOOLTIP_MARGIN: f32 = 10.;
let ctx = egui_contexts.ctx_mut();
let Some(egui_ctx) = egui_contexts.try_ctx_mut() else { return; };
Window::new("debug_render_ui")
.anchor(Align2::RIGHT_TOP, egui::vec2(-TOOLTIP_MARGIN, TOOLTIP_MARGIN))
.title_bar(false)
.auto_sized()
.resizable(false)
.show(ctx, |ui| {
.show(egui_ctx, |ui| {
macro_rules! checkbox {
($setting: ident, $desc: literal) => {
let orig_value = settings.$setting > 0.;
Expand Down
2 changes: 1 addition & 1 deletion examples/common/orbit_camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn apply_camera_controls(
mut egui_contexts: EguiContexts,
mut camera_query: Query<&mut OrbitCamera>,
) {
let egui_ctx = egui_contexts.ctx_mut();
let Some(egui_ctx) = egui_contexts.try_ctx_mut() else { return; };
if egui_ctx.wants_pointer_input() { return; }

enum MyEvent {
Expand Down

0 comments on commit 3c9e8eb

Please sign in to comment.