From f0b493c217ada01479f654a0d5b06b4e01d3d455 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 13 Jan 2015 23:05:20 +0000 Subject: [PATCH] Fixed style.WindowMinSize not honored properly. --- imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index cb82d9d7..b66f5f17 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2395,13 +2395,13 @@ bool ImGui::Begin(const char* name, bool* p_opened, ImVec2 size, float fill_alph // Clamp into view if (!(window->Flags & ImGuiWindowFlags_ChildWindow)) { - const ImVec2 pad = ImVec2(window->FontSize()*2.0f, window->FontSize()*2.0f); + const ImVec2 pad = ImVec2(window->FontSize()*2.0f, window->FontSize()*2.0f); // FIXME: Parametrize of clarify this behavior. if (g.IO.DisplaySize.x > 0.0f && g.IO.DisplaySize.y > 0.0f) // Ignore zero-sized display explicitly to avoid losing positions if a window manager reports zero-sized window when initializing or minimizing. { window->PosFloat = ImMax(window->PosFloat + window->Size, pad) - window->Size; window->PosFloat = ImMin(window->PosFloat, ImVec2(g.IO.DisplaySize.x, g.IO.DisplaySize.y) - pad); } - window->SizeFull = ImMax(window->SizeFull, pad); + window->SizeFull = ImMax(window->SizeFull, style.WindowMinSize); } window->Pos = ImVec2((float)(int)window->PosFloat.x, (float)(int)window->PosFloat.y);