From 69d0d3345107ee0e26d767a236825465338a8310 Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 25 Sep 2017 22:45:10 +0200 Subject: [PATCH] Exposed PushMultiItemsWidths() to imgui_internal.h --- imgui.cpp | 7 +++---- imgui_internal.h | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 1e5f9c16..f392fc1c 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -592,7 +592,6 @@ static void LogRenderedText(const ImVec2& ref_pos, const char* text, const char* text_end = NULL); -static void PushMultiItemsWidths(int components, float w_full = 0.0f); static float GetDraggedColumnOffset(int column_index); static bool IsKeyPressedMap(ImGuiKey key, bool repeat = true); @@ -4676,12 +4675,12 @@ void ImGui::PushItemWidth(float item_width) window->DC.ItemWidthStack.push_back(window->DC.ItemWidth); } -static void PushMultiItemsWidths(int components, float w_full) +void ImGui::PushMultiItemsWidths(int components, float w_full) { - ImGuiWindow* window = ImGui::GetCurrentWindow(); + ImGuiWindow* window = GetCurrentWindow(); const ImGuiStyle& style = GImGui->Style; if (w_full <= 0.0f) - w_full = ImGui::CalcItemWidth(); + w_full = CalcItemWidth(); const float w_item_one = ImMax(1.0f, (float)(int)((w_full - (style.ItemInnerSpacing.x) * (components-1)) / (float)components)); const float w_item_last = ImMax(1.0f, (float)(int)(w_full - (w_item_one + style.ItemInnerSpacing.x) * (components-1))); window->DC.ItemWidthStack.push_back(w_item_last); diff --git a/imgui_internal.h b/imgui_internal.h index 63bbb043..cd78dbbd 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -772,6 +772,7 @@ namespace ImGui IMGUI_API void FocusableItemUnregister(ImGuiWindow* window); IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_x, float default_y); IMGUI_API float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x); + IMGUI_API void PushMultiItemsWidths(int components, float width_full = 0.0f); IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled); IMGUI_API void PopItemFlag();