Align feed icon with first line of label

Image was aligned with top padding, takes into consideration the image and font size (line height).
This commit is contained in:
Jonathan Bennett 2019-10-28 01:44:09 -04:00
parent 47ca7a8a30
commit 7682825469
1 changed files with 3 additions and 1 deletions

View File

@ -54,7 +54,9 @@ struct MasterFeedTableViewCellLayout {
var rFavicon = CGRect.zero
if !shouldShowDisclosure {
let x = bounds.origin.x + ((MasterFeedTableViewCellLayout.disclosureButtonSize.width - MasterFeedTableViewCellLayout.imageSize.width) / 2)
let y = UIFontMetrics.default.scaledValue(for: MasterFeedTableViewCellLayout.verticalPadding)
let y = UIFontMetrics.default.scaledValue(for: MasterFeedTableViewCellLayout.verticalPadding) +
label.font.lineHeight / 2.0 -
MasterFeedTableViewCellLayout.imageSize.height / 2.0
rFavicon = CGRect(x: x, y: y, width: MasterFeedTableViewCellLayout.imageSize.width, height: MasterFeedTableViewCellLayout.imageSize.height)
}