mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 19:30:29 +00:00
Caching scrollable directions is not safe (#2474)
This commit is contained in:
parent
f7b30577b8
commit
86a5aece9c
@ -30,7 +30,6 @@ typedef struct ASRangeGeometry ASRangeGeometry;
|
|||||||
@package
|
@package
|
||||||
ASCollectionView * __weak _collectionView;
|
ASCollectionView * __weak _collectionView;
|
||||||
UICollectionViewLayout * __strong _collectionViewLayout;
|
UICollectionViewLayout * __strong _collectionViewLayout;
|
||||||
ASScrollDirection _scrollableDirections;
|
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@ -42,7 +41,6 @@ typedef struct ASRangeGeometry ASRangeGeometry;
|
|||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
_scrollableDirections = [collectionView scrollableDirections];
|
|
||||||
_collectionView = collectionView;
|
_collectionView = collectionView;
|
||||||
_collectionViewLayout = [collectionView collectionViewLayout];
|
_collectionViewLayout = [collectionView collectionViewLayout];
|
||||||
return self;
|
return self;
|
||||||
@ -74,12 +72,7 @@ typedef struct ASRangeGeometry ASRangeGeometry;
|
|||||||
{
|
{
|
||||||
CGRect rect = _collectionView.bounds;
|
CGRect rect = _collectionView.bounds;
|
||||||
|
|
||||||
// Scrollable directions can change for non-flow layouts
|
return CGRectExpandToRangeWithScrollableDirections(rect, tuningParameters, [_collectionView scrollableDirections], scrollDirection);
|
||||||
if ([_collectionViewLayout asdk_isFlowLayout] == NO) {
|
|
||||||
_scrollableDirections = [_collectionView scrollableDirections];
|
|
||||||
}
|
|
||||||
|
|
||||||
return CGRectExpandToRangeWithScrollableDirections(rect, tuningParameters, _scrollableDirections, scrollDirection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user