mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 22:41:07 +01:00
[rs] Use the "max" function to ensure that the swapchain size is not less than 1. For better readability.
This commit is contained in:
1 parent
f72ff5e1ee
commit
e9d68a332d
1 file changed
+2
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user