mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-16 00:24:04 +00:00
video: Fix boolean logic for getting the pending window position
This commit is contained in:
@@ -2925,12 +2925,12 @@ bool SDL_GetWindowPosition(SDL_Window *window, int *x, int *y)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const bool use_current = !(window->flags & SDL_WINDOW_HIDDEN) && !window->last_position_pending;
|
||||
const bool use_pending = (window->flags & SDL_WINDOW_HIDDEN) && window->last_position_pending;
|
||||
if (x) {
|
||||
*x = use_current ? window->x : window->pending.x;
|
||||
*x = use_pending ? window->pending.x : window->x;
|
||||
}
|
||||
if (y) {
|
||||
*y = use_current ? window->y : window->pending.y;
|
||||
*y = use_pending ? window->pending.y : window->y;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user