video: Fix boolean logic for getting the pending window position
(cherry picked from commit 03cdd297e0)
This commit is contained in:
1 parent
4029521a63
commit
3ed80843fe
1 file changed
+3
-3
@@ -2924,12 +2924,12 @@ bool SDL_GetWindowPosition(SDL_Window *window, int *x, int *y)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} 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) {
|
if (x) {
|
||||||
*x = use_current ? window->x : window->pending.x;
|
*x = use_pending ? window->pending.x : window->x;
|
||||||
}
|
}
|
||||||
if (y) {
|
if (y) {
|
||||||
*y = use_current ? window->y : window->pending.y;
|
*y = use_pending ? window->pending.y : window->y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in new issue
Block a user