Fix metatable inheritance rules

This commit is contained in:
Gabriel Tofvesson 2024-10-02 13:23:46 +02:00
parent b70c3451fa
commit c056eae22f

View File

@ -18,6 +18,7 @@ local Element = {
id = "",
onClick = nil
}
Element.__index = Element
local function createWindow(element)
return window.create(element.render.parent, element:getX(), element:getY(), element:getWidth(), element:getHeight(), element:isVisible())
@ -28,7 +29,7 @@ function Element:new(o)
local obj = o or {}
setmetatable(obj, self)
obj.__index = self
obj.__index = obj
if obj.render and obj.render.parent then
obj:_reload()