Change favicon placement so that it no longer centers on multiline rows

This commit is contained in:
Maurice Parker 2019-04-28 16:51:34 -05:00
parent 2724dbf4f2
commit c8b3442854
1 changed files with 3 additions and 2 deletions

View File

@ -45,7 +45,8 @@ struct MasterFeedTableViewCellLayout {
// Favicon
var rFavicon = CGRect.zero
if shouldShowImage {
rFavicon = CGRect(x: bounds.origin.x, y: 0.0, width: MasterFeedTableViewCellLayout.imageSize.width, height: MasterFeedTableViewCellLayout.imageSize.height)
let y = UIFontMetrics.default.scaledValue(for: CGFloat(integerLiteral: 4))
rFavicon = CGRect(x: bounds.origin.x, y: y, width: MasterFeedTableViewCellLayout.imageSize.width, height: MasterFeedTableViewCellLayout.imageSize.height)
}
// Separator Insets
@ -89,7 +90,7 @@ struct MasterFeedTableViewCellLayout {
// Center in Cell
let newBounds = CGRect(x: bounds.origin.x, y: bounds.origin.y, width: bounds.width, height: cellHeight)
if shouldShowImage {
if shouldShowImage && labelSizeInfo.numberOfLinesUsed == 1 {
rFavicon = MasterFeedTableViewCellLayout.centerVertically(rFavicon, newBounds)
}