Fixed surface non-zero issue
This commit is contained in:
parent
16d02c6789
commit
661af7c1fb
@ -1,3 +1,4 @@
|
|||||||
|
use std::cmp::max;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use pollster::FutureExt;
|
use pollster::FutureExt;
|
||||||
@ -139,8 +140,8 @@ impl<'a> State<'a> {
|
|||||||
pub fn resize(&mut self, new_size: PhysicalSize<u32>) {
|
pub fn resize(&mut self, new_size: PhysicalSize<u32>) {
|
||||||
self.size = new_size;
|
self.size = new_size;
|
||||||
|
|
||||||
self.config.width = new_size.width;
|
self.config.width = max(new_size.width, 1);
|
||||||
self.config.height = new_size.height;
|
self.config.height = max(new_size.height, 1);
|
||||||
|
|
||||||
self.surface.configure(&self.device, &self.config);
|
self.surface.configure(&self.device, &self.config);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user