fixed logic of dragNavigatorBackToCenter method

This commit is contained in:
Tom 2022-12-11 14:47:52 -05:00
parent dd2f132577
commit 48bcd75f1a

View File

@ -248,14 +248,8 @@
}; };
var dragNavigatorBackToCenter = function () { var dragNavigatorBackToCenter = function () {
var start = viewer.viewport.getBounds().getTopLeft(), var delta = viewer.viewport.getHomeBounds().getCenter().minus(viewer.viewport.getCenter()).times(displayRegionWidth);
target = new OpenSeadragon.Point(0.5 - viewer.viewport.getBounds().width / 2, simulateNavigatorDrag(viewer.navigator, delta.x, delta.y);
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 resizeElement = function ($element, width, height) { var resizeElement = function ($element, width, height) {