From ed8d97cd96ba76962340c2df9c5e888370fb98e6 Mon Sep 17 00:00:00 2001 From: Sven Nilsen Date: Sun, 27 Dec 2015 15:57:47 +0100 Subject: [PATCH] Fix bug when UI appears first time --- src/lib.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 80162e4..159f014 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -112,7 +112,7 @@ Camera control: WASD\n\ } widget_ids!(REFRESH); - + for mut e in window { if capture_cursor { first_person.event(&e); @@ -136,9 +136,14 @@ Camera control: WASD\n\ debug_renderer.draw_marker(ground_pos, 0.1, yellow); debug_renderer.render(stream, mvp).unwrap(); }); - if !capture_cursor { + if capture_cursor { + // Send render events to make Conrod update window size. + if e.render_args().is_some() { + ui.handle_event(&e); + } + } else { use conrod::*; - + ui.handle_event(&e); e.update(|_| ui.set_widgets(|ui| { Button::new()