mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
MultiSelect: Simplified ImGuiSelectionBasicStorage by using a single SetItemSelected() entry point.
This commit is contained in:
parent
f36a03c317
commit
dbc67bbf23
3 changed files with 14 additions and 16 deletions
|
|
@ -7744,11 +7744,11 @@ void ImGuiSelectionBasicStorage::ApplyRequests(ImGuiMultiSelectIO* ms_io, int it
|
|||
{
|
||||
Storage.Data.reserve(items_count);
|
||||
for (int idx = 0; idx < items_count; idx++)
|
||||
AddItem(AdapterIndexToStorageId(this, idx));
|
||||
SetItemSelected(AdapterIndexToStorageId(this, idx), true);
|
||||
}
|
||||
if (req.Type == ImGuiSelectionRequestType_SetRange)
|
||||
for (int idx = (int)req.RangeFirstItem; idx <= (int)req.RangeLastItem; idx++)
|
||||
UpdateItem(AdapterIndexToStorageId(this, idx), req.Selected);
|
||||
SetItemSelected(AdapterIndexToStorageId(this, idx), req.Selected);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue