This commit is contained in:
Rokonio 2021-08-09 00:32:21 +02:00 committed by GitHub
parent 0a403411bf
commit 7f5dbe7245
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -268,12 +268,14 @@ impl State {
} }
} }
fn resize(&mut self, new_size: winit::dpi::PhysicalSize<u32>) { pub fn resize(&mut self, new_size: winit::dpi::PhysicalSize<u32>) {
if new_size.width > 0 && new_size.height > 0 {
self.size = new_size; self.size = new_size;
self.sc_desc.width = new_size.width; self.sc_desc.width = new_size.width;
self.sc_desc.height = new_size.height; self.sc_desc.height = new_size.height;
self.swap_chain = self.device.create_swap_chain(&self.surface, &self.sc_desc); self.swap_chain = self.device.create_swap_chain(&self.surface, &self.sc_desc);
} }
}
fn input(&mut self, event: &WindowEvent) -> bool { fn input(&mut self, event: &WindowEvent) -> bool {
match event { match event {