From 661af7c1fbcc04c4981821474f7c97fc9e2a0c0e Mon Sep 17 00:00:00 2001 From: Verox001 Date: Sun, 4 May 2025 01:13:13 +0200 Subject: [PATCH] Fixed surface non-zero issue --- simulator/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/simulator/src/main.rs b/simulator/src/main.rs index 3f9cb51..b99871e 100644 --- a/simulator/src/main.rs +++ b/simulator/src/main.rs @@ -1,3 +1,4 @@ +use std::cmp::max; use std::sync::Arc; use pollster::FutureExt; @@ -139,8 +140,8 @@ impl<'a> State<'a> { pub fn resize(&mut self, new_size: PhysicalSize) { self.size = new_size; - self.config.width = new_size.width; - self.config.height = new_size.height; + self.config.width = max(new_size.width, 1); + self.config.height = max(new_size.height, 1); self.surface.configure(&self.device, &self.config);