Skip to content

Commit

Permalink
Return width from helper.centrate_nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Insality committed Sep 2, 2023
1 parent ca8c4e2 commit 5ed9bdd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion druid/editor_scripts/druid.editor_script
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end
function M.get_commands()
return {
{
label = "Print gui scheme",
label = "Print GUI Scheme",

locations = { "Outline" },

Expand Down
6 changes: 4 additions & 2 deletions druid/helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ end
-- @tparam number margin Offset between nodes
-- @local
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


Expand All @@ -66,7 +66,7 @@ end
-- @tparam[opt=0] number margin Offset between nodes
-- @local
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


Expand Down Expand Up @@ -107,6 +107,8 @@ function M.centrate_nodes(margin, ...)

pos_x = pos_x + node_widths[i]/2 + margin -- add second part of offset
end

return width
end


Expand Down

0 comments on commit 5ed9bdd

Please sign in to comment.