From 1727af6a0bb2f79d5698875e43c09b9e26840228 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Thu, 2 Jan 2025 22:50:12 +0400 Subject: [PATCH] Various fixes --- .../Sources/PeerInfoGiftsPaneNode.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/PeerInfoGiftsPaneNode.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/PeerInfoGiftsPaneNode.swift index f4f3290cd6..735ab2686a 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/PeerInfoGiftsPaneNode.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/PeerInfoGiftsPaneNode.swift @@ -130,10 +130,12 @@ public final class PeerInfoGiftsPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScr let optionSpacing: CGFloat = 10.0 let sideInset = params.sideInset + 16.0 - let itemsInRow = max(1, min(starsProducts.count, 3)) + let defaultItemsInRow = 3 + let itemsInRow = max(1, min(starsProducts.count, defaultItemsInRow)) + let defaultOptionWidth = (params.size.width - sideInset * 2.0 - optionSpacing * CGFloat(defaultItemsInRow - 1)) / CGFloat(defaultItemsInRow) let optionWidth = (params.size.width - sideInset * 2.0 - optionSpacing * CGFloat(itemsInRow - 1)) / CGFloat(itemsInRow) - let starsOptionSize = CGSize(width: optionWidth, height: optionWidth) + let starsOptionSize = CGSize(width: optionWidth, height: defaultOptionWidth) let visibleBounds = self.scrollNode.bounds.insetBy(dx: 0.0, dy: -10.0)