mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 23:04:07 +00:00
[rs] Merge #753
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>
This commit is contained in:
commit
2dafc7c321
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user