Fix minimize panicking on custom-shader example. (#291)

- Closes #282
This commit is contained in:
Jay Oster 2022-07-27 10:26:05 -07:00 committed by GitHub
parent 46ddf4e3f0
commit 41063dbf4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,6 +155,10 @@ impl NoiseRenderer {
} }
pub(crate) fn resize(&mut self, pixels: &pixels::Pixels, width: u32, height: u32) { pub(crate) fn resize(&mut self, pixels: &pixels::Pixels, width: u32, height: u32) {
if width == 0 || height == 0 {
return;
}
self.texture_view = create_texture_view(pixels, width, height); self.texture_view = create_texture_view(pixels, width, height);
self.bind_group = create_bind_group( self.bind_group = create_bind_group(
pixels.device(), pixels.device(),