Skip to content

Commit 66fdd58

Browse files
committed
Fixes #12
1 parent 87c1e1b commit 66fdd58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SCPageViewController/SCPageViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ - (NSUInteger)_calculateCurrentPage
778778
NSUInteger pageIndex = [pages indexOfObject:sortedPages[i]];
779779

780780
CGRect frame = [self.layouter finalFrameForPageAtIndex:pageIndex pageViewController:self];
781-
CGPoint centerOffset = [self.view convertPoint:self.view.center toView:self.scrollView];
781+
CGPoint centerOffset = [self.view convertPoint:CGPointMake(CGRectGetMidX(self.view.bounds), CGRectGetMidY(self.view.bounds)) toView:self.scrollView];
782782

783783
if(CGRectContainsPoint(frame, centerOffset)) {
784784
return pageIndex;

0 commit comments

Comments
 (0)