From 6eed3dc7c8ff4f6fdaa8019cc1038314debceeee Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 30 Aug 2015 17:46:02 +0100 Subject: [PATCH] GetContentRegionMax() when window content size is explicit we don't adjust it with scrollbar sizes (#246) --- imgui.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index d61eecba..e00b1953 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4593,13 +4593,10 @@ void ImGui::SetNextWindowFocus() ImVec2 ImGui::GetContentRegionMax() { ImGuiWindow* window = GetCurrentWindowRead(); - ImVec2 content_region_size = ImVec2(window->SizeContentsExplicit.x ? window->SizeContentsExplicit.x : window->Size.x, window->SizeContentsExplicit.y ? window->SizeContentsExplicit.y : window->Size.y); + ImVec2 content_region_size = ImVec2(window->SizeContentsExplicit.x ? window->SizeContentsExplicit.x : window->Size.x - window->ScrollbarSizes.x, window->SizeContentsExplicit.y ? window->SizeContentsExplicit.y : window->Size.y - window->ScrollbarSizes.y); ImVec2 mx = content_region_size - window->Scroll - window->WindowPadding; if (window->DC.ColumnsCount != 1) mx.x = ImGui::GetColumnOffset(window->DC.ColumnsCurrent + 1) - window->WindowPadding.x; - else - mx.x -= window->ScrollbarSizes.x; - mx.y -= window->ScrollbarSizes.y; return mx; }