From 5ed9bdd8145a3a64916be2a0d25a4ef534e0c710 Mon Sep 17 00:00:00 2001 From: Insality Date: Sat, 2 Sep 2023 21:25:58 +0300 Subject: [PATCH] Return width from helper.centrate_nodes --- druid/editor_scripts/druid.editor_script | 2 +- druid/helper.lua | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/druid/editor_scripts/druid.editor_script b/druid/editor_scripts/druid.editor_script index 35e6944..6534c1d 100644 --- a/druid/editor_scripts/druid.editor_script +++ b/druid/editor_scripts/druid.editor_script @@ -26,7 +26,7 @@ end function M.get_commands() return { { - label = "Print gui scheme", + label = "Print GUI Scheme", locations = { "Outline" }, diff --git a/druid/helper.lua b/druid/helper.lua index f61b2ad..64309d0 100644 --- a/druid/helper.lua +++ b/druid/helper.lua @@ -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 @@ -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 @@ -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