Fix image height in status view

This commit is contained in:
Marcin Czachurski 2023-09-10 12:03:08 +02:00
parent d3aa3b7099
commit ed94179b1d
1 changed files with 6 additions and 2 deletions

View File

@ -47,8 +47,12 @@ struct ImagesCarousel: View {
// Calculate size of frame (first from cache, then from metadata).
if let highestImage, let size = ImageSizeService.shared.get(for: highestImage.url) {
self.imageWidth = size.width
self.imageHeight = size.height
let calculatedSize = ImageSizeService.shared.calculate(width: size.width,
height: size.height,
andContainerWidth: UIScreen.main.bounds.size.width)
self.imageWidth = calculatedSize.width
self.imageHeight = calculatedSize.height
self.heightWasPrecalculated = true
} else if let highestImage, imgHeight > 0 && imgWidth > 0 {