Fix #70: overlapping buttons both react to hover

This commit is contained in:
Matthias Richter 2018-06-17 18:52:30 +02:00
parent eabad8c554
commit 2f479ba30a

View file

@ -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