From c056eae22f3cddc757acd18aa8a090ed940f1c8f Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Wed, 2 Oct 2024 13:23:46 +0200 Subject: [PATCH] Fix metatable inheritance rules --- gfx/element.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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()