mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Fix PagerNode from not loading
This commit is contained in:
@@ -34,6 +34,9 @@
|
||||
|
||||
- (CGPoint)_targetContentOffsetForItemAtIndexPath:(NSIndexPath *)indexPath proposedContentOffset:(CGPoint)proposedContentOffset
|
||||
{
|
||||
if ([self _dataSourceIsEmpty]) {
|
||||
return proposedContentOffset;
|
||||
}
|
||||
UICollectionViewLayoutAttributes *attributes = [self layoutAttributesForItemAtIndexPath:indexPath];
|
||||
CGFloat xOffset = (self.collectionView.bounds.size.width - attributes.frame.size.width) / 2;
|
||||
return CGPointMake(attributes.frame.origin.x - xOffset, proposedContentOffset.y);
|
||||
@@ -41,10 +44,6 @@
|
||||
|
||||
- (NSIndexPath *)_indexPathForVisiblyCenteredItem
|
||||
{
|
||||
if ([self _dataSourceIsEmpty]) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
CGRect visibleRect = [self _visibleRect];
|
||||
CGFloat visibleXCenter = CGRectGetMidX(visibleRect);
|
||||
NSArray<UICollectionViewLayoutAttributes *> *layoutAttributes = [self layoutAttributesForElementsInRect:visibleRect];
|
||||
|
||||
Reference in New Issue
Block a user