From 2f479ba30a8c3284d2d4ebd9b350a2435f4454c6 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Sun, 17 Jun 2018 18:52:30 +0200 Subject: [PATCH] Fix #70: overlapping buttons both react to hover --- core.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core.lua b/core.lua index 5b4d2ee..716aa6c 100644 --- a/core.lua +++ b/core.lua @@ -100,7 +100,7 @@ function suit:mouseInRect(x,y,w,h) end function suit:registerMouseHit(id, ul_x, ul_y, hit) - if hit(self.mouse_x - ul_x, self.mouse_y - ul_y) then + if not self.hovered and hit(self.mouse_x - ul_x, self.mouse_y - ul_y) then self.hovered = id if self.active == nil and self.mouse_button_down then self.active = id