From 99e315d2b22659ca439ad5723d34f7ebdf6ac39e Mon Sep 17 00:00:00 2001 From: ocornut Date: Sat, 2 May 2015 18:14:24 +0100 Subject: [PATCH] Fix for width of child windows with scrollbar (broken 376a6a5af0f7b6421c63ca7e0e07d133447d34e7) --- imgui.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 115b5484..d8f4099f 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3304,15 +3304,16 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_ if ((flags & ImGuiWindowFlags_AlwaysAutoResize) != 0) { // Don't continuously mark settings as dirty, the size of the window doesn't need to be stored. - window->Size = window->SizeFull = size_auto_fit; + window->SizeFull = size_auto_fit; } else if (window->AutoFitFrames > 0) { // Auto-fit only grows during the first few frames - window->Size = window->SizeFull = window->AutoFitOnlyGrows ? ImMax(window->SizeFull, size_auto_fit) : size_auto_fit; + window->SizeFull = window->AutoFitOnlyGrows ? ImMax(window->SizeFull, size_auto_fit) : size_auto_fit; if (!(flags & ImGuiWindowFlags_NoSavedSettings)) MarkSettingsDirty(); } + window->Size = window->SizeFull; } // Draw window + handle manual resize