Skip to content

Commit

Permalink
Merge #42
Browse files Browse the repository at this point in the history
42: Check window sizes before updating the view r=kvark

Fixes crashes on Windows machines when trying to minimize application
  • Loading branch information
bors[bot] committed Jun 30, 2017
2 parents 3bf1eaa + ab70830 commit 9e0e1d8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,15 @@ impl Renderer {

#[doc(hidden)]
pub fn resize(&mut self, window: &glutin::Window) {
self.size = window.get_inner_size_pixels().unwrap();
let size = window.get_inner_size_pixels().unwrap();

// skip updating view and self size if some
// of the sides equals to zero (fixes crash on minimize on Windows machines)
if size.0 == 0 || size.1 == 0 {
return
}

self.size = size;
gfx_window_glutin::update_views(window, &mut self.out_color, &mut self.out_depth);
}

Expand Down

0 comments on commit 9e0e1d8

Please sign in to comment.