Fix SetNextWindowContentSize() with 0.0f on Y axis (or SetNextWindowContentWidth()) overwriting the contents size. Broken in eab6333a0b. (#1363)

This commit is contained in:
omar 2018-01-25 15:37:24 +01:00
parent 8bf0c89c0d
commit 5d31e1696f

View File

@ -4544,6 +4544,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
{ {
// Adjust passed "client size" to become a "window size" // Adjust passed "client size" to become a "window size"
window->SizeContentsExplicit = g.NextWindowData.ContentSizeVal; window->SizeContentsExplicit = g.NextWindowData.ContentSizeVal;
if (window->SizeContentsExplicit.y != 0.0f)
window->SizeContentsExplicit.y += window->TitleBarHeight() + window->MenuBarHeight(); window->SizeContentsExplicit.y += window->TitleBarHeight() + window->MenuBarHeight();
g.NextWindowData.ContentSizeCond = 0; g.NextWindowData.ContentSizeCond = 0;
} }