error fix
This commit is contained in:
@@ -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 ------
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user