Skip to content

Commit

Permalink
Merge pull request #42 from bvssvni/master
Browse files Browse the repository at this point in the history
Fix bug when UI appears first time
  • Loading branch information
bvssvni committed Dec 27, 2015
2 parents fae97f1 + ed8d97c commit 487ec0e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Camera control: WASD\n\
}

widget_ids!(REFRESH);

for mut e in window {
if capture_cursor {
first_person.event(&e);
Expand All @@ -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()
Expand Down

0 comments on commit 487ec0e

Please sign in to comment.