From 64a68743bdaf9bfd1ea22622c408c87e36af16ce Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Mon, 26 Jul 2021 22:39:20 +0200 Subject: [PATCH] During resizing, make the smaller dimension decide the new dimensions --- ts/editor/ImageHandle.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/editor/ImageHandle.svelte b/ts/editor/ImageHandle.svelte index 36e0d687e..3a47f9971 100644 --- a/ts/editor/ImageHandle.svelte +++ b/ts/editor/ImageHandle.svelte @@ -122,7 +122,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html const widthIncrease = dragWidth / naturalWidth!; const heightIncrease = dragHeight / naturalHeight!; - if (widthIncrease > heightIncrease) { + if (widthIncrease < heightIncrease) { width = Math.trunc(dragWidth); height = Math.trunc(naturalHeight! * widthIncrease); } else {