MultiSelect: Box-Select +Tables: fix usage of box-selection columns with items straying out of columns. (#7994, #2221)

Use 00d3f9295e.
+ Assets Browser toggle to enable ScrollX.
This commit is contained in:
ocornut
2026-04-20 11:07:45 +02:00
parent ea1c04f7ab
commit ac88294b4a
3 changed files with 19 additions and 5 deletions

View File

@@ -8358,8 +8358,15 @@ void ImGui::MultiSelectItemFooter(ImGuiID id, bool* p_selected, bool* p_pressed)
if (ms->BoxSelectId != 0)
if (ImGuiBoxSelectState* bs = GetBoxSelectState(ms->BoxSelectId))
{
const bool rect_overlap_curr = bs->BoxSelectRectCurr.Overlaps(g.LastItemData.Rect);
const bool rect_overlap_prev = bs->BoxSelectRectPrev.Overlaps(g.LastItemData.Rect);
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);
}
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))
{
if (storage->LastSelectionSize <= 0 && bs->IsStartedSetNavIdOnce)