[ASScrollDirection] Fix scroll direction interpretation after recent changes to this logic.

This commit is contained in:
Scott Goodson
2016-03-07 22:50:48 -08:00
parent 39f5686982
commit 9c0d0542dd
2 changed files with 6 additions and 6 deletions

View File

@@ -598,16 +598,16 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
ASScrollDirection scrollableDirections = [self scrollableDirections];
if (ASScrollDirectionContainsHorizontalDirection(scrollableDirections)) { // Can scroll horizontally.
if (scrollVelocity.x > 0) {
if (scrollVelocity.x < 0.0) {
direction |= ASScrollDirectionRight;
} else if (scrollVelocity.x < 0) {
} else if (scrollVelocity.x > 0.0) {
direction |= ASScrollDirectionLeft;
}
}
if (ASScrollDirectionContainsVerticalDirection(scrollableDirections)) { // Can scroll vertically.
if (scrollVelocity.y > 0) {
if (scrollVelocity.y < 0.0) {
direction |= ASScrollDirectionDown;
} else if (scrollVelocity.y < 0) {
} else if (scrollVelocity.y > 0.0) {
direction |= ASScrollDirectionUp;
}
}

View File

@@ -592,9 +592,9 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
- (ASScrollDirection)_scrollDirectionForVelocity:(CGPoint)velocity
{
ASScrollDirection direction = ASScrollDirectionNone;
if (velocity.y > 0) {
if (velocity.y < 0.0) {
direction = ASScrollDirectionDown;
} else if (velocity.y < 0) {
} else if (velocity.y > 0.0) {
direction = ASScrollDirectionUp;
}
return direction;