From 36acdf420ed0b9d49d55d9318e3adf9ab0ddfd27 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sun, 10 Sep 2023 18:23:30 -0700 Subject: [PATCH] perf: remove zstack on profile pictures helps a bit? I think? --- damus/Views/Profile/ProfilePicView.swift | 27 +++++++++++------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/damus/Views/Profile/ProfilePicView.swift b/damus/Views/Profile/ProfilePicView.swift index a22f136f..6467cf98 100644 --- 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