From c8b344285477ca30a1fa5131b9853d623733ec9c Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 28 Apr 2019 16:51:34 -0500 Subject: [PATCH] Change favicon placement so that it no longer centers on multiline rows --- iOS/MasterFeed/Cell/MasterFeedTableViewCellLayout.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iOS/MasterFeed/Cell/MasterFeedTableViewCellLayout.swift b/iOS/MasterFeed/Cell/MasterFeedTableViewCellLayout.swift index b44f4a68c..da26296dd 100644 --- a/iOS/MasterFeed/Cell/MasterFeedTableViewCellLayout.swift +++ b/iOS/MasterFeed/Cell/MasterFeedTableViewCellLayout.swift @@ -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) }