Skip to content

Commit f116b7c

Browse files
committed
Swapping leading/top for trailing/bottom when calculating decoration size from insets
1 parent 61da20c commit f116b7c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

IBPCollectionViewCompositionalLayout/IBPUICollectionViewCompositionalLayout.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,11 @@ - (void)prepareLayout {
294294
decorationViewFrame.origin = sectionOrigin;
295295

296296
if (self.scrollDirection == UICollectionViewScrollDirectionVertical) {
297-
decorationViewFrame.size.width += CGRectGetWidth(contentFrame) + layoutSection.contentInsets.leading;
298-
decorationViewFrame.size.height = CGRectGetMaxY(contentFrame) - sectionOrigin.y + layoutSection.contentInsets.top;
297+
decorationViewFrame.size.width += CGRectGetWidth(contentFrame);
298+
decorationViewFrame.size.height = CGRectGetMaxY(contentFrame) - sectionOrigin.y + layoutSection.contentInsets.bottom;
299299
}
300300
if (self.scrollDirection == UICollectionViewScrollDirectionHorizontal) {
301-
decorationViewFrame.size.width = CGRectGetMaxX(contentFrame) - sectionOrigin.x;
301+
decorationViewFrame.size.width = CGRectGetMaxX(contentFrame) - sectionOrigin.x + layoutSection.contentInsets.trailing;
302302
decorationViewFrame.size.height += CGRectGetHeight(contentFrame);
303303
}
304304

0 commit comments

Comments
 (0)