From 9ccf93d7674e686f4321adca4e7a606801cbf718 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 14 Dec 2022 09:25:23 -0500 Subject: [PATCH] cleaning up changes --- src/viewer.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/viewer.js b/src/viewer.js index d1fe1535..64af46c4 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -3581,13 +3581,11 @@ function doViewerResize(viewer, containerSize){ var resizeRatio; if (viewer.preserveImageSizeOnResize) { resizeRatio = THIS[viewer.hash].prevContainerSize.x / containerSize.x; - // viewport.zoomTo(zoom * resizeRatio, null, true); } else { - var o = new $.Point(0, 0); - var prevDiag = new $.Point(THIS[viewer.hash].prevContainerSize.x, THIS[viewer.hash].prevContainerSize.y).distanceTo(o); - var newDiag = new $.Point(containerSize.x, containerSize.y).distanceTo(o); + var origin = new $.Point(0, 0); + var prevDiag = new $.Point(THIS[viewer.hash].prevContainerSize.x, THIS[viewer.hash].prevContainerSize.y).distanceTo(origin); + var newDiag = new $.Point(containerSize.x, containerSize.y).distanceTo(origin); resizeRatio = newDiag / prevDiag * THIS[viewer.hash].prevContainerSize.x / containerSize.x; - // viewport.zoomTo(zoom, null, true); } viewport.zoomTo(zoom * resizeRatio, null, true); THIS[viewer.hash].prevContainerSize = containerSize;