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

This commit is contained in:
ocornut 2015-03-27 15:18:45 +00:00
parent 2e26196aba
commit 4ee5a792ff

View File

@ -2915,7 +2915,12 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFl
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->AutoFitOnlyGrows = true;