diff options
| -rw-r--r-- | src/texture.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/texture.rs b/src/texture.rs index 37f3a98..456f230 100644 --- a/src/texture.rs +++ b/src/texture.rs @@ -92,7 +92,6 @@ impl<'a> TextureAtlases<'a> { packer: MultiTexturePacker::new_skyline(TexturePackerConfig { max_width: width, max_height: height, - //trim: false, ..Default::default() }), width, @@ -179,6 +178,14 @@ impl<'a> TextureAtlases<'a> { Ok(()) } + fn clear(&mut self) { + self.packer = MultiTexturePacker::new_skyline(TexturePackerConfig { + max_width: self.width, + max_height: self.height, + ..Default::default() + }); + } + fn images(&mut self) -> ExportResult<&[RgbaImage]> { self.fill_images()?; Ok(&self.images) @@ -320,4 +327,8 @@ impl WgpuTextures { atlas_size, ); } + + pub fn clear_textures(&mut self) { + self.atlases.clear(); + } } |
