瀏覽代碼

MultiSelect: Fixed ImGuiSelectionBasicStorage::ApplyRequests() incorrectly maintaining selection size on SelectAll.

ocornut 1 年之前
父節點
當前提交
6c4bf8e56e
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      imgui_widgets.cpp

+ 1 - 1
imgui_widgets.cpp

@@ -7730,7 +7730,7 @@ void ImGuiSelectionBasicStorage::ApplyRequests(ImGuiMultiSelectIO* ms_io, int it
             Clear();
         if (req.Type == ImGuiSelectionRequestType_SelectAll)
         {
-            Storage.Data.resize(0);
+            Clear();
             Storage.Data.reserve(items_count);
             for (int idx = 0; idx < items_count; idx++)
                 AddItem(AdapterIndexToStorageId(this, idx));