From 0a3713e078280f9606b130fbe004cb197970daef Mon Sep 17 00:00:00 2001 From: Flowinho Date: Thu, 12 Mar 2020 22:57:30 +0100 Subject: [PATCH] Align feedname and date correctly if there is no title or summary --- .../Cell/MasterTimelineDefaultCellLayout.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/iOS/MasterTimeline/Cell/MasterTimelineDefaultCellLayout.swift b/iOS/MasterTimeline/Cell/MasterTimelineDefaultCellLayout.swift index 793f6923f..b80666016 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineDefaultCellLayout.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineDefaultCellLayout.swift @@ -89,7 +89,14 @@ struct MasterTimelineDefaultCellLayout: MasterTimelineCellLayout { } self.summaryRect = MasterTimelineDefaultCellLayout.rectForSummary(cellData, currentPoint, textAreaWidth, numberOfLinesForTitle) - currentPoint.y = [self.titleRect, self.summaryRect].maxY() + var y = [self.titleRect, self.summaryRect].maxY() + if y == 0 { + y = iconImageRect.origin.y + iconImageRect.height + // Necessary calculation of either feed name or date since we are working with dynamic font-sizes + let tmp = MasterTimelineDefaultCellLayout.rectForDate(cellData, currentPoint, textAreaWidth) + y -= tmp.height + } + currentPoint.y = y // Feed Name and Pub Date self.dateRect = MasterTimelineDefaultCellLayout.rectForDate(cellData, currentPoint, textAreaWidth)