From 28e3af3c7d001433732dd93b743aacf5c3a99464 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Wed, 5 Jun 2024 12:22:05 -0500 Subject: [PATCH] add existing x value --- web/src/views/live/DraggableGridLayout.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/views/live/DraggableGridLayout.tsx b/web/src/views/live/DraggableGridLayout.tsx index 36165e711..50c2258b9 100644 --- a/web/src/views/live/DraggableGridLayout.tsx +++ b/web/src/views/live/DraggableGridLayout.tsx @@ -321,7 +321,10 @@ 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.x + layoutItem.w >= 12 + ) { layoutItem.h = layoutItem.w / changeCoef; placeholder.h = layoutItem.w / changeCoef; } else {