diff --git a/imgui.cpp b/imgui.cpp index 188b53d45..1d2364669 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -13349,7 +13349,7 @@ static void ImGui::NavProcessItem() const ImGuiID id = g.LastItemData.ID; const ImGuiItemFlags item_flags = g.LastItemData.ItemFlags; - // When inside a container that isn't scrollable with Left<>Right, clip NavRect accordingly (#2221, #8816) + // When inside a container that isn't scrollable with Left<>Right, clip NavRect accordingly (#2221, #8816, #7994) ImRect nav_bb = g.LastItemData.NavRect; if (window->DC.NavIsScrollPushableX == false) { diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 9eb007621..d26e407da 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -8359,12 +8359,16 @@ void ImGui::MultiSelectItemFooter(ImGuiID id, bool* p_selected, bool* p_pressed) if (ImGuiBoxSelectState* bs = GetBoxSelectState(ms->BoxSelectId)) { ImRect item_rect = g.LastItemData.Rect; - if (!window->DC.NavIsScrollPushableX) - { - const ImRect& clip_rect = (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HasClipRect) ? g.LastItemData.ClipRect : window->ClipRect; - item_rect.Min.x = ImMax(item_rect.Min.x, clip_rect.Min.x); - item_rect.Max.x = ImMin(item_rect.Max.x, clip_rect.Max.x); - } + if (!window->DC.NavIsScrollPushableX) // FIXME: Rename to be more generic. + if (ImGuiTable* table = g.CurrentTable) + if (table->CurrentColumn != -1) + { + // FIXME: We cannot use current ClipRect as it includes HostClipRect. + // A more generic version would be nice, but window->WorkRect.Min/Max exclude CellPadding. (#7994) + ImGuiTableColumn* column = &table->Columns[table->CurrentColumn]; + item_rect.Min.x = ImMax(item_rect.Min.x, column->MinX); + item_rect.Max.x = ImMin(item_rect.Max.x, column->MaxX); + } const bool rect_overlap_curr = bs->BoxSelectRectCurr.Overlaps(item_rect); const bool rect_overlap_prev = bs->BoxSelectRectPrev.Overlaps(item_rect); if ((rect_overlap_curr && !rect_overlap_prev && !selected) || (rect_overlap_prev && !rect_overlap_curr))