mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-10 06:27:15 +00:00
Account for alwaysBounce(Vertical|Horizontal) when calculating scrollable directions
This commit is contained in:
parent
30463db034
commit
85394f09b4
@ -637,10 +637,13 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
- (ASScrollDirection)nonFlowLayoutScrollableDirections
|
- (ASScrollDirection)nonFlowLayoutScrollableDirections
|
||||||
{
|
{
|
||||||
ASScrollDirection scrollableDirection = ASScrollDirectionNone;
|
ASScrollDirection scrollableDirection = ASScrollDirectionNone;
|
||||||
if (self.contentSize.width + self.contentInset.left + self.contentInset.right > self.bounds.size.width) { // Can scroll horizontally.
|
CGFloat totalContentWidth = self.contentSize.width + self.contentInset.left + self.contentInset.right;
|
||||||
|
CGFloat totalContentHeight = self.contentSize.height + self.contentInset.top + self.contentInset.bottom;
|
||||||
|
|
||||||
|
if (self.alwaysBounceHorizontal || totalContentWidth > self.bounds.size.width) { // Can scroll horizontally.
|
||||||
scrollableDirection |= ASScrollDirectionHorizontalDirections;
|
scrollableDirection |= ASScrollDirectionHorizontalDirections;
|
||||||
}
|
}
|
||||||
if (self.contentSize.height + self.contentInset.top + self.contentInset.bottom > self.bounds.size.height) { // Can scroll vertically.
|
if (self.alwaysBounceVertical || totalContentHeight > self.bounds.size.height) { // Can scroll vertically.
|
||||||
scrollableDirection |= ASScrollDirectionVerticalDirections;
|
scrollableDirection |= ASScrollDirectionVerticalDirections;
|
||||||
}
|
}
|
||||||
return scrollableDirection;
|
return scrollableDirection;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user