Merge pull request #1301 from lkzhao/collectionView-sectionInset-fix

Remove cell constrainedSize adjustment with section insets in constrainedSizeForNode
This commit is contained in:
appleguy
2016-03-04 14:26:55 -08:00

View File

@@ -800,16 +800,6 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
if (_asyncDelegateImplementsInsetSection) {
sectionInset = [(id<ASCollectionViewDelegateFlowLayout>)_asyncDelegate collectionView:self layout:self.collectionViewLayout insetForSectionAtIndex:indexPath.section];
}
constrainedSize.min.height = MAX(0, constrainedSize.min.height - sectionInset.top - sectionInset.bottom);
constrainedSize.min.width = MAX(0, constrainedSize.min.width - sectionInset.left - sectionInset.right);
//ignore insets for FLT_MAX so FLT_MAX can be compared against
if (constrainedSize.max.width - FLT_EPSILON < FLT_MAX) {
constrainedSize.max.width = MAX(0, constrainedSize.max.width - sectionInset.left - sectionInset.right);
}
if (constrainedSize.max.height - FLT_EPSILON < FLT_MAX) {
constrainedSize.max.height = MAX(0, constrainedSize.max.height - sectionInset.top - sectionInset.bottom);
}
return constrainedSize;
}