Allow passing 0 to SDL_SetWindowMinimumSize() and SDL_SetWindowMaximumSize() to indicate no limit

This commit is contained in:
Sam Lantinga committed 2023-03-15 16:13:56 -07:00
1 parent d95b04feaf
commit 422517c036
3 files changed
+22 -12

No files matched your search

+2 -2
View File
@@ -1141,7 +1141,7 @@ static int video_getSetWindowMinimumSize(void *arg)
SDLTest_AssertPass("Call to SDL_ClearError()");
for (desiredH = -2; desiredH < 2; desiredH++) {
for (desiredW = -2; desiredW < 2; desiredW++) {
if (desiredW <= 0 || desiredH <= 0) {
if (desiredW < 0 || desiredH < 0) {
SDL_SetWindowMinimumSize(window, desiredW, desiredH);
SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(...,%d,%d)", desiredW, desiredH);
checkInvalidParameterError();
@@ -1279,7 +1279,7 @@ static int video_getSetWindowMaximumSize(void *arg)
SDLTest_AssertPass("Call to SDL_ClearError()");
for (desiredH = -2; desiredH < 2; desiredH++) {
for (desiredW = -2; desiredW < 2; desiredW++) {
if (desiredW <= 0 || desiredH <= 0) {
if (desiredW < 0 || desiredH < 0) {
SDL_SetWindowMaximumSize(window, desiredW, desiredH);
SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(...,%d,%d)", desiredW, desiredH);
checkInvalidParameterError();