mirror of
https://github.com/Insality/druid
synced 2025-06-27 10:27:48 +02:00
Return width from helper.centrate_nodes
This commit is contained in:
parent
ca8c4e2425
commit
5ed9bdd814
@ -26,7 +26,7 @@ end
|
|||||||
function M.get_commands()
|
function M.get_commands()
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
label = "Print gui scheme",
|
label = "Print GUI Scheme",
|
||||||
|
|
||||||
locations = { "Outline" },
|
locations = { "Outline" },
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ end
|
|||||||
-- @tparam number margin Offset between nodes
|
-- @tparam number margin Offset between nodes
|
||||||
-- @local
|
-- @local
|
||||||
function M.centrate_text_with_icon(text_node, icon_node, margin)
|
function M.centrate_text_with_icon(text_node, icon_node, margin)
|
||||||
M.centrate_nodes(margin, text_node, icon_node)
|
return M.centrate_nodes(margin, text_node, icon_node)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ end
|
|||||||
-- @tparam[opt=0] number margin Offset between nodes
|
-- @tparam[opt=0] number margin Offset between nodes
|
||||||
-- @local
|
-- @local
|
||||||
function M.centrate_icon_with_text(icon_node, text_node, margin)
|
function M.centrate_icon_with_text(icon_node, text_node, margin)
|
||||||
M.centrate_nodes(margin, icon_node, text_node)
|
return M.centrate_nodes(margin, icon_node, text_node)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -107,6 +107,8 @@ function M.centrate_nodes(margin, ...)
|
|||||||
|
|
||||||
pos_x = pos_x + node_widths[i]/2 + margin -- add second part of offset
|
pos_x = pos_x + node_widths[i]/2 + margin -- add second part of offset
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return width
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user