diff --git a/wgpu/examples/framework.rs b/wgpu/examples/framework.rs index 6dd9e92cb..69d7ed4c7 100644 --- a/wgpu/examples/framework.rs +++ b/wgpu/examples/framework.rs @@ -255,8 +255,8 @@ fn start( .. } => { 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); }