MultiSelect: added ImGuiSelectionBasicStorage::GetStorageIdFromIndex() indirection to be easier on the reader.

Tempting to make it a virtual.
This commit is contained in:
ocornut
2024-07-18 18:19:20 +02:00
parent ab995d3d4f
commit c94cf6f01f
3 changed files with 9 additions and 8 deletions
+2 -2
View File
@@ -7846,11 +7846,11 @@ void ImGuiSelectionBasicStorage::ApplyRequests(ImGuiMultiSelectIO* ms_io)
{
Storage.Data.reserve(ms_io->ItemsCount);
for (int idx = 0; idx < ms_io->ItemsCount; idx++)
SetItemSelected(AdapterIndexToStorageId(this, idx), true);
SetItemSelected(GetStorageIdFromIndex(idx), true);
}
if (req.Type == ImGuiSelectionRequestType_SetRange)
for (int idx = (int)req.RangeFirstItem; idx <= (int)req.RangeLastItem; idx++)
SetItemSelected(AdapterIndexToStorageId(this, idx), req.Selected);
SetItemSelected(GetStorageIdFromIndex(idx), req.Selected);
}
}