Skip to content

Conversation

@andymedvedev
Copy link

Bugs raised when insetForSection is specified but boundingSize at estimatedSize(boundingSize:) is wrong so it leads to incorrect size estimation.


open func sizeForItem(at indexPath: IndexPath, boundingSize: CGSize) -> CGSize {
return items[indexPath.item].estimatedSize(boundingSize: boundingSize)
let sizeWithInsets = CGSize(width: boundingSize.width - insetForSection.left - insetForSection.right,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't totally agree with this change. For instance, we might not wanna use vertical insets for CollectionView with vertical scrolling. For some cases we need to know exact size of collection view and only use horizontal / vertical section insets for proportions calculation. I made change in 1.0.0 branch where we can respect section insets and spacings in cell size calculation. If u wanna match ur cell width to collectionView width and section insets u should consider use adjustsWidth(true) modifier of CollectionItem

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants