prevented incompatible size limits

This commit is contained in:
unknown 2026-02-07 03:29:06 +01:00
parent dbc440107f
commit 3d1afc3cff

View File

@ -972,6 +972,12 @@ void SetWindowMonitor(int monitor)
// Set window minimum dimensions (FLAG_WINDOW_RESIZABLE) // Set window minimum dimensions (FLAG_WINDOW_RESIZABLE)
void SetWindowMinSize(int width, int height) void SetWindowMinSize(int width, int height)
{ {
if ((width > CORE.Window.screenMax.width) || (height > CORE.Window.screenMax.height))
{
TRACELOG(LOG_WARNING, "WIN32: WINDOW: Cannot set minimum screen size higher than the maximum");
return;
}
CORE.Window.screenMin.width = width; CORE.Window.screenMin.width = width;
CORE.Window.screenMin.height = height; CORE.Window.screenMin.height = height;
@ -981,6 +987,12 @@ void SetWindowMinSize(int width, int height)
// Set window maximum dimensions (FLAG_WINDOW_RESIZABLE) // Set window maximum dimensions (FLAG_WINDOW_RESIZABLE)
void SetWindowMaxSize(int width, int height) void SetWindowMaxSize(int width, int height)
{ {
if ((width < CORE.Window.screenMin.width) || (height < CORE.Window.screenMin.height))
{
TRACELOG(LOG_WARNING, "WIN32: WINDOW: Cannot set maximum screen size lower than the minimum");
return;
}
CORE.Window.screenMax.width = width; CORE.Window.screenMax.width = width;
CORE.Window.screenMax.height = height; CORE.Window.screenMax.height = height;