From 7682825469e55a5415bc00dfbaacb5b62b4535fe Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 28 Oct 2019 01:44:09 -0400 Subject: [PATCH] Align feed icon with first line of label Image was aligned with top padding, takes into consideration the image and font size (line height). --- iOS/MasterFeed/Cell/MasterFeedTableViewCellLayout.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iOS/MasterFeed/Cell/MasterFeedTableViewCellLayout.swift b/iOS/MasterFeed/Cell/MasterFeedTableViewCellLayout.swift index b60177efb..4066772dd 100644 --- a/iOS/MasterFeed/Cell/MasterFeedTableViewCellLayout.swift +++ b/iOS/MasterFeed/Cell/MasterFeedTableViewCellLayout.swift @@ -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) }