error fix

This commit is contained in:
Michael Freno
2025-09-19 10:11:15 -04:00
parent e4ab6befa4
commit 3d66d4e0e4
2 changed files with 5 additions and 2 deletions

View File

@@ -337,6 +337,7 @@ end
-- Element Object -- Element Object
-- ==================== -- ====================
---@class Element ---@class Element
---@field id string?
---@field autosizing {width:boolean, height:boolean} -- Whether the element should automatically size to fit its children ---@field autosizing {width:boolean, height:boolean} -- Whether the element should automatically size to fit its children
---@field x number -- X coordinate of the element ---@field x number -- X coordinate of the element
---@field y number -- Y coordinate of the element ---@field y number -- Y coordinate of the element
@@ -373,6 +374,7 @@ Element.__index = Element
---@class ElementProps ---@class ElementProps
---@field parent Element? -- Parent element for hierarchical structure ---@field parent Element? -- Parent element for hierarchical structure
---@field id string?
---@field x number? -- X coordinate of the element (default: 0) ---@field x number? -- X coordinate of the element (default: 0)
---@field y number? -- Y coordinate of the element (default: 0) ---@field y number? -- Y coordinate of the element (default: 0)
---@field z number? -- Z-index for layering (default: 0) ---@field z number? -- Z-index for layering (default: 0)
@@ -408,6 +410,7 @@ local ElementProps = {}
function Element.new(props) function Element.new(props)
local self = setmetatable({}, Element) local self = setmetatable({}, Element)
self.children = {} self.children = {}
self.id = props.id or ""
self.callback = props.callback self.callback = props.callback
------ add non-hereditary ------ ------ add non-hereditary ------

View File

@@ -942,8 +942,8 @@ function TestPerformance:testComplexAnimationReadyLayoutPerformance()
for i, element in ipairs(animation_elements) do for i, element in ipairs(animation_elements) do
if (frame + i) % 10 == 0 then if (frame + i) % 10 == 0 then
-- Animate size changes -- Animate size changes
element.w = element.w + math.sin(frame * 0.1 + i) * 2 element.w = element.width + math.sin(frame * 0.1 + i) * 2
element.h = element.h + math.cos(frame * 0.1 + i) * 1 element.h = element.height + math.cos(frame * 0.1 + i) * 1
end end
if (frame + i) % 15 == 0 then if (frame + i) % 15 == 0 then