fix: weird placeholder images

This commit is contained in:
2025-01-20 11:40:23 +00:00
parent 62a7933de0
commit e66e7e938e
6 changed files with 32 additions and 21 deletions

View File

@ -54,8 +54,11 @@ impl Avatar {
if !ui.is_rect_visible(ui.cursor()) {
return Self::placeholder(ui, size_v);
}
match &self.image {
Some(img) => image_from_cache(img_cache, ui, img, Some(size))
match self
.image
.and_then(|i| image_from_cache(img_cache, ui, &i, Some(size)))
{
Some(img) => img
.rounding(Rounding::same(size_v))
.sense(Sense::click())
.ui(ui),