From 68a9c6e6570d2d29a59d8877cff529cc6322946d Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Wed, 5 Jun 2024 11:10:17 -0500 Subject: [PATCH] Maintain aspect ratio when overdragging --- web/src/views/live/DraggableGridLayout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/views/live/DraggableGridLayout.tsx b/web/src/views/live/DraggableGridLayout.tsx index a65591923..36165e711 100644 --- a/web/src/views/live/DraggableGridLayout.tsx +++ b/web/src/views/live/DraggableGridLayout.tsx @@ -321,7 +321,7 @@ export default function DraggableGridLayout({ const heightDiff = layoutItem.h - oldLayoutItem.h; const widthDiff = layoutItem.w - oldLayoutItem.w; const changeCoef = oldLayoutItem.w / oldLayoutItem.h; - if (Math.abs(heightDiff) < Math.abs(widthDiff) || layoutItem.w == 12) { + if (Math.abs(heightDiff) != Math.abs(widthDiff) || layoutItem.w == 12) { layoutItem.h = layoutItem.w / changeCoef; placeholder.h = layoutItem.w / changeCoef; } else {