From 6b2dba9b0c0e37782905a9e1f267b0d440f89525 Mon Sep 17 00:00:00 2001 From: Wonday Date: Fri, 21 Jul 2017 14:04:15 +0800 Subject: [PATCH] fix scroll direction error when scroll from pdf end --- ios/RCTPdf/WPdfView.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/RCTPdf/WPdfView.m b/ios/RCTPdf/WPdfView.m index ae0e889c..75aa269b 100644 --- a/ios/RCTPdf/WPdfView.m +++ b/ios/RCTPdf/WPdfView.m @@ -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 { @@ -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; } }