From 0f1de455e20903cfd5e1cf0e2fd814d3d76c97d8 Mon Sep 17 00:00:00 2001 From: Jachimike Onuoha Date: Mon, 29 Nov 2021 16:40:26 -0500 Subject: [PATCH 1/4] Recreated panHorizontal & panVertical bug --- test/demo/basic.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/demo/basic.html b/test/demo/basic.html index e238e5e1..44bf70a4 100644 --- a/test/demo/basic.html +++ b/test/demo/basic.html @@ -25,9 +25,9 @@ id: "contentDiv", prefixUrl: "../../build/openseadragon/images/", tileSources: "../data/testpattern.dzi", - showNavigator:true + showNavigator:true, + panHorizontal: false }); - From 2edf48e8806dfd9fcf8552ae8b26c672f25e5ef1 Mon Sep 17 00:00:00 2001 From: Jachimike Onuoha Date: Tue, 30 Nov 2021 17:43:11 -0500 Subject: [PATCH 2/4] Temporary fix for arrow key panVertical bug --- src/viewer.js | 4 ++-- test/demo/basic.html | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/viewer.js b/src/viewer.js index a879a0bd..cf28f7b7 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -2657,8 +2657,8 @@ function onCanvasKeyDown( event ) { var canvasKeyDownEventArgs = { originalEvent: event.originalEvent, preventDefaultAction: false, - preventVerticalPan: event.preventVerticalPan, - preventHorizontalPan: event.preventHorizontalPan + preventVerticalPan: !this.panVertical, + preventHorizontalPan: !this.panHorizontal }; /** diff --git a/test/demo/basic.html b/test/demo/basic.html index 44bf70a4..af1bfb0d 100644 --- a/test/demo/basic.html +++ b/test/demo/basic.html @@ -21,12 +21,13 @@ From 1fde7057850ec66f69d472bf68a860aa6ab13b35 Mon Sep 17 00:00:00 2001 From: Jachimike Onuoha Date: Thu, 2 Dec 2021 14:45:55 -0500 Subject: [PATCH 3/4] Fixed Arrowkey panning bug --- src/viewer.js | 8 ++++---- test/demo/basic.html | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/viewer.js b/src/viewer.js index cf28f7b7..e3bc1eec 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -2728,8 +2728,8 @@ function onCanvasKeyPress( event ) { var canvasKeyPressEventArgs = { originalEvent: event.originalEvent, preventDefaultAction: false, - preventVerticalPan: event.preventVerticalPan, - preventHorizontalPan: event.preventHorizontalPan + preventVerticalPan: !this.panVertical, + preventHorizontalPan: !this.panHorizontal }; // This event is documented in onCanvasKeyDown @@ -2779,8 +2779,8 @@ function onCanvasKeyPress( event ) { break; case 97://a if (!canvasKeyPressEventArgs.preventHorizontalPan) { - this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(-40, 0))); - this.viewport.applyConstraints(); + this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(-40, 0))); + this.viewport.applyConstraints(); } event.preventDefault = true; break; diff --git a/test/demo/basic.html b/test/demo/basic.html index af1bfb0d..f18a40e9 100644 --- a/test/demo/basic.html +++ b/test/demo/basic.html @@ -25,9 +25,7 @@ id: "contentDiv", prefixUrl: "../../build/openseadragon/images/", tileSources: "../data/testpattern.dzi", - showNavigator:true, - panVertical: false, - panHorizontal: true + showNavigator:true }); From 0a06c5b6a40abf04c7e207eae78ce345071ad5cb Mon Sep 17 00:00:00 2001 From: Jachimike Onuoha Date: Mon, 6 Dec 2021 23:33:58 -0500 Subject: [PATCH 4/4] 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 @@