feat: set up view width/height with function (#848)

This commit is contained in:
Queensferry
2021-12-17 05:15:47 +08:00
committed by GitHub
parent f408781a46
commit 0aec64d56c

View File

@@ -253,6 +253,8 @@ local function get_size()
local size = M.View[width_or_height]
if type(size) == "number" then
return size
elseif type(size) == "function" then
return size()
end
local size_as_number = tonumber(size:sub(0, -2))
local percent_as_decimal = size_as_number / 100