Rich Text example progress

This commit is contained in:
Insality
2023-02-08 21:01:37 +02:00
parent 547b10d097
commit 5e92cf5ffc
6 changed files with 4078 additions and 58 deletions

View File

@@ -173,6 +173,21 @@ function M.contains(t, value)
end
function M.deepcopy(orig_table)
local orig_type = type(orig_table)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig_table, nil do
copy[M.deepcopy(orig_key)] = M.deepcopy(orig_value)
end
else -- number, string, boolean, etc
copy = orig_table
end
return copy
end
--- Get text metric from gui node. Replacement of previous gui.get_text_metrics_from_node function
-- @tparam Node text_node
-- @treturn table {width, height, max_ascent, max_descent}