From bc9d20cb1ab535d79dd43f7c5d73040a81241d45 Mon Sep 17 00:00:00 2001 From: tomasklaen Date: Wed, 6 Dec 2023 23:05:42 +0100 Subject: [PATCH] fix: `toggle-ui` not hiding elements when `border=yes` closes #805 --- src/uosc/elements/Elements.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/uosc/elements/Elements.lua b/src/uosc/elements/Elements.lua index e9e86fcc..e573f387 100644 --- a/src/uosc/elements/Elements.lua +++ b/src/uosc/elements/Elements.lua @@ -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