From 6ce4b44547387c2c968046a8e242eaf4abb0d7cc Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 9 Apr 2026 22:48:52 +0200 Subject: [PATCH] Mulit-Select: Box-Select: fixed an issue using in a table while relying on the TableNextColumn() return value to perform coarse clipping. (#7994) This is presumably not sufficient as MultiSelectAddSetRange() is also deficient there. --- docs/CHANGELOG.txt | 5 ++++- imgui_tables.cpp | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index cf57f093b..d17a6bee2 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -63,7 +63,10 @@ Other Changes: items out of view wouldn't be properly selected while scrolling while mouse cursor is hovering outside of selection scope. (#7994, #1861, #6518) - Box-Select: fixed an issue where items out of horizontal view would sometimes lead - to incorrect merging of sequential selection requests. (#7994, #1861, #6518) + to incorrect merging of sequential selection requests while also scrolling fast + enough to overlap multiple rows during a frame. (#7994, #1861, #6518) + - Box-Select: fixed an issue using ImGuiMultiSelectFlags_BoxSelect2d mode in a Table + while relying on the TableNextColumn() return value to perform coarse clipping. (#7994) - Fonts: - imgui_freetype: add FreeType headers & compiled version in 'About Dear ImGui' details. - Clipper: diff --git a/imgui_tables.cpp b/imgui_tables.cpp index f8450fbb1..38421af94 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -1152,6 +1152,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) column->ClipRect.Min.y = work_rect.Min.y; column->ClipRect.Max.x = column->MaxX; //column->WorkMaxX; column->ClipRect.Max.y = FLT_MAX; + ImRect clip_rect_unclipped = column->ClipRect; column->ClipRect.ClipWithFull(host_clip_rect); // Mark column as Clipped (not in sight) @@ -1169,6 +1170,9 @@ void ImGui::TableUpdateLayout(ImGuiTable* table) // Mark column as requesting output from user. Note that fixed + non-resizable sets are auto-fitting at all times and therefore always request output. column->IsRequestOutput = is_visible || column->AutoFitQueue != 0 || column->CannotSkipItemsQueue != 0; + ImGuiBoxSelectState* bs = &g.BoxSelectState; + if (!column->IsRequestOutput && bs->UnclipMode && bs->UnclipRect.Overlaps(clip_rect_unclipped)) + column->IsRequestOutput = true; // Mark column as SkipItems (ignoring all items/layout) // (table->HostSkipItems is a copy of inner_window->SkipItems before we cleared it above in Part 2)