Apply suggestions from code review

Co-authored-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
Giancarlo Razzolini 2024-10-25 15:25:49 -03:00 committed by RogueAI
parent 1308fda50b
commit 8f8f34df69

View file

@ -335,8 +335,8 @@ static bool is_in_hotspot(struct swaybar_dbusmenu_hotspot *hotspot, int x, int y
return false;
}
if (hotspot->x <= x && x < hotspot->x + hotspot->width && hotspot->y <= y &&
y < hotspot->y + hotspot->height) {
if (hotspot->x <= x && x - hotspot->x < hotspot->width && hotspot->y <= y &&
y - hotspot->y < hotspot->height) {
return true;
}