Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions Source/Private/ASCollectionLayout.mm
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,12 @@ + (void)_measureElementsInRect:(CGRect)rect blockingRect:(CGRect)blockingRect la
if (NSUInteger count = blockingAttrs.count) {
ASDispatchApply(count, queue, 0, ^(size_t i) {
UICollectionViewLayoutAttributes *attrs = blockingAttrs[i];
ASCellNode *node = [elements elementForItemAtIndexPath:attrs.indexPath].node;
ASCellNode *node;
if (attrs.representedElementKind == nil) {
node = [elements elementForItemAtIndexPath:attrs.indexPath].node;
} else {
node = [elements supplementaryElementOfKind:attrs.representedElementKind atIndexPath:attrs.indexPath].node;
}
CGSize expectedSize = attrs.frame.size;
if (! CGSizeEqualToSize(expectedSize, node.calculatedSize)) {
[node layoutThatFits:ASCollectionLayoutElementSizeRangeFromSize(expectedSize)];
Expand All @@ -353,7 +358,12 @@ + (void)_measureElementsInRect:(CGRect)rect blockingRect:(CGRect)blockingRect la
__strong ASElementMap *strongElements = weakElements;
if (strongElements) {
UICollectionViewLayoutAttributes *attrs = nonBlockingAttrs[i];
ASCellNode *node = [elements elementForItemAtIndexPath:attrs.indexPath].node;
ASCellNode *node;
if (attrs.representedElementKind == nil) {
node = [elements elementForItemAtIndexPath:attrs.indexPath].node;
} else {
node = [elements supplementaryElementOfKind:attrs.representedElementKind atIndexPath:attrs.indexPath].node;
}
CGSize expectedSize = attrs.frame.size;
if (! CGSizeEqualToSize(expectedSize, node.calculatedSize)) {
[node layoutThatFits:ASCollectionLayoutElementSizeRangeFromSize(expectedSize)];
Expand Down