mirror of
https://github.com/glfw/glfw.git
synced 2024-11-25 06:04:34 +00:00
Splits min|max width and height limits for Win32 window
Currently, we cannot constraint the window size for only a single direction (width or height): we can either not constraint at all or constraint both width and height. With this change, the size constraints can be specified for a single direction as well.
This commit is contained in:
parent
b35641f4a3
commit
45d52f4473
@ -1107,17 +1107,23 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l
|
|||||||
else
|
else
|
||||||
AdjustWindowRectEx(&frame, style, FALSE, exStyle);
|
AdjustWindowRectEx(&frame, style, FALSE, exStyle);
|
||||||
|
|
||||||
if (window->minwidth != GLFW_DONT_CARE &&
|
if (window->minwidth != GLFW_DONT_CARE)
|
||||||
window->minheight != GLFW_DONT_CARE)
|
|
||||||
{
|
{
|
||||||
mmi->ptMinTrackSize.x = window->minwidth + frame.right - frame.left;
|
mmi->ptMinTrackSize.x = window->minwidth + frame.right - frame.left;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window->minheight != GLFW_DONT_CARE)
|
||||||
|
{
|
||||||
mmi->ptMinTrackSize.y = window->minheight + frame.bottom - frame.top;
|
mmi->ptMinTrackSize.y = window->minheight + frame.bottom - frame.top;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window->maxwidth != GLFW_DONT_CARE &&
|
if (window->maxwidth != GLFW_DONT_CARE)
|
||||||
window->maxheight != GLFW_DONT_CARE)
|
|
||||||
{
|
{
|
||||||
mmi->ptMaxTrackSize.x = window->maxwidth + frame.right - frame.left;
|
mmi->ptMaxTrackSize.x = window->maxwidth + frame.right - frame.left;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window->maxheight != GLFW_DONT_CARE)
|
||||||
|
{
|
||||||
mmi->ptMaxTrackSize.y = window->maxheight + frame.bottom - frame.top;
|
mmi->ptMaxTrackSize.y = window->maxheight + frame.bottom - frame.top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user