Add logging when atlas allocator fails to allocate

This commit is contained in:
Keith Simmons 2022-04-11 10:31:38 -07:00
parent 7abd3a98a8
commit 0ca4c9946a
4 changed files with 16 additions and 4 deletions

View file

@ -33,7 +33,7 @@ impl ImageCache {
.remove(&image.id)
.or_else(|| self.curr_frame.get(&image.id).copied())
.or_else(|| self.atlases.upload(image.size(), image.as_bytes()))
.ok_or_else(|| anyhow!("Could not upload image of size {:?}", image.size()))
.ok_or_else(|| anyhow!("could not upload image of size {:?}", image.size()))
.unwrap();
self.curr_frame.insert(image.id, (alloc_id, atlas_bounds));
(alloc_id, atlas_bounds)