diff --git a/crates/bevy_sprite/src/texture_atlas_builder.rs b/crates/bevy_sprite/src/texture_atlas_builder.rs index c09b819037272..e26ac27c87688 100644 --- a/crates/bevy_sprite/src/texture_atlas_builder.rs +++ b/crates/bevy_sprite/src/texture_atlas_builder.rs @@ -168,10 +168,11 @@ impl TextureAtlasBuilder { &contains_smallest_box, ) { Ok(rect_placements) => { - atlas_texture = Texture::new_fill( - Extent3d::new(current_width, current_height, 1), + let size = Extent3d::new(current_width, current_height, 1); + atlas_texture = Texture::new( + size, TextureDimension::D2, - &[0, 0, 0, 0], + vec![0; self.format.pixel_size() * size.volume()], self.format, ); Some(rect_placements)