From 9c0d357817a0a756543c3aa56de4b08bb1933a79 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:52:52 +1000 Subject: [PATCH] fix(ui): prevent panel size percentages over 100 --- invokeai/frontend/web/src/features/ui/hooks/usePanel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invokeai/frontend/web/src/features/ui/hooks/usePanel.ts b/invokeai/frontend/web/src/features/ui/hooks/usePanel.ts index 7b748e79a06..871bd931352 100644 --- a/invokeai/frontend/web/src/features/ui/hooks/usePanel.ts +++ b/invokeai/frontend/web/src/features/ui/hooks/usePanel.ts @@ -250,5 +250,5 @@ const getSizeAsPercentage = ( }); // The final value is a percentage of the available space - return (sizeInPixels / availableSpace) * 100; + return Math.min((sizeInPixels / availableSpace) * 100, 100); };