Internals: Fixed CalcSizeContents() returning negative value on first run (inconsequential afaik, but fixing for sanity)

This commit is contained in:
omar 2018-07-06 19:24:54 +02:00
parent 9dea27b273
commit ce18371d1b

View File

@ -6545,6 +6545,7 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFl
size = ImFloor(settings->Size); size = ImFloor(settings->Size);
} }
window->Size = window->SizeFull = window->SizeFullAtLastBegin = size; window->Size = window->SizeFull = window->SizeFullAtLastBegin = size;
window->DC.CursorMaxPos = window->Pos; // So first call to CalcSizeContents() doesn't return crazy values
if ((flags & ImGuiWindowFlags_AlwaysAutoResize) != 0) if ((flags & ImGuiWindowFlags_AlwaysAutoResize) != 0)
{ {