From c9430bb80735de46e8cc547abdd55b29de500d23 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 22 Mar 2015 17:22:39 +0000 Subject: [PATCH] Fixed new windows auto-fitting bigger than their .ini saved size --- imgui.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 5dec4179..5eb205a6 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -1574,12 +1574,6 @@ ImGuiWindow::ImGuiWindow(const char* name) ItemWidthDefault = 0.0f; FontWindowScale = 1.0f; - if (ImLengthSqr(Size) < 0.00001f) - { - AutoFitFrames = 2; - AutoFitOnlyGrows = true; - } - DrawList = (ImDrawList*)ImGui::MemAlloc(sizeof(ImDrawList)); new(DrawList) ImDrawList(); RootWindow = NULL; @@ -2877,6 +2871,13 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFl size = settings->Size; window->Size = window->SizeFull = size; } + + if (ImLengthSqr(window->Size) < 0.00001f) + { + window->AutoFitFrames = 2; + window->AutoFitOnlyGrows = true; + } + g.Windows.push_back(window); return window; }