mirror of
https://github.com/ocornut/imgui.git
synced 2025-10-21 17:31:45 +00:00
MultiSelect: Simplified ImGuiSelectionBasicStorage by using a single SetItemSelected() entry point.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user