1
0
mirror of git://jb55.com/damus synced 2024-09-16 02:03:45 +00:00

perf: remove zstack on profile pictures

helps a bit? I think?
This commit is contained in:
William Casarin 2023-09-10 18:23:30 -07:00
parent 76a6dbc406
commit 36acdf420e

View File

@ -45,27 +45,24 @@ struct InnerProfilePicView: View {
}
var body: some View {
ZStack {
Color(uiColor: .systemBackground)
KFAnimatedImage(url)
.imageContext(.pfp, disable_animation: disable_animation)
.onFailure(fallbackUrl: fallbackUrl, cacheKey: url?.absoluteString)
.cancelOnDisappear(true)
.configure { view in
view.framePreloadCount = 3
}
.placeholder { _ in
Placeholder
}
.scaledToFill()
}
KFAnimatedImage(url)
.imageContext(.pfp, disable_animation: disable_animation)
.onFailure(fallbackUrl: fallbackUrl, cacheKey: url?.absoluteString)
.cancelOnDisappear(true)
.configure { view in
view.framePreloadCount = 3
}
.placeholder { _ in
Placeholder
}
.scaledToFill()
.frame(width: size, height: size)
.clipShape(Circle())
.overlay(Circle().stroke(highlight_color(highlight), lineWidth: pfp_line_width(highlight)))
}
}
struct ProfilePicView: View {
let pubkey: Pubkey
let size: CGFloat