video: Don't error when setting an unbounded max window size while a minimum is set
If the maximum size was changed to 0 (unbounded) while a minimum was set, the sanity check ensuring that the max size isn't less than the minimum size would incorrectly cause the operation to error out.
This commit is contained in:
1 parent
068d9cc7d6
commit
2762644e96
1 file changed
+2
-1
@@ -3122,7 +3122,8 @@ bool SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h)
|
||||
return SDL_InvalidParamError("max_h");
|
||||
}
|
||||
|
||||
if (max_w < window->min_w || max_h < window->min_h) {
|
||||
if ((max_w && max_w < window->min_w) ||
|
||||
(max_h && max_h < window->min_h)) {
|
||||
return SDL_SetError("SDL_SetWindowMaximumSize(): Tried to set maximum size smaller than minimum size");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user