mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Improve measurement code for cell nodes (#3119)
This commit is contained in:
committed by
GitHub
parent
93809bd4e7
commit
62d7e14ce1
@@ -32,6 +32,7 @@
|
||||
#import <AsyncDisplayKit/ASSectionContext.h>
|
||||
#import <AsyncDisplayKit/ASCollectionView+Undeprecated.h>
|
||||
#import <AsyncDisplayKit/_ASHierarchyChangeSet.h>
|
||||
#import <AsyncDisplayKit/CoreGraphics+ASConvenience.h>
|
||||
|
||||
/**
|
||||
* A macro to get self.collectionNode and assign it to a local variable, or return
|
||||
@@ -1563,6 +1564,15 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier";
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)dataController:(ASDataController *)dataController presentedSizeForElement:(ASCollectionElement *)element matchesSize:(CGSize)size
|
||||
{
|
||||
NSIndexPath *indexPath = [self indexPathForNode:element.node];
|
||||
UICollectionViewLayoutAttributes *attributes = [self layoutAttributesForItemAtIndexPath:indexPath];
|
||||
CGRect rect = attributes.frame;
|
||||
return CGSizeEqualToSizeWithIn(rect.size, size, FLT_EPSILON);
|
||||
|
||||
}
|
||||
|
||||
- (id<ASTraitEnvironment>)dataControllerEnvironment
|
||||
{
|
||||
return self.collectionNode;
|
||||
|
||||
Reference in New Issue
Block a user