Browse Source

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

omar 7 years ago
parent
commit
ce18371d1b
1 changed files with 1 additions and 0 deletions
  1. 1 0
      imgui.cpp

+ 1 - 0
imgui.cpp

@@ -6545,6 +6545,7 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFl
                 size = ImFloor(settings->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)
     {