From 55a05342e9e0e44a05184b7b6aeb59672cbd6a9c Mon Sep 17 00:00:00 2001 From: AllyTally Date: Thu, 3 Aug 2023 17:55:25 -0300 Subject: [PATCH] Replace manual check with SDL_PointInRect --- desktop_version/src/LevelDebugger.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/LevelDebugger.cpp b/desktop_version/src/LevelDebugger.cpp index 91ee8b8c..43c87e0f 100644 --- a/desktop_version/src/LevelDebugger.cpp +++ b/desktop_version/src/LevelDebugger.cpp @@ -45,8 +45,8 @@ namespace level_debugger bool mouse_within(SDL_Rect* rect) { - return key.mx >= rect->x && key.mx < rect->x + rect->w && - key.my >= rect->y && key.my < rect->y + rect->h; + SDL_Point mouse = { key.mx, key.my }; + return SDL_PointInRect(&mouse, rect); } void set_forced(void)