diff --git a/Packages/AppWindowUtility/Runtime/Windows/Windows.cs b/Packages/AppWindowUtility/Runtime/Windows/Windows.cs index 475d68e..ba84178 100644 --- a/Packages/AppWindowUtility/Runtime/Windows/Windows.cs +++ b/Packages/AppWindowUtility/Runtime/Windows/Windows.cs @@ -303,37 +303,37 @@ namespace SatorImaging.AppWindowUtility if (resizeDirection.x > 0) { if (resizeDirection.y > 0) { width = (int)(rect.right - rect.left + deltaX); - height = (int)(width / aspectRatio); }else if (resizeDirection.y < 0) { width = (int)(rect.right - rect.left + deltaX); - height = (int)(width / aspectRatio); }else { width = (int)(rect.right - rect.left + deltaX); - height = (int)(width / aspectRatio); } + width = Mathf.Max(width, 100); + height = (int)(width / aspectRatio); }else if (resizeDirection.x < 0) { if (resizeDirection.y > 0) { x += (int)deltaX; width = rect.right - x; - height = (int)(width / aspectRatio); }else if (resizeDirection.y < 0) { x += (int)deltaX; width = rect.right - x; - height = (int)(width / aspectRatio); }else { x += (int)deltaX; width = rect.right - x; - height = (int)(width / aspectRatio); } + if (width < 100) x -= 100 - width; + width = Mathf.Max(width, 100); + height = (int)(width / aspectRatio); } else { if (resizeDirection.y > 0) { y += (int)deltaY; height = rect.bottom - y; - width = (int)(height * aspectRatio); }else if (resizeDirection.y < 0) { height = (int)(rect.bottom - rect.top + deltaY); - width = (int)(height * aspectRatio); } + if (height < 150 && resizeDirection.y > 0) y -= 150 - height; + height = Mathf.Max(height, 150); + width = (int)(height * aspectRatio); } WinApi.SetWindowPos(hWnd, IntPtr.Zero, x, y, width, height, WinApi.SetWindowPosFlags.NoFlag);