From dcf0d8cab68bcf90156077211740836d95d683ad Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 22 Apr 2025 18:34:56 +0200 Subject: [PATCH] Tables: fixed TableHeader() eager vertical clipping of text. (#6236) --- docs/CHANGELOG.txt | 2 ++ imgui_tables.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index d78e8104f..a3892a06b 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -76,6 +76,8 @@ Other changes: - The feature is unlikely to ever work properly when using a coarse clipper such as ImGuiListClipper. - TreeNode: fixed incorrect clipping of arrow/bullet when using ImGuiTreeNodeFlags_SpanAllColumns. +- Tables: fixed TableHeader() eager vertical clipping of text which may be noticeable + with FramePadding.y was too small. (#6236) - Tabs: fixes small issues with how "..." ellipsis moved depending on visibility of Close Button or Unsaved Document marker. (#8387) - Nav: fixed assertion when holding gamepad FaceLeft/West button to open diff --git a/imgui_tables.cpp b/imgui_tables.cpp index 077d54b14..6a84dba36 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -3275,7 +3275,7 @@ void ImGui::TableHeader(const char* label) // Render clipped label. Clipping here ensure that in the majority of situations, all our header cells will // be merged into a single draw call. //window->DrawList->AddCircleFilled(ImVec2(ellipsis_max, label_pos.y), 40, IM_COL32_WHITE); - RenderTextEllipsis(window->DrawList, label_pos, ImVec2(ellipsis_max, label_pos.y + label_height + g.Style.FramePadding.y), ellipsis_max, label, label_end, &label_size); + RenderTextEllipsis(window->DrawList, label_pos, ImVec2(ellipsis_max, bb.Max.y), ellipsis_max, label, label_end, &label_size); const bool text_clipped = label_size.x > (ellipsis_max - label_pos.x); if (text_clipped && hovered && g.ActiveId == 0)