#406 bounds check all controls

This commit is contained in:
Mikayla Fischler
2024-02-25 15:53:14 -05:00
parent 6ef049baa1
commit dbc1f41c5d
8 changed files with 33 additions and 35 deletions

View File

@@ -90,7 +90,8 @@ local function radio_button(args)
-- handle mouse interaction
---@param event mouse_interaction mouse event
function e.handle_mouse(event)
if e.enabled and core.events.was_clicked(event.type) and (event.initial.y == event.current.y) then
if e.enabled and core.events.was_clicked(event.type) and
(event.initial.y == event.current.y) and e.in_frame_bounds(event.current.x, event.current.y) then
-- determine what was pressed
if args.options[event.current.y] ~= nil then
e.value = event.current.y