Skip to content

Commit

Permalink
Correct attributes lookup for supplementary elements. (TextureGroup#1318
Browse files Browse the repository at this point in the history
)
  • Loading branch information
wiseoldduck authored and Adlai-Holler committed Mar 8, 2019
1 parent dffe22f commit 510000e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/ASCollectionView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,13 @@ - (BOOL)dataController:(ASDataController *)dataController presentedSizeForElemen
ASDisplayNodeFailAssert(@"Data controller should not ask for presented size for element that is not presented.");
return YES;
}
UICollectionViewLayoutAttributes *attributes = [self layoutAttributesForItemAtIndexPath:indexPath];

UICollectionViewLayoutAttributes *attributes;
if (element.supplementaryElementKind == nil) {
attributes = [self layoutAttributesForItemAtIndexPath:indexPath];
} else {
attributes = [self layoutAttributesForSupplementaryElementOfKind:element.supplementaryElementKind atIndexPath:indexPath];
}
return CGSizeEqualToSizeWithIn(attributes.size, size, FLT_EPSILON);
}

Expand Down

0 comments on commit 510000e

Please sign in to comment.