Begin(): Minor tidying up of flow

This commit is contained in:
omar 2017-09-25 15:48:52 +02:00
parent 9f34925b2a
commit 0a55573288

View File

@ -4143,13 +4143,13 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us
if (window->AutoFitFramesY > 0) if (window->AutoFitFramesY > 0)
window->SizeFull.y = window->AutoFitOnlyGrows ? ImMax(window->SizeFull.y, size_auto_fit.y) : size_auto_fit.y; window->SizeFull.y = window->AutoFitOnlyGrows ? ImMax(window->SizeFull.y, size_auto_fit.y) : size_auto_fit.y;
} }
else else if (!window_size_set_by_api)
{ {
if ((flags & ImGuiWindowFlags_AlwaysAutoResize) && !window_size_set_by_api) if (flags & ImGuiWindowFlags_AlwaysAutoResize)
{ {
window->SizeFull = size_auto_fit; window->SizeFull = size_auto_fit;
} }
else if ((window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0) && !window_size_set_by_api) else if (window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0)
{ {
// Auto-fit only grows during the first few frames // Auto-fit only grows during the first few frames
if (window->AutoFitFramesX > 0) if (window->AutoFitFramesX > 0)