mirror of
https://github.com/Drezil/imgui.git
synced 2025-04-18 17:14:00 +00:00
Fix window size after collapsing (broken 376a6a5af0f7b6421c63ca7e0e07d133447d34e7)
This commit is contained in:
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…
x
Reference in New Issue
Block a user