From 0a06c5b6a40abf04c7e207eae78ce345071ad5cb Mon Sep 17 00:00:00 2001 From: Jachimike Onuoha Date: Mon, 6 Dec 2021 23:33:58 -0500 Subject: [PATCH] Updated boolean logic for preventVerticalPan and preventHorizontalPan --- src/viewer.js | 8 ++++---- test/demo/basic.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/viewer.js b/src/viewer.js index e3bc1eec..046f3d23 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -2657,8 +2657,8 @@ function onCanvasKeyDown( event ) { var canvasKeyDownEventArgs = { originalEvent: event.originalEvent, preventDefaultAction: false, - preventVerticalPan: !this.panVertical, - preventHorizontalPan: !this.panHorizontal + preventVerticalPan: event.preventVerticalPan || !this.panVertical, + preventHorizontalPan: event.preventHorizontalPan || !this.panHorizontal }; /** @@ -2728,8 +2728,8 @@ function onCanvasKeyPress( event ) { var canvasKeyPressEventArgs = { originalEvent: event.originalEvent, preventDefaultAction: false, - preventVerticalPan: !this.panVertical, - preventHorizontalPan: !this.panHorizontal + preventVerticalPan: event.preventVerticalPan || !this.panVertical, + preventHorizontalPan: event.preventHorizontalPan || !this.panHorizontal }; // This event is documented in onCanvasKeyDown diff --git a/test/demo/basic.html b/test/demo/basic.html index f18a40e9..4fe267bd 100644 --- a/test/demo/basic.html +++ b/test/demo/basic.html @@ -21,7 +21,7 @@