Fix album artwork sizing
This commit is contained in:
1 parent
4db0f2f8ff
commit
ec734926e9
1 file changed
+4
-1
@@ -5,6 +5,7 @@ struct AlbumArtworkView: View {
|
|||||||
var cornerRadius: CGFloat = 12
|
var cornerRadius: CGFloat = 12
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
GeometryReader { geometry in
|
||||||
AsyncImage(url: url) { phase in
|
AsyncImage(url: url) { phase in
|
||||||
switch phase {
|
switch phase {
|
||||||
case .success(let image):
|
case .success(let image):
|
||||||
@@ -20,7 +21,9 @@ struct AlbumArtworkView: View {
|
|||||||
artworkPlaceholder
|
artworkPlaceholder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity)
|
.frame(width: geometry.size.width, height: geometry.size.height)
|
||||||
|
.clipped()
|
||||||
|
}
|
||||||
.aspectRatio(1, contentMode: .fit)
|
.aspectRatio(1, contentMode: .fit)
|
||||||
.clipShape(RoundedRectangle(cornerRadius: cornerRadius, style: .continuous))
|
.clipShape(RoundedRectangle(cornerRadius: cornerRadius, style: .continuous))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user