From b2019519d4ed2e4d396d06d65bb36cac10a14d2c Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 2 Nov 2024 04:27:48 +0000 Subject: [PATCH] Fix calculation --- src/view/com/lightbox/ImageViewing/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/view/com/lightbox/ImageViewing/index.tsx b/src/view/com/lightbox/ImageViewing/index.tsx index 36715a3bdd..f5841427e4 100644 --- a/src/view/com/lightbox/ImageViewing/index.tsx +++ b/src/view/com/lightbox/ImageViewing/index.tsx @@ -349,9 +349,8 @@ function interpolateTransform( let initialScale = thumbnailDims.width / screenSize.width const imageAspect = imageDims.width / imageDims.height - const finalWidth = screenSize.width - const finalHeight = finalWidth / imageAspect - if (initialScale * finalHeight < thumbnailDims.height) { + const thumbAspect = thumbnailDims.width / thumbnailDims.height + if (imageAspect > 1 && thumbAspect < 1) { initialScale = initialScale * imageAspect }