Fixes #3173 - Force frame sizes for timeline items that are missing sizing info.

This commit is contained in:
Stefan Ceriu
2024-09-11 10:38:33 +03:00
committed by Stefan Ceriu
parent f1a705bab4
commit 955a12b819
21 changed files with 43 additions and 43 deletions

View File

@@ -11,6 +11,7 @@ extension View {
/// Constrains the max height of a media item in the timeline, whilst preserving its aspect ratio.
@ViewBuilder
func timelineMediaFrame(height contentHeight: CGFloat?, aspectRatio contentAspectRatio: CGFloat?) -> some View {
let defaultMediaSize = 100.0
let minMediaHeight = 100.0
let maxMediaHeight = 300.0
@@ -23,9 +24,8 @@ extension View {
.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)
} else { // Otherwise force the image to be `defaultMediaSize` x `defaultMediaSize`
frame(width: defaultMediaSize, height: defaultMediaSize)
}
}
}

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ec3b4d8dbd25c91790ca8a220c5d0d848dbc2e82668070ba4e1649990ba4d598
size 462017
oid sha256:f63e72b33f82f8b679dd8b1fc810078438914d70d395c23abd13571d01643597
size 227546

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ec3b4d8dbd25c91790ca8a220c5d0d848dbc2e82668070ba4e1649990ba4d598
size 462017
oid sha256:f63e72b33f82f8b679dd8b1fc810078438914d70d395c23abd13571d01643597
size 227546

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:63011572252e6377c8d7717c1623e2b733b38fb95a469718d8f8f75c4e622148
size 388241
oid sha256:fb0bce1bf5571926c9ae760503e3aff11bfa962d646e257ab9481bc9496b95a6
size 169079

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:63011572252e6377c8d7717c1623e2b733b38fb95a469718d8f8f75c4e622148
size 388241
oid sha256:fb0bce1bf5571926c9ae760503e3aff11bfa962d646e257ab9481bc9496b95a6
size 169079

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:45e913fecbfca17c27d455118c4b0a8adb477966a43f8865936387896859e26f
size 554832
oid sha256:bd110afc7d00be27146e58474b810415af9dc7d5ed6faf1536419f01f41f9a3a
size 404161

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:45e913fecbfca17c27d455118c4b0a8adb477966a43f8865936387896859e26f
size 554832
oid sha256:bd110afc7d00be27146e58474b810415af9dc7d5ed6faf1536419f01f41f9a3a
size 404161

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:139d1ad264ee618f6dd806f74db0bb09cc5f550ff6c6aec705e63695372200cb
size 476465
oid sha256:ef76e5d6f293ae298df0e70744ffed330e1fcb4a1e1157fbd7578e59bbe52fd4
size 336667

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:139d1ad264ee618f6dd806f74db0bb09cc5f550ff6c6aec705e63695372200cb
size 476465
oid sha256:ef76e5d6f293ae298df0e70744ffed330e1fcb4a1e1157fbd7578e59bbe52fd4
size 336667

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:91293e02a282b89e52d98d10c0ed042e107f58cd661455652c3a50a1295ac9a6
size 438937
oid sha256:517d2adbb60ff9e40d7b0f530b05f3810f302180fed9259673afe57f2598d669
size 174777

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:28d71dc48e5a4bc8671f67f4b1985ae98dd5f4df1817321bde786f724254cbcf
size 391551
oid sha256:c781557f5fe6df00faed8dd42be033130829d70463ddd32cf0fb2c5824b28a87
size 182594

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d15d0a6e23b80979c7f0025316673e7f20b1b7de6efdf700fb5fc2aebd33a1e2
size 441049
oid sha256:685784026c5fbf1676f2e41105303c150a8520c0588081960dd6c679cb16f86f
size 176916

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b2c46543a0eafef243bbed2b92dd889e7fdcc11dc39a7400f986c90cec47c2f2
size 396860
oid sha256:3d7c7b295d08a8f36ff42ba885f8e3633e5e63d877c08808043753ed3b145bc5
size 189906

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a5a5711cb02a63320e78b0001d014ef7342ab0b6df128af23c836239656cae3b
size 343702
oid sha256:0ad54f532f3ec4333e004b763956ea2ffec9aecfa0c3113b423f6a9f85ac87c7
size 127545

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b548f6af318563685185a8fe2ab1c59dce4712d88dc23b4d5e0b646e0f254d2f
size 286789
oid sha256:2f2a1fd7f2e30a9835c9c684da06cb5edfd352b14f53f4d3a8d665ea2aa798c0
size 134209

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8c8c1c59dd74c9d11e0496583ec9348d1fc7d1eb6504b975eda2e597b3d0fa8f
size 344963
oid sha256:8dd04554290d3299b0ce0a95d2304bce2d90a7c130f48a64efc6fc4b3b15727c
size 128846

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:98e22ec3f450dfc28e4e556b9b5cb7f41e11f2001029bfc4f668dcf48340e619
size 288246
oid sha256:a92c6e0f7a53d5fbffa090cb6bda583920317649b3f7e1cf8a96d74a1d9b64cf
size 136933

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cd3b3ad512b4fcd3bf9c4822f3332f61a23a20a880f791ca6693aaeb5ad8b3f0
size 81295
oid sha256:919c37cec762f3a5ead4e55e611e78bc3b6a52fdb6c2f2435d387511bdaf3bb3
size 81177

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cd3b3ad512b4fcd3bf9c4822f3332f61a23a20a880f791ca6693aaeb5ad8b3f0
size 81295
oid sha256:919c37cec762f3a5ead4e55e611e78bc3b6a52fdb6c2f2435d387511bdaf3bb3
size 81177

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d4c247516251a85727f948204a18127bce75f5aa7a640ca0248ecfc4d09eecd7
size 40156
oid sha256:bbf8a9e38c8188356a7e9758b7afbcbc84c4b58b4ada32999e1591883c99704c
size 40312

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d4c247516251a85727f948204a18127bce75f5aa7a640ca0248ecfc4d09eecd7
size 40156
oid sha256:bbf8a9e38c8188356a7e9758b7afbcbc84c4b58b4ada32999e1591883c99704c
size 40312