mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-04 13:04:41 +00:00
Don't do anything if the window mouse rect hasn't changed
This commit is contained in:
@@ -4052,12 +4052,16 @@ bool SDL_SetWindowMouseRect(SDL_Window *window, const SDL_Rect *rect)
|
|||||||
{
|
{
|
||||||
CHECK_WINDOW_MAGIC(window, false);
|
CHECK_WINDOW_MAGIC(window, false);
|
||||||
|
|
||||||
if (rect) {
|
SDL_Rect zero = { 0, 0, 0, 0 };
|
||||||
SDL_memcpy(&window->mouse_rect, rect, sizeof(*rect));
|
if (!rect) {
|
||||||
} else {
|
rect = &zero;
|
||||||
SDL_zero(window->mouse_rect);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SDL_memcmp(&window->mouse_rect, rect, sizeof(*rect)) == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
SDL_memcpy(&window->mouse_rect, rect, sizeof(*rect));
|
||||||
|
|
||||||
if (_this->SetWindowMouseRect) {
|
if (_this->SetWindowMouseRect) {
|
||||||
return _this->SetWindowMouseRect(_this, window);
|
return _this->SetWindowMouseRect(_this, window);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user