MultiSelect: Box-Select + Clipper: extend UnclipRect by ItemSpacing. (#7994, #8250, #7821, #7850, #7970)

Amend 1ac469b50f
This commit is contained in:
ocornut
2026-04-16 23:32:34 +02:00
parent 2cbdb7a337
commit a2916923a1
3 changed files with 9 additions and 5 deletions

View File

@@ -74,7 +74,9 @@ Other Changes:
and ImGuiSelectionUserData is technically opaque storage. (#7994, #1861)
(we will probably bring this back as a minor optimization if we have a way to for
user to tell us ImGuiSelectionUserData are indices)
- Box-Select, Tables: fixed an issue when calling `BeginMultiSelect()` in a table
- Box-Select + Clipper: fixed an issue selecting items while scrolling while a clipper
active. (#7994, #8250, #7821, #7850, #7970)
- Box-Select + Tables: fixed an issue when calling `BeginMultiSelect()` in a table
before layout has been locked (first row or headers row submitted). (#8250)
- Style:
- Fixed vertical scrollbar top coordinates when using thick borders on windows

View File

@@ -3454,12 +3454,14 @@ static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
// FIXME: Selectable() use of half-ItemSpacing isn't consistent in matter of layout, as ItemAdd(bb) stray above ItemSize()'s CursorPos.
// RangeSelect's BoxSelect relies on comparing overlap of previous and current rectangle and is sensitive to that.
// As a workaround we currently half ItemSpacing worth on each side.
min_y -= g.Style.ItemSpacing.y;
max_y += g.Style.ItemSpacing.y;
float pad_y = g.Style.ItemSpacing.y;
min_y -= pad_y;
max_y += pad_y;
// Box-select on 2D area requires different clipping.
// (best adding pad_y here than in BeginBoxSelect() as we are closer to current state)
if (bs->UnclipMode)
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(bs->UnclipRect.Min.y, bs->UnclipRect.Max.y, 0, 0));
data->Ranges.push_back(ImGuiListClipperRange::FromPositions(bs->UnclipRect.Min.y - pad_y, bs->UnclipRect.Max.y + pad_y, 0, 0));
}
// Add main visible range

View File

@@ -30,7 +30,7 @@
// Library Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
#define IMGUI_VERSION "1.92.8 WIP"
#define IMGUI_VERSION_NUM 19272
#define IMGUI_VERSION_NUM 19273
#define IMGUI_HAS_TABLE // Added BeginTable() - from IMGUI_VERSION_NUM >= 18000
#define IMGUI_HAS_TEXTURES // Added ImGuiBackendFlags_RendererHasTextures - from IMGUI_VERSION_NUM >= 19198