fix non-code references

This commit is contained in:
Michael Freno
2025-11-11 13:17:45 -05:00
parent be0771d0d3
commit 9e18b67a64
3 changed files with 5 additions and 5 deletions

View File

@@ -444,7 +444,7 @@ function Gui.getElementAtPosition(x, y)
local topBlocker = blockingElements[1] local topBlocker = blockingElements[1]
-- If the top blocker has higher z-index than the top candidate, -- If the top blocker has higher z-index than the top candidate,
-- and the blocker is NOT an ancestor of the candidate, -- and the blocker is NOT an ancestor of the candidate,
-- return the blocker (even though it has no callback, it blocks input) -- return the blocker (even though it has no onEvent, it blocks input)
if topBlocker.z > topCandidate.z and not isAncestor(topBlocker, topCandidate) then if topBlocker.z > topCandidate.z and not isAncestor(topBlocker, topCandidate) then
return topBlocker return topBlocker
end end

View File

@@ -2502,7 +2502,7 @@ function Element:destroy()
-- Clear animation reference -- Clear animation reference
self.animation = nil self.animation = nil
-- Clear callback to prevent closure leaks -- Clear onEvent to prevent closure leaks
self.onEvent = nil self.onEvent = nil
end end
@@ -3154,7 +3154,7 @@ function Element:update(dt)
end end
end end
-- Handle scrollbar click/press (independent of callback) -- Handle scrollbar click/press (independent of onEvent)
-- Check if we should handle scrollbar press for elements with overflow -- Check if we should handle scrollbar press for elements with overflow
local overflowX = self.overflowX or self.overflow local overflowX = self.overflowX or self.overflow
local overflowY = self.overflowY or self.overflow local overflowY = self.overflowY or self.overflow
@@ -3293,7 +3293,7 @@ function Element:update(dt)
if not self._pressed[button] then if not self._pressed[button] then
-- Check if press is on scrollbar first (skip if already handled) -- Check if press is on scrollbar first (skip if already handled)
if button == 1 and not self._scrollbarPressHandled and self:_handleScrollbarPress(mx, my, button) then if button == 1 and not self._scrollbarPressHandled and self:_handleScrollbarPress(mx, my, button) then
-- Scrollbar consumed the event, mark as pressed to prevent callback -- Scrollbar consumed the event, mark as pressed to prevent onEvent
self._pressed[button] = true self._pressed[button] = true
self._scrollbarPressHandled = true self._scrollbarPressHandled = true
else else

View File

@@ -186,7 +186,7 @@ local button = Gui.new({
textColor = Color.new(1, 1, 1, 1), textColor = Color.new(1, 1, 1, 1),
backgroundColor = Color.new(0.2, 0.4, 0.8, 0.3), -- Shows behind theme backgroundColor = Color.new(0.2, 0.4, 0.8, 0.3), -- Shows behind theme
themeComponent = "button", -- Uses button component from active theme themeComponent = "button", -- Uses button component from active theme
callback = function(element, event) onEvent = function(element, event)
if event.type == "click" then if event.type == "click" then
print("Clicked!") print("Clicked!")
end end