From 2e7ad1626e4832c915a3073852399b09ef3647e1 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 26 Jun 2023 20:47:38 -0700 Subject: [PATCH] Fix avatars being squished in certain places Closes #414 --- .../ActionNotificationGroupCollectionViewCell.swift | 2 +- .../FollowNotificationGroupCollectionViewCell.swift | 1 + .../FollowRequestNotificationCollectionViewCell.swift | 1 + .../Views/Status/ConversationMainStatusCollectionViewCell.swift | 1 + Tusker/Views/Status/TimelineStatusCollectionViewCell.swift | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/Notifications/ActionNotificationGroupCollectionViewCell.swift b/Tusker/Screens/Notifications/ActionNotificationGroupCollectionViewCell.swift index 82083977..d0995027 100644 --- a/Tusker/Screens/Notifications/ActionNotificationGroupCollectionViewCell.swift +++ b/Tusker/Screens/Notifications/ActionNotificationGroupCollectionViewCell.swift @@ -146,7 +146,7 @@ class ActionNotificationGroupCollectionViewCell: UICollectionViewListCell { avatarStack.arrangedSubviews.forEach { $0.removeFromSuperview() } for avatarURL in people.lazy.compactMap(\.avatar).prefix(10) { let imageView = CachedImageView(cache: .avatars) - imageView.contentMode = .scaleAspectFit + imageView.contentMode = .scaleAspectFill imageView.layer.masksToBounds = true imageView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadiusFraction * 30 imageView.layer.cornerCurve = .continuous diff --git a/Tusker/Screens/Notifications/FollowNotificationGroupCollectionViewCell.swift b/Tusker/Screens/Notifications/FollowNotificationGroupCollectionViewCell.swift index d79e3ff8..9f835311 100644 --- a/Tusker/Screens/Notifications/FollowNotificationGroupCollectionViewCell.swift +++ b/Tusker/Screens/Notifications/FollowNotificationGroupCollectionViewCell.swift @@ -121,6 +121,7 @@ class FollowNotificationGroupCollectionViewCell: UICollectionViewListCell { avatarStack.arrangedSubviews.forEach { $0.removeFromSuperview() } for avatarURL in people.lazy.compactMap(\.avatar).prefix(10) { let imageView = CachedImageView(cache: .avatars) + imageView.contentMode = .scaleAspectFill imageView.layer.masksToBounds = true imageView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadiusFraction * 30 imageView.layer.cornerCurve = .continuous diff --git a/Tusker/Screens/Notifications/FollowRequestNotificationCollectionViewCell.swift b/Tusker/Screens/Notifications/FollowRequestNotificationCollectionViewCell.swift index c98917ff..871e69b0 100644 --- a/Tusker/Screens/Notifications/FollowRequestNotificationCollectionViewCell.swift +++ b/Tusker/Screens/Notifications/FollowRequestNotificationCollectionViewCell.swift @@ -20,6 +20,7 @@ class FollowRequestNotificationCollectionViewCell: UICollectionViewListCell { } private let avatarImageView = CachedImageView(cache: .avatars).configure { + $0.contentMode = .scaleAspectFill $0.layer.masksToBounds = true $0.layer.cornerCurve = .continuous NSLayoutConstraint.activate([ diff --git a/Tusker/Views/Status/ConversationMainStatusCollectionViewCell.swift b/Tusker/Views/Status/ConversationMainStatusCollectionViewCell.swift index ca1df427..6da79b08 100644 --- a/Tusker/Views/Status/ConversationMainStatusCollectionViewCell.swift +++ b/Tusker/Views/Status/ConversationMainStatusCollectionViewCell.swift @@ -28,6 +28,7 @@ class ConversationMainStatusCollectionViewCell: UICollectionViewListCell, Status private static let avatarImageViewSize: CGFloat = 50 private(set) lazy var avatarImageView = CachedImageView(cache: .avatars).configure { + $0.contentMode = .scaleAspectFill $0.layer.masksToBounds = true $0.layer.cornerCurve = .continuous NSLayoutConstraint.activate([ diff --git a/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift b/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift index 3acf98f9..1aa606b3 100644 --- a/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift +++ b/Tusker/Views/Status/TimelineStatusCollectionViewCell.swift @@ -75,6 +75,7 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti private static let avatarImageViewSize: CGFloat = 50 private(set) lazy var avatarImageView = CachedImageView(cache: .avatars).configure { + $0.contentMode = .scaleAspectFill $0.layer.masksToBounds = true $0.layer.cornerCurve = .continuous NSLayoutConstraint.activate([