diff --git a/src/sky_texture.rs b/src/sky_texture.rs index 884cf15..880acc4 100644 --- a/src/sky_texture.rs +++ b/src/sky_texture.rs @@ -91,8 +91,8 @@ pub fn spawn_full_sky_texture( .single() .map_or((1.0, 1.0), |v| (v.width(), v.height())); let size = Extent3d { - width: width as u32, - height: height as u32, + width: width.max(1.0) as u32, + height: height.max(1.0) as u32, ..default() }; @@ -134,6 +134,10 @@ fn resize_full_sky_on_window_change( let width = window.width() as u32; let height = window.height() as u32; + if width == 0 || height == 0 { + return; + } + if let Some(image) = images.get_mut(&sky_handles.render_target) { image.resize(Extent3d { width,