From 375bbd4aa5b63d4d3d56a38c4d2fce534e1bb2ac Mon Sep 17 00:00:00 2001
From: Quaternions <krakow20@gmail.com>
Date: Fri, 3 Jan 2025 18:51:50 -0800
Subject: [PATCH] cap size to work around loop resize bug

---
 strafe-client/src/graphics_worker.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/strafe-client/src/graphics_worker.rs b/strafe-client/src/graphics_worker.rs
index c0c02eb..fffd778 100644
--- a/strafe-client/src/graphics_worker.rs
+++ b/strafe-client/src/graphics_worker.rs
@@ -34,8 +34,8 @@ pub fn new(
 			Instruction::Resize(size,user_settings)=>{
 				println!("Resizing to {:?}",size);
 				//let t0=std::time::Instant::now();
-				config.width=size.width.max(1);
-				config.height=size.height.max(1);
+				config.width=size.width.clamp(1,1920/2);
+				config.height=size.height.clamp(1,1080/2);
 				surface.configure(&device,&config);
 				graphics.resize(&device,&config,&user_settings);
 				//println!("Resize took {:?}",t0.elapsed());