Browse Source

Fixed new collapsed auto-resizing window with saved .ini settings not calculating their initial width #176

ocornut 10 years ago
parent
commit
4ee5a792ff
1 changed files with 6 additions and 1 deletions
  1. 6 1
      imgui.cpp

+ 6 - 1
imgui.cpp

@@ -2915,7 +2915,12 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFl
         window->Size = window->SizeFull = size;
         window->Size = window->SizeFull = size;
     }
     }
 
 
-    if (ImLengthSqr(window->Size) < 0.00001f)
+    if ((flags & ImGuiWindowFlags_AlwaysAutoResize) != 0)
+    {
+        window->AutoFitFrames = 2;
+        window->AutoFitOnlyGrows = false;
+    }
+    else if (ImLengthSqr(window->Size) < 0.00001f)
     {
     {
         window->AutoFitFrames = 2;
         window->AutoFitFrames = 2;
         window->AutoFitOnlyGrows = true;
         window->AutoFitOnlyGrows = true;