Skip to content

Commit

Permalink
fix: toggle-ui not hiding elements when border=yes
Browse files Browse the repository at this point in the history
closes #805
  • Loading branch information
tomasklaen committed Dec 6, 2023
1 parent 78061a7 commit bc9d20c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/uosc/elements/Elements.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ end
-- Toggles passed elements' min visibilities between 0 and 1.
---@param ids string[] IDs of elements to peek.
function Elements:toggle(ids)
local has_invisible = itable_find(ids, function(id) return Elements[id] and Elements[id]:get_visibility() ~= 1 end)
local has_invisible = itable_find(ids, function(id)
return Elements[id] and Elements[id].enabled and Elements[id]:get_visibility() ~= 1
end)

self:set_min_visibility(has_invisible and 1 or 0, ids)

-- Reset proximities when toggling off. Has to happen after `set_min_visibility`,
-- as that is using proximity as a tween starting point.
if not has_invisible then
Expand Down

0 comments on commit bc9d20c

Please # to comment.