feat: Added minimum window size
This commit is contained in:
parent
8382700441
commit
f721cee708
1 changed files with 8 additions and 8 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue