Skip to content

Commit

Permalink
[rs] Merge gfx-rs#753
Browse files Browse the repository at this point in the history
753: Use max function to ensure that the swapchain size is not less than 1. r=kvark a=Tnze

ATT

Co-authored-by: Tnze <cjd001113@outlook.com>
  • Loading branch information
bors[bot] and Tnze authored Feb 9, 2021
2 parents f72ff5e + e9d68a3 commit 2dafc7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wgpu/examples/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ fn start<E: Example>(
..
} => {
log::info!("Resizing to {:?}", size);
sc_desc.width = if size.width == 0 { 1 } else { size.width };
sc_desc.height = if size.height == 0 { 1 } else { size.height };
sc_desc.width = size.width.max(1);
sc_desc.height = size.height.max(1);
example.resize(&sc_desc, &device, &queue);
swap_chain = device.create_swap_chain(&surface, &sc_desc);
}
Expand Down

0 comments on commit 2dafc7c

Please sign in to comment.