From 2c7ba21417dbc82e277e223e556e5a29a0674798 Mon Sep 17 00:00:00 2001 From: omar Date: Tue, 7 Nov 2017 11:37:38 +0100 Subject: [PATCH] Fixed auto-resize allocating too much space for scrollbar when SizeContents is bigger than maximum window size (fixes c0547d358d746699f8d46a4996e49fdac8c55748) (#1417) --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 9c9e7b12..d762910a 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4039,7 +4039,7 @@ static ImVec2 CalcSizeAutoFit(ImGuiWindow* window) if (size_auto_fit_after_constraint.x < window->SizeContents.x && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar)) size_auto_fit.y += style.ScrollbarSize; if (size_auto_fit_after_constraint.y < window->SizeContents.y && !(flags & ImGuiWindowFlags_NoScrollbar)) - size_auto_fit.x += style.ScrollbarSize * 2.0f; + size_auto_fit.x += style.ScrollbarSize; size_auto_fit.y = ImMax(size_auto_fit.y - style.ItemSpacing.y, 0.0f); } return size_auto_fit;