helium/hooks/size.lua
2021-05-03 22:38:34 +03:00

8 lines
345 B
Lua

local path = string.sub(..., 1, string.len(...) - string.len(".control.size"))
local stack = require(path..'.core.stack')
--Sets the computed/minimum size of an element to be used with layout calculations and rendering
return function(w, h)
local currentStack = stack.getContext()
currentStack.element:setCalculatedSize(w, h)
end