Merge pull request #2069 from JachiOnuoha/JachiOnuoha-ArrowKeysBug

Fixed Arrow keys by pass panVertical/panHorizontal bug
This commit is contained in:
Ian Gilman 2021-12-17 14:49:12 -08:00 committed by GitHub
commit d9494c6d7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -2666,8 +2666,8 @@ function onCanvasKeyDown( event ) {
var canvasKeyDownEventArgs = { var canvasKeyDownEventArgs = {
originalEvent: event.originalEvent, originalEvent: event.originalEvent,
preventDefaultAction: false, preventDefaultAction: false,
preventVerticalPan: event.preventVerticalPan, preventVerticalPan: event.preventVerticalPan || !this.panVertical,
preventHorizontalPan: event.preventHorizontalPan preventHorizontalPan: event.preventHorizontalPan || !this.panHorizontal
}; };
/** /**
@ -2737,8 +2737,8 @@ function onCanvasKeyPress( event ) {
var canvasKeyPressEventArgs = { var canvasKeyPressEventArgs = {
originalEvent: event.originalEvent, originalEvent: event.originalEvent,
preventDefaultAction: false, preventDefaultAction: false,
preventVerticalPan: event.preventVerticalPan, preventVerticalPan: event.preventVerticalPan || !this.panVertical,
preventHorizontalPan: event.preventHorizontalPan preventHorizontalPan: event.preventHorizontalPan || !this.panHorizontal
}; };
// This event is documented in onCanvasKeyDown // This event is documented in onCanvasKeyDown
@ -2788,8 +2788,8 @@ function onCanvasKeyPress( event ) {
break; break;
case 97://a case 97://a
if (!canvasKeyPressEventArgs.preventHorizontalPan) { if (!canvasKeyPressEventArgs.preventHorizontalPan) {
this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(-40, 0))); this.viewport.panBy(this.viewport.deltaPointsFromPixels(new $.Point(-40, 0)));
this.viewport.applyConstraints(); this.viewport.applyConstraints();
} }
event.preventDefault = true; event.preventDefault = true;
break; break;

View File

@ -27,7 +27,6 @@
tileSources: "../data/testpattern.dzi", tileSources: "../data/testpattern.dzi",
showNavigator:true showNavigator:true
}); });
</script> </script>
</body> </body>
</html> </html>