Skip to content

Commit

Permalink
fix scroll direction error when scroll from pdf end
Browse files Browse the repository at this point in the history
  • Loading branch information
Wonday committed Jul 21, 2017
1 parent 4f6771a commit 6b2dba9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ios/RCTPdf/WPdfView.m
Original file line number Diff line number Diff line change
Expand Up @@ -442,12 +442,12 @@ - (void)handlePan:(UIPanGestureRecognizer *)recognizer
if (_page==1 && velocity.x>0) break;
if (_page==_numberOfPages && velocity.x<0) break;

if (_page<3 && velocity.x>0) {
if (_page<=3 && velocity.x>0) {
velocity.x = pageWidth;
}

if (_numberOfPages-_page<3 && velocity.x<0) {
velocity.x = pageWidth;
if (_numberOfPages-_page<=3 && velocity.x<0) {
velocity.x = -pageWidth;
}

} else {
Expand All @@ -459,12 +459,12 @@ - (void)handlePan:(UIPanGestureRecognizer *)recognizer
if (_page==1 && velocity.y>0) break;
if (_page==_numberOfPages && velocity.y<0) break;

if (_page<3 && velocity.y>0){
if (_page<=3 && velocity.y>0){
velocity.y = pageHeight;
}

if (_numberOfPages-_page<3 && velocity.y<0) {
velocity.y = pageHeight;
if (_numberOfPages-_page<=3 && velocity.y<0) {
velocity.y = -pageHeight;
}

}
Expand Down

0 comments on commit 6b2dba9

Please sign in to comment.