From 4e021c80b8fe6be52bd87c1eb4c15b4fef411562 Mon Sep 17 00:00:00 2001 From: qfx Date: Sun, 16 Feb 2020 19:13:19 +0200 Subject: [PATCH] fix --- core/input.lua | 4 ++-- init.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/input.lua b/core/input.lua index 4bb3a39..c363874 100755 --- a/core/input.lua +++ b/core/input.lua @@ -213,14 +213,14 @@ end input.subscribe = subscription.create --Since the introduction of the relative subscriptions, there is more utility in ommiting coordinates by default -input.sub = function(eventType, callback, cbOff, x, y, w, h) +setmetatable(input, {__call = function(eventType, callback, cbOff, x, y, w, h) x = x or 0 y = y or 0 w = w or 1 h = h or 1 subscription.create(x,y,w,h,eventType,callback,cbOff) -end +end}) function input.eventHandlers.mousereleased(x, y, btn) local captured = false diff --git a/init.lua b/init.lua index e49be66..5f011db 100755 --- a/init.lua +++ b/init.lua @@ -12,11 +12,11 @@ helium.input = require(path..".core.input") helium.loader = require(path..".loader") helium.elementBuffer = {} helium.__index = helium -helium.__call = function(s,chunk) +setmetatable(helium, {__call = function(s,chunk) return function(param,w,h) return helium.element(chunk,nil,w,h,param) end -end +end}) function helium.render() --We don't want any side effects affecting internal rendering