1
1
Fork 0
mirror of https://github.com/griffi-gh/hUI.git synced 2025-04-01 21:46:29 -05:00

add texture zero

This commit is contained in:
griffi-gh 2025-03-11 10:52:07 +01:00
parent 537d138651
commit c30bacf26c

View file

@ -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.