commit 36acdf420ed0b9d49d55d9318e3adf9ab0ddfd27
parent 76a6dbc4060caa2ad33d84a3321fc47b24252c2f
Author: William Casarin <jb55@jb55.com>
Date: Sun, 10 Sep 2023 18:23:30 -0700
perf: remove zstack on profile pictures
helps a bit? I think?
Diffstat:
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/damus/Views/Profile/ProfilePicView.swift b/damus/Views/Profile/ProfilePicView.swift
@@ -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