Fixed surface non-zero issue

This commit is contained in:
Verox001 2025-05-04 01:13:13 +02:00
parent 16d02c6789
commit 661af7c1fb

View File

@ -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<u32>) {
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);