From 48bcd75f1a76d84a72ed7dfbdba44a50219b26e1 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 11 Dec 2022 14:47:52 -0500 Subject: [PATCH 1/2] fixed logic of dragNavigatorBackToCenter method --- test/modules/navigator.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/modules/navigator.js b/test/modules/navigator.js index e4636108..0859abb9 100644 --- a/test/modules/navigator.js +++ b/test/modules/navigator.js @@ -248,14 +248,8 @@ }; var dragNavigatorBackToCenter = function () { - var start = viewer.viewport.getBounds().getTopLeft(), - target = new OpenSeadragon.Point(0.5 - viewer.viewport.getBounds().width / 2, - 1 / viewer.source.aspectRatio / 2 - viewer.viewport.getBounds().height / 2), - delta = target.minus(start); - if (viewer.source.aspectRatio < 1) { - delta.y *= viewer.source.aspectRatio; - } - simulateNavigatorDrag(viewer.navigator, delta.x * displayRegionWidth, delta.y * displayRegionHeight); + var delta = viewer.viewport.getHomeBounds().getCenter().minus(viewer.viewport.getCenter()).times(displayRegionWidth); + simulateNavigatorDrag(viewer.navigator, delta.x, delta.y); }; var resizeElement = function ($element, width, height) { From e122f372ba0e6709b087e1f7b31973eebdd9f3f8 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 11 Dec 2022 15:07:43 -0500 Subject: [PATCH 2/2] enable all tests --- test/test.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.html b/test/test.html index 7a1a6b1a..8b85a123 100644 --- a/test/test.html +++ b/test/test.html @@ -50,6 +50,6 @@ - +