Small gap removed at the bottom of the federation icon

This commit is contained in:
Arnfried Griesert
2023-11-14 11:01:23 +01:00
parent 03312447ce
commit 9054a802d8
@@ -98,7 +98,7 @@ class RoomInfoBasicView: UIView {
} else {
avatarImageView.image = avatarImage
}
if BWIBuildSettings.shared.bwiUseCustomPersonalNotesAvatar {
if let session = AppDelegate.theDelegate().mxSessions.first as? MXSession {
let service = PersonalNotesDefaultService(mxSession: session)
@@ -115,13 +115,16 @@ class RoomInfoBasicView: UIView {
// because of svg we use fixed values here for the raw image size
let pillImageWidth: CGFloat = 23.0
let pillImageHeight: CGFloat = 18.0
let pillBorderSize: CGFloat = 2.57
let pillBorderSize: CGFloat = 3.0
// compensation for the bottom gap in the asset
let verticalShift: CGFloat = 2.5
let avatarSize = avatarImageView.frame.size.height
let pillHeight: CGFloat = avatarSize * 0.34 // 34% relative size by design rule
let pillWidth: CGFloat = pillHeight / pillImageHeight * pillImageWidth
let scaledBorderSize: CGFloat = pillBorderSize * pillHeight / pillImageHeight
let frame = CGRect(x: avatarImageView.frame.origin.x + avatarSize - pillWidth + scaledBorderSize, y: avatarImageView.frame.origin.y + avatarSize - pillHeight, width: pillWidth, height: pillHeight)
let frame = CGRect(x: avatarImageView.frame.origin.x + avatarSize - pillWidth + scaledBorderSize, y: verticalShift + avatarImageView.frame.origin.y + avatarSize - pillHeight, width: pillWidth, height: pillHeight)
let imageView = UIImageView(frame: frame)
pillImageView = imageView
pillImageView?.contentMode = .scaleAspectFit
@@ -181,7 +184,7 @@ class RoomInfoBasicView: UIView {
// append the pill to the room name
if image.size.width > 0.0 && image.size.height > 0.0 {
let aspectRatio = image.size.width / image.size.height
let pillHeight: CGFloat = 24.0
let pillHeight: CGFloat = 18.0
let offset = 0.5 * (font.capHeight - pillHeight)
let attachment = NSTextAttachment()