From ba33824576704b02c34116b1d3b906732bfe7c22 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 13 Feb 2024 16:45:17 -0600 Subject: [PATCH] fixed bug for ButtonGroupPositionLayout - take the min between collectionViewWidth and button width Signed-off-by: Matt Bruce --- .../Buttons/ButtonGroup/ButtonGroupPositionLayout.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroupPositionLayout.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroupPositionLayout.swift index c1a315eb..040ac1b3 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroupPositionLayout.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroupPositionLayout.swift @@ -229,7 +229,7 @@ class ButtonGroupPositionLayout: UICollectionViewLayout { // create the custom layout attribute let attributes = ButtonLayoutAttributes(spacing: itemSpacing, button: itemButtonBase, forCellWith: indexPath) - attributes.frame = CGRect(x: 0, y: 0, width: itemSize.width, height: itemSize.height) + attributes.frame = CGRect(x: 0, y: 0, width: min(itemSize.width, collectionViewWidth), height: itemSize.height) // add it to the array rows.last?.add(attribute: attributes)