fix: Clean version with cache and dynamic size images

This commit is contained in:
azy 2025-02-24 20:41:57 +09:00
parent c6cb971f22
commit 8c07128567

View File

@ -152,8 +152,6 @@ impl CachedImageData {
CachedImageData::new(resized_image)
}
pub fn image_preview_widget(&self, inner: Rect) -> ImagePreviewWidget {
// inner has to be the inner of the preview_block given
// if nothing in the cache of the image, or the area has changed, generate a new image to be displayed and cache it
if self.cache().lock().unwrap().is_none()
|| self.cache().lock().unwrap().as_ref().unwrap().area != inner