mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
[ASTableView/ASCollectionView] Ignore bounds.origin when checking for zero-size
This commit is contained in:
@@ -1039,7 +1039,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
||||
ASDisplayNodeAssertMainThread();
|
||||
// Calling -indexPathsForVisibleItems will trigger UIKit to call reloadData if it never has, which can result
|
||||
// in incorrect layout if performed at zero size. We can use the fact that nothing can be visible at zero size to return fast.
|
||||
BOOL isZeroSized = CGRectEqualToRect(self.bounds, CGRectZero);
|
||||
BOOL isZeroSized = CGSizeEqualToSize(self.bounds.size, CGSizeZero);
|
||||
return isZeroSized ? @[] : [self indexPathsForVisibleItems];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user