From fddc8718702322d40fec530d6d9db1f9ba64f69c Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 30 Jul 2015 12:32:20 -0600 Subject: [PATCH] Columns: never assume horizontal space for scrollbar if NoScrollbar flag is set. --- imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 495cf294..16970f4f 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -8787,7 +8787,7 @@ float ImGui::GetColumnOffset(int column_index) const float t = window->DC.ColumnsOffsetsT[column_index]; const float min_x = window->DC.ColumnsStartX; - const float max_x = window->Size.x - (g.Style.ScrollbarWidth);// - window->WindowPadding().x; + const float max_x = window->Size.x - ((window->Flags & ImGuiWindowFlags_NoScrollbar) ? 0 : g.Style.ScrollbarWidth);// - window->WindowPadding().x; const float x = min_x + t * (max_x - min_x); return (float)(int)x; } @@ -8803,7 +8803,7 @@ void ImGui::SetColumnOffset(int column_index, float offset) const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(column_index); const float min_x = window->DC.ColumnsStartX; - const float max_x = window->Size.x - (g.Style.ScrollbarWidth);// - window->WindowPadding().x; + const float max_x = window->Size.x - ((window->Flags & ImGuiWindowFlags_NoScrollbar) ? 0 : g.Style.ScrollbarWidth);// - window->WindowPadding().x; const float t = (offset - min_x) / (max_x - min_x); window->DC.StateStorage->SetFloat(column_id, t); window->DC.ColumnsOffsetsT[column_index] = t;