#233 fixed mouse enter/exit behavior via simplification
This commit is contained in:
@@ -84,9 +84,9 @@ local function push_button(args)
|
||||
show_pressed()
|
||||
elseif event.type == CLICK_TYPE.UP then
|
||||
show_unpressed()
|
||||
args.callback()
|
||||
elseif event.type == CLICK_TYPE.EXITED then
|
||||
show_unpressed()
|
||||
if e.in_bounds(event.current.x, event.current.y) then
|
||||
args.callback()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -93,14 +93,14 @@ local function sidebar(args)
|
||||
elseif event.type == CLICK_TYPE.DOWN then
|
||||
draw(true, cur_idx)
|
||||
elseif event.type == CLICK_TYPE.UP then
|
||||
if cur_idx == ini_idx then
|
||||
if cur_idx == ini_idx and e.in_bounds(event.current.x, event.current.y) then
|
||||
e.value = cur_idx
|
||||
draw(false)
|
||||
args.callback(e.value)
|
||||
else draw(false) end
|
||||
elseif event.type == CLICK_TYPE.EXITED then
|
||||
draw(false)
|
||||
end
|
||||
elseif event.type == CLICK_TYPE.UP then
|
||||
draw(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user