mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 01:16:26 +00:00
Simplify flags testing (#7220)
This commit is contained in:
@@ -310,7 +310,7 @@ static SDL_bool SDL_UpdateMouseFocus(SDL_Window *window, float x, float y, Uint3
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
SDL_bool inWindow = SDL_TRUE;
|
||||
|
||||
if (window && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) {
|
||||
if (window && !(window->flags & SDL_WINDOW_MOUSE_CAPTURE)) {
|
||||
if (x < 0.0f || y < 0.0f || x >= (float)window->w || y >= (float)window->h) {
|
||||
inWindow = SDL_FALSE;
|
||||
}
|
||||
@@ -482,7 +482,7 @@ static int SDL_PrivateSendMouseMotion(Uint64 timestamp, SDL_Window *window, SDL_
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (window && (window->flags & SDL_WINDOW_INPUT_FOCUS) != 0) {
|
||||
if (window && (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
|
||||
if (mouse->WarpMouse) {
|
||||
mouse->WarpMouse(window, center_x, center_y);
|
||||
} else {
|
||||
@@ -532,7 +532,7 @@ static int SDL_PrivateSendMouseMotion(Uint64 timestamp, SDL_Window *window, SDL_
|
||||
|
||||
/* make sure that the pointers find themselves inside the windows,
|
||||
unless we have the mouse captured. */
|
||||
if (window && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) {
|
||||
if (window && !(window->flags & SDL_WINDOW_MOUSE_CAPTURE)) {
|
||||
int x_min = 0, x_max = window->w - 1;
|
||||
int y_min = 0, y_max = window->h - 1;
|
||||
const SDL_Rect *confine = SDL_GetWindowMouseRect(window);
|
||||
|
Reference in New Issue
Block a user