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 b23621f commit 874e3c7
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()
}

Check warning on line 103 in src/platform/winit/mod.rs

View check run for this annotation

Codecov / codecov/patch

src/platform/winit/mod.rs#L101-L103

Added lines #L101 - L103 were not covered by tests
}
}

Expand Down

0 comments on commit 874e3c7

Please sign in to comment.