mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-05 23:10:58 +00:00
Fixed positioning a window with undefined position on a specific display
This commit is contained in:
parent
98fdef75bb
commit
d141827895
1 changed files with 4 additions and 1 deletions
|
@ -1289,7 +1289,10 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||||
}
|
}
|
||||||
SDL_free(displays);
|
SDL_free(displays);
|
||||||
|
|
||||||
if (SDL_WINDOWPOS_ISCENTERED(state->window_x)) {
|
if (SDL_WINDOWPOS_ISUNDEFINED(state->window_x)) {
|
||||||
|
state->window_x = SDL_WINDOWPOS_UNDEFINED_DISPLAY(state->displayID);
|
||||||
|
state->window_y = SDL_WINDOWPOS_UNDEFINED_DISPLAY(state->displayID);
|
||||||
|
} else if (SDL_WINDOWPOS_ISCENTERED(state->window_x)) {
|
||||||
state->window_x = SDL_WINDOWPOS_CENTERED_DISPLAY(state->displayID);
|
state->window_x = SDL_WINDOWPOS_CENTERED_DISPLAY(state->displayID);
|
||||||
state->window_y = SDL_WINDOWPOS_CENTERED_DISPLAY(state->displayID);
|
state->window_y = SDL_WINDOWPOS_CENTERED_DISPLAY(state->displayID);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue