From 9e281c12a8b62d6262494669d560bf876209e632 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 14 Jan 2021 17:41:00 +0100 Subject: [PATCH] Tables: Fixed very small tables edge cases: inverted clip rect with freezing + scroll, missing borders. --- imgui_tables.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui_tables.cpp b/imgui_tables.cpp index 2841b6e8..a0317744 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -1010,7 +1010,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) } if (visible_n < table->FreezeColumnsCount) - host_clip_rect.Min.x = ImMax(host_clip_rect.Min.x, column->MaxX + TABLE_BORDER_SIZE); + host_clip_rect.Min.x = ImClamp(column->MaxX + TABLE_BORDER_SIZE, host_clip_rect.Min.x, host_clip_rect.Max.x); offset_x += column->WidthGiven + table->CellSpacingX1 + table->CellSpacingX2 + table->CellPaddingX * 2.0f; visible_n++; @@ -2344,7 +2344,7 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table) void ImGui::TableDrawBorders(ImGuiTable* table) { ImGuiWindow* inner_window = table->InnerWindow; - if (inner_window->Hidden || !table->HostClipRect.Overlaps(table->InnerClipRect)) + if (!table->OuterWindow->ClipRect.Overlaps(table->OuterRect)) return; ImDrawList* inner_drawlist = inner_window->DrawList;