From e6b9c79bc1357bdf05ea95693fb25388764acf28 Mon Sep 17 00:00:00 2001 From: Robert Colley Date: Thu, 6 Apr 2023 18:10:38 -0400 Subject: [PATCH] Fixes #2332 Mirror the main viewer's rotation and account for immediately. Without this, viewer.setRotation(90, true) would rotate the main viewer without animation and the navigator with animation. --- src/navigator.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/navigator.js b/src/navigator.js index c7c8419b..8d1aac2a 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -224,19 +224,19 @@ $.Navigator = function( options ){ this.displayRegionContainer.appendChild(this.displayRegion); this.element.getElementsByTagName('div')[0].appendChild(this.displayRegionContainer); - function rotate(degrees) { + function rotate(degrees, immediately) { _setTransformRotate(_this.displayRegionContainer, degrees); _setTransformRotate(_this.displayRegion, -degrees); - _this.viewport.setRotation(degrees); + _this.viewport.setRotation(degrees, immediately); } if (options.navigatorRotate) { var degrees = options.viewer.viewport ? options.viewer.viewport.getRotation() : options.viewer.degrees || 0; - rotate(degrees); + rotate(degrees, true); options.viewer.addHandler("rotate", function (args) { - rotate(args.degrees); + rotate(args.degrees, args.immediately); }); }