Minor sizing refactor, should be no-op. Making it a commit for further bisection since sizing code is super brittle. (#668)

docking
ocornut 9 years ago
parent 102d03a7eb
commit 713730af0c

@ -3953,7 +3953,6 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us
window->SizeFull.x = window->AutoFitOnlyGrows ? ImMax(window->SizeFull.x, size_auto_fit.x) : size_auto_fit.x; window->SizeFull.x = window->AutoFitOnlyGrows ? ImMax(window->SizeFull.x, size_auto_fit.x) : size_auto_fit.x;
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;
window->Size = window->TitleBarRect().GetSize();
} }
else else
{ {
@ -3971,17 +3970,13 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us
if (!(flags & ImGuiWindowFlags_NoSavedSettings)) if (!(flags & ImGuiWindowFlags_NoSavedSettings))
MarkSettingsDirty(); MarkSettingsDirty();
} }
window->Size = window->SizeFull;
} }
// Minimum window size // Apply window size constraints and final size
if (!(flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_AlwaysAutoResize))) if (!(flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_AlwaysAutoResize)))
{
window->SizeFull = ImMax(window->SizeFull, style.WindowMinSize); window->SizeFull = ImMax(window->SizeFull, style.WindowMinSize);
if (!window->Collapsed) window->Size = window->Collapsed ? window->TitleBarRect().GetSize() : window->SizeFull;
window->Size = window->SizeFull;
}
// POSITION // POSITION
// Position child window // Position child window

Loading…
Cancel
Save