#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

@@ -98,7 +98,7 @@ local function tabbar(args)
---@param event mouse_interaction mouse event
function e.handle_mouse(event)
-- determine what was pressed
if e.enabled and core.events.was_clicked(event.type) then
if e.enabled and core.events.was_clicked(event.type) and e.in_frame_bounds(event.current.x, event.current.y) then
-- a button may have been pressed, which one was it?
local tab_ini = which_tab(event.initial.x)
local tab_cur = which_tab(event.current.x)