Skip to content

Commit

Permalink
Fixes #2253 - Fix timeline thumbnail frames for media missing sizing …
Browse files Browse the repository at this point in the history
…info
  • Loading branch information
stefanceriu committed Dec 18, 2023
1 parent 123164f commit fda042b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ElementX/Sources/Other/SwiftUI/Layout/TimelineMediaFrame.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ 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
frame(maxHeight: maxMediaHeight)
}
}
}
}
1 change: 1 addition & 0 deletions changelog.d/2253.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix timeline thumbnail frames for media missing sizing info

0 comments on commit fda042b

Please sign in to comment.