From 9a260c944be5a651747370d92fe47fc22eb53ba2 Mon Sep 17 00:00:00 2001 From: Mary Date: Wed, 8 May 2024 12:00:53 +0700 Subject: [PATCH] fix: wrong scale calculation --- src/state/gallery.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state/gallery.ts b/src/state/gallery.ts index e21bfeaea8..1253c1f5aa 100644 --- a/src/state/gallery.ts +++ b/src/state/gallery.ts @@ -286,7 +286,7 @@ function containImageRes( let scale = 1 if (w > maxW || h > maxH) { - scale = w < h ? maxW / w : maxH / h + scale = w > h ? maxW / w : maxH / h w = Math.floor(w * scale) h = Math.floor(h * scale) }