From 510eb8f4801adf5096cebe5f15700625d0d9357d Mon Sep 17 00:00:00 2001 From: prabu Date: Sat, 11 May 2024 18:26:45 +0530 Subject: [PATCH] Tables: fixed cell background of fully clipped row overlapping with header. (#7575, #7041) --- docs/CHANGELOG.txt | 2 ++ imgui_tables.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 07fc7bee..150dde53 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -43,6 +43,8 @@ Breaking changes: Other changes: +- Tables: fixed cell background of fully clipped row overlapping with header. (#7575, #7041) [@prabuinet] + ----------------------------------------------------------------------- VERSION 1.90.6 (Released 2024-05-08) diff --git a/imgui_tables.cpp b/imgui_tables.cpp index 11e0d2de..d4a1fa3a 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -1963,7 +1963,8 @@ void ImGui::TableEndRow(ImGuiTable* table) cell_bg_rect.ClipWith(table->BgClipRect); cell_bg_rect.Min.x = ImMax(cell_bg_rect.Min.x, column->ClipRect.Min.x); // So that first column after frozen one gets clipped when scrolling cell_bg_rect.Max.x = ImMin(cell_bg_rect.Max.x, column->MaxX); - window->DrawList->AddRectFilled(cell_bg_rect.Min, cell_bg_rect.Max, cell_data->BgColor); + if (cell_bg_rect.Min.y < cell_bg_rect.Max.y) + window->DrawList->AddRectFilled(cell_bg_rect.Min, cell_bg_rect.Max, cell_data->BgColor); } }