From b58bb9b81a8e7400d86532eb0ac5a495c22d3557 Mon Sep 17 00:00:00 2001 From: Chris Brind Date: Mon, 2 Dec 2024 16:09:01 +0000 Subject: [PATCH] revert --- DuckDuckGo/FavoritesHomeViewSectionRenderer.swift | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/DuckDuckGo/FavoritesHomeViewSectionRenderer.swift b/DuckDuckGo/FavoritesHomeViewSectionRenderer.swift index 673e6c4c37..0d1646f259 100644 --- a/DuckDuckGo/FavoritesHomeViewSectionRenderer.swift +++ b/DuckDuckGo/FavoritesHomeViewSectionRenderer.swift @@ -89,12 +89,20 @@ class FavoritesHomeViewSectionRenderer { } func sectionMargin(in collectionView: UICollectionView) -> CGFloat { - if isPad { + if controller is FavoritesOverlay { return Constants.largeModeMargin + } + + let margin: CGFloat + if isPad { + margin = (collectionView.frame.width - Constants.searchWidthPad) / 2 } else { let defaultMargin = FavoritesHomeViewSectionRenderer.Constants.sideInsets - return (collectionView.frame.width - Constants.searchWidth + defaultMargin) / 2 + let landscapeMargin = (collectionView.frame.width - Constants.searchWidth + defaultMargin) / 2 + margin = isPortrait ? defaultMargin : landscapeMargin } + + return margin } // Visible margin is adjusted for offset inside Favorite Cells @@ -180,7 +188,7 @@ class FavoritesHomeViewSectionRenderer { referenceSizeForHeaderInSection section: Int) -> CGSize? { return CGSize(width: 1, height: headerHeight) } - + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize? {