From c30bacf26c0379c1f0dfe451fa9795db04ee1576 Mon Sep 17 00:00:00 2001 From: griffi-gh <prasol258@gmail.com> Date: Tue, 11 Mar 2025 10:52:07 +0100 Subject: [PATCH] add texture zero --- hui-painter/src/texture.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hui-painter/src/texture.rs b/hui-painter/src/texture.rs index 001da2b..bb16ad0 100644 --- a/hui-painter/src/texture.rs +++ b/hui-painter/src/texture.rs @@ -166,7 +166,7 @@ impl TextureAtlas { pub(crate) fn new(size: UVec2) -> Self { assert_size(size); let data_bytes = (size.x * size.y) as usize * RGBA_BYTES_PER_PIXEL; - Self { + let mut this = Self { size, data: vec![0; data_bytes], packer: DensePacker::new( @@ -177,7 +177,9 @@ impl TextureAtlas { allocations: HashMap::default(), reuse_allocations: Vec::new(), version: 0, - } + }; + this.allocate_with_data(SourceTextureFormat::A8, &[255], 1); + this } /// The version of the atlas, incremented every time the atlas is modified.