From 5d31e1696f83601ae1b323dc4e51d532c4eb238a Mon Sep 17 00:00:00 2001 From: omar Date: Thu, 25 Jan 2018 15:37:24 +0100 Subject: [PATCH] Fix SetNextWindowContentSize() with 0.0f on Y axis (or SetNextWindowContentWidth()) overwriting the contents size. Broken in eab6333a0b96bd30413bb17408303a5df438ffde. (#1363) --- imgui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index b5aa30e1f..076eb4b5c 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4544,7 +4544,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) { // Adjust passed "client size" to become a "window size" window->SizeContentsExplicit = g.NextWindowData.ContentSizeVal; - window->SizeContentsExplicit.y += window->TitleBarHeight() + window->MenuBarHeight(); + if (window->SizeContentsExplicit.y != 0.0f) + window->SizeContentsExplicit.y += window->TitleBarHeight() + window->MenuBarHeight(); g.NextWindowData.ContentSizeCond = 0; } else if (first_begin_of_the_frame)