Skip to content

Commit

Permalink
Fix panic on startup on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
breqdev committed Nov 10, 2023
1 parent 594458c commit fabd1e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/platform/winit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ impl SyncPlatform for WinitPlatform {
}

if let Some(size) = input.window_resized() {
pixels.resize_surface(size.width, size.height).unwrap();
// Winit bug, sometimes we get window_resized with -1
if size.width != u32::MAX && size.height != u32::MAX {
pixels.resize_surface(size.width, size.height).unwrap()
}
}
}

Expand Down

0 comments on commit fabd1e3

Please sign in to comment.