fix non-code references
This commit is contained in:
@@ -444,7 +444,7 @@ function Gui.getElementAtPosition(x, y)
|
||||
local topBlocker = blockingElements[1]
|
||||
-- If the top blocker has higher z-index than the top 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
|
||||
return topBlocker
|
||||
end
|
||||
|
||||
@@ -2502,7 +2502,7 @@ function Element:destroy()
|
||||
-- Clear animation reference
|
||||
self.animation = nil
|
||||
|
||||
-- Clear callback to prevent closure leaks
|
||||
-- Clear onEvent to prevent closure leaks
|
||||
self.onEvent = nil
|
||||
end
|
||||
|
||||
@@ -3154,7 +3154,7 @@ function Element:update(dt)
|
||||
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
|
||||
local overflowX = self.overflowX or self.overflow
|
||||
local overflowY = self.overflowY or self.overflow
|
||||
@@ -3293,7 +3293,7 @@ function Element:update(dt)
|
||||
if not self._pressed[button] then
|
||||
-- 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
|
||||
-- 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._scrollbarPressHandled = true
|
||||
else
|
||||
|
||||
@@ -186,7 +186,7 @@ local button = Gui.new({
|
||||
textColor = Color.new(1, 1, 1, 1),
|
||||
backgroundColor = Color.new(0.2, 0.4, 0.8, 0.3), -- Shows behind theme
|
||||
themeComponent = "button", -- Uses button component from active theme
|
||||
callback = function(element, event)
|
||||
onEvent = function(element, event)
|
||||
if event.type == "click" then
|
||||
print("Clicked!")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user