diff --git a/gfx/element.lua b/gfx/element.lua index 2bf8a61..d59c9e5 100644 --- a/gfx/element.lua +++ b/gfx/element.lua @@ -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()