Ensure that we use the correct default size for collection nodes even if layoutSubviews has not been called yet. This is a more conservative approach than the previous one.

This commit is contained in:
Ethan Nagel
2016-03-09 09:56:32 -08:00
parent 5a3dab5610
commit 352247184a

View File

@@ -780,12 +780,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
if (_asyncDataSourceImplementsConstrainedSizeForNode) {
constrainedSize = [_asyncDataSource collectionView:self constrainedSizeForNodeAtIndexPath:indexPath];
} else {
if (! CGSizeEqualToSize(_maxSizeForNodesConstrainedSize, self.bounds.size)) {
_maxSizeForNodesConstrainedSize = self.bounds.size;
_ignoreMaxSizeChange = CGSizeEqualToSize(_maxSizeForNodesConstrainedSize, CGSizeZero);
}
CGSize maxSize = _maxSizeForNodesConstrainedSize;
CGSize maxSize = CGSizeEqualToSize(_maxSizeForNodesConstrainedSize, CGSizeZero) ? self.bounds.size : _maxSizeForNodesConstrainedSize;
if (ASScrollDirectionContainsHorizontalDirection([self scrollableDirections])) {
maxSize.width = FLT_MAX;
} else {