File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ const TouchEventManager = {
256256 const isStylusModeDisabled = ! docViewer . isStylusModeEnabled ( ) ;
257257 const isUsingAnnotationToolsAndStylusIsDisabled = this . isUsingAnnotationTools ( ) && isStylusModeDisabled ;
258258 const isUsingPenAndStylusEnabled = this . isUsingPen ( ) && ! isStylusModeDisabled ;
259+ const { container, document : doc } = this ;
259260
260261 if (
261262 ! this . allowSwipe ||
@@ -283,8 +284,9 @@ const TouchEventManager = {
283284 const isFirstPage = currentPage === 1 ;
284285 const isLastPage = currentPage === totalPages ;
285286 const isSingleDisplayMode = ! core . isContinuousDisplayMode ( ) ;
286- const shouldGoToPrevPage = isSingleDisplayMode && ! isFirstPage && ( ( swipedToLeft && this . allowHorizontalSwipe ) || ( swipedToTop && this . allowVerticalSwipe ) ) ;
287- const shouldGoToNextPage = isSingleDisplayMode && ! isLastPage && ( ( swipedToRight && this . allowHorizontalSwipe ) || ( swipedToBottom && this . allowVerticalSwipe ) ) ;
287+ const doesPagesFitOnScreen = doc . clientWidth < container . clientWidth || doc . clientHeight < container . clientHeight ;
288+ const shouldGoToPrevPage = isSingleDisplayMode && ! isFirstPage && ( ( swipedToLeft && this . allowHorizontalSwipe ) || ( swipedToTop && this . allowVerticalSwipe ) ) && doesPagesFitOnScreen ;
289+ const shouldGoToNextPage = isSingleDisplayMode && ! isLastPage && ( ( swipedToRight && this . allowHorizontalSwipe ) || ( swipedToBottom && this . allowVerticalSwipe ) ) && doesPagesFitOnScreen ;
288290
289291 if ( shouldGoToPrevPage ) {
290292 core . setCurrentPage ( Math . max ( 1 , currentPage - numberOfPagesToNavigate ) ) ;
You can’t perform that action at this time.
0 commit comments