Skip to content

Commit d9d9187

Browse files
TimMenu/Interaction: fixed color picker
1 parent 7f317df commit d9d9187

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

TimMenu/Interaction.lua

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,23 @@ function Interaction.IsHovered(win, bounds)
3030
return false
3131
end
3232

33-
-- Block if inside any widget-level exclusion region (e.g. dropdown pop-ups)
33+
-- Check if element is within blocked regions (popups)
34+
-- If element bounds are entirely within blocked regions, allow it (popup elements)
3435
if win._widgetBlockedRegions then
36+
local elementInBlockedRegion = false
3537
for _, region in ipairs(win._widgetBlockedRegions) do
36-
if inBounds(mX, mY, region) then
37-
return false
38+
if bounds.x >= region.x and bounds.x + bounds.w <= region.x + region.w and
39+
bounds.y >= region.y and bounds.y + bounds.h <= region.y + region.h then
40+
elementInBlockedRegion = true
41+
break
42+
end
43+
end
44+
if not elementInBlockedRegion then
45+
-- Element is not within blocked regions, check if mouse is in blocked regions
46+
for _, region in ipairs(win._widgetBlockedRegions) do
47+
if inBounds(mX, mY, region) then
48+
return false
49+
end
3850
end
3951
end
4052
end

0 commit comments

Comments
 (0)