fix tests

This commit is contained in:
Kartik K. Agaram 2023-12-29 13:11:51 -08:00
parent 683dfb96de
commit 634b395a20
1 changed files with 6 additions and 0 deletions

View File

@ -9,6 +9,9 @@
-- draw button and queue up event handlers
function button(State, name, params)
if State.button_handlers == nil then
State.button_handlers = {}
end
if params.bg then
love.graphics.setColor(params.bg.r, params.bg.g, params.bg.b, params.bg.a)
love.graphics.rectangle('fill', params.x,params.y, params.w,params.h, 5,5)
@ -19,6 +22,9 @@ end
-- process button event handlers
function mouse_press_consumed_by_any_button(State, x, y, mouse_button)
if State.button_handlers == nil then
return
end
local button_pressed = false
local consume_press = true
for _,ev in ipairs(State.button_handlers) do