Fix window size after collapsing (broken 376a6a5af0)

docking
ocornut 10 years ago
parent 7fac4013a4
commit 81bf614821

@ -3349,7 +3349,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
if (g.HoveredWindow == window && held && g.IO.MouseDoubleClicked[0]) if (g.HoveredWindow == window && held && g.IO.MouseDoubleClicked[0])
{ {
// Manual auto-fit when double-clicking // Manual auto-fit when double-clicking
window->Size = window->SizeFull = size_auto_fit; window->SizeFull = size_auto_fit;
if (!(window->Flags & ImGuiWindowFlags_NoSavedSettings)) if (!(window->Flags & ImGuiWindowFlags_NoSavedSettings))
MarkSettingsDirty(); MarkSettingsDirty();
SetActiveId(0); SetActiveId(0);
@ -3357,10 +3357,12 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
else if (held) else if (held)
{ {
// Resize // Resize
window->Size = window->SizeFull = ImMax(window->SizeFull + g.IO.MouseDelta, style.WindowMinSize); window->SizeFull = ImMax(window->SizeFull + g.IO.MouseDelta, style.WindowMinSize);
if (!(window->Flags & ImGuiWindowFlags_NoSavedSettings)) if (!(window->Flags & ImGuiWindowFlags_NoSavedSettings))
MarkSettingsDirty(); MarkSettingsDirty();
} }
window->Size = window->SizeFull;
title_bar_rect = window->TitleBarRect(); title_bar_rect = window->TitleBarRect();
} }

Loading…
Cancel
Save