mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-19 21:00:10 +00:00
Merge pull request #1294 from vivqu/batch_fetch
[ASCollectionView] Account for contentInset when calculating ASScrollDirection
This commit is contained in:
commit
e9fcfefbdd
@ -622,10 +622,10 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
- (ASScrollDirection)nonFlowLayoutScrollableDirections
|
- (ASScrollDirection)nonFlowLayoutScrollableDirections
|
||||||
{
|
{
|
||||||
ASScrollDirection scrollableDirection = ASScrollDirectionNone;
|
ASScrollDirection scrollableDirection = ASScrollDirectionNone;
|
||||||
if (self.contentSize.width > self.bounds.size.width) { // Can scroll horizontally.
|
if (self.contentSize.width + self.contentInset.left + self.contentInset.right > self.bounds.size.width) { // Can scroll horizontally.
|
||||||
scrollableDirection |= ASScrollDirectionHorizontalDirections;
|
scrollableDirection |= ASScrollDirectionHorizontalDirections;
|
||||||
}
|
}
|
||||||
if (self.contentSize.height > self.bounds.size.height) { // Can scroll vertically.
|
if (self.contentSize.height + self.contentInset.top + self.contentInset.bottom > self.bounds.size.height) { // Can scroll vertically.
|
||||||
scrollableDirection |= ASScrollDirectionVerticalDirections;
|
scrollableDirection |= ASScrollDirectionVerticalDirections;
|
||||||
}
|
}
|
||||||
return scrollableDirection;
|
return scrollableDirection;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user