Update television/preview/previewers/files.rs

This commit is contained in:
Alexandre Pasmantier 2025-03-05 15:47:01 +01:00 committed by GitHub
parent 2a02c7801e
commit 49da575cde
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -284,7 +284,7 @@ pub fn try_preview(
};
if let Some(image) = option_image {
let preview_window_dimension = preview_window.map(|rect| {
(u32::from(rect.width - 2), u32::from(rect.height - 2)) // - 2 for the marge
(u32::from(rect.width.saturating_sub(2)), u32::from(rect.height.saturating_sub(2))) // - 2 for the margin
});
let image_preview_widget = ImagePreviewWidget::from_dynamic_image(
image,