Fixes #2253 - Fix timeline thumbnail frames for media missing sizing info

This commit is contained in:
Stefan Ceriu
2023-12-18 12:05:58 +00:00
committed by GitHub
parent a705d18ba6
commit ca2551da9f
5 changed files with 16 additions and 10 deletions

View File

@@ -27,10 +27,15 @@ extension View {
aspectRatio(contentAspectRatio, contentMode: .fit)
.frame(minHeight: minMediaHeight, maxHeight: minMediaHeight)
} else {
aspectRatio(contentAspectRatio, contentMode: .fit)
.frame(maxHeight: min(maxMediaHeight, max(minMediaHeight, contentHeight ?? .infinity)))
// Required to prevent the reply details to get higher priority in rendering the width of the view.
.aspectRatio(contentAspectRatio, contentMode: .fit)
if let contentAspectRatio {
aspectRatio(contentAspectRatio, contentMode: .fit)
.frame(maxHeight: min(maxMediaHeight, max(minMediaHeight, contentHeight ?? .infinity)))
// Required to prevent the reply details to get higher priority in rendering the width of the view.
.aspectRatio(contentAspectRatio, contentMode: .fit)
} else { // Otherwise let the image load and use its native aspect ratio with a max height
aspectRatio(contentMode: .fit)
.frame(maxHeight: maxMediaHeight)
}
}
}
}