From 63aa035f591eea5b06ad05e4d2ede19c35412ffb Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 24 May 2015 23:25:57 +0100 Subject: [PATCH] WIP Menus: Fixed estimation of scrollbar width (broke in 292f08b11e6c62a453d447231b9ca155a06e03f3) (#126) --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 0783ebe8d..866dffa31 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3497,7 +3497,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_ else { size_auto_fit = ImClamp(window->SizeContents + window_padding, style.WindowMinSize, ImMax(style.WindowMinSize, g.IO.DisplaySize - window_padding)); - if (size_auto_fit.y + style.ItemSpacing.y < window->SizeContents.y && !(flags & ImGuiWindowFlags_NoScrollbar)) + if (size_auto_fit.y < window->SizeContents.y && !(flags & ImGuiWindowFlags_NoScrollbar)) size_auto_fit.x += style.ScrollbarWidth; size_auto_fit.y = ImMax(size_auto_fit.y - style.ItemSpacing.y, 0.0f); }