Skip to content

Commit 910f55e

Browse files
committed
Addresses #8 and allows setting the current page even before the scroll view is properly set up. Although not entirely right, it will do the trick for now.
1 parent f592800 commit 910f55e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

SCPageViewController/SCPageViewController.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -797,11 +797,9 @@ - (CGPoint)_nextStepOffsetForFrame:(CGRect)finalFrame withVelocity:(CGPoint)velo
797797
} else if(velocity.x > 0.0f) {
798798
nextStepOffset.x = (NSInteger)CGRectGetMaxX(finalFrame);
799799
} else if(velocity.y < 0.0f) {
800-
CGFloat maxOffset = MAX(self.scrollView.contentSize.height, CGRectGetHeight(self.scrollView.bounds)) - CGRectGetHeight(self.scrollView.bounds) + self.layouterContentInset.top + self.layouterContentInset.bottom;
801-
nextStepOffset.y = MIN(maxOffset, (NSInteger)CGRectGetMinY(finalFrame));
800+
nextStepOffset.y = (NSInteger)CGRectGetMinY(finalFrame);
802801
} else if(velocity.x < 0.0f) {
803-
CGFloat maxOffset = MAX(self.scrollView.contentSize.width, CGRectGetWidth(self.scrollView.bounds)) - CGRectGetWidth(self.scrollView.bounds) + self.layouterContentInset.left + self.layouterContentInset.right;
804-
nextStepOffset.x = MIN(maxOffset, (NSInteger)CGRectGetMinX(finalFrame));
802+
nextStepOffset.x = (NSInteger)CGRectGetMinX(finalFrame);
805803
}
806804

807805
return nextStepOffset;

0 commit comments

Comments
 (0)