浏览代码

Tables: fixed assert/issues loading settings. (#8496, #7934)

Not sure what I did with 05742f9b6ff but I missed on the primary filter.
ocornut 4 月之前
父节点
当前提交
cfed7a3a54
共有 2 个文件被更改,包括 7 次插入3 次删除
  1. 4 0
      docs/CHANGELOG.txt
  2. 3 3
      imgui_tables.cpp

+ 4 - 0
docs/CHANGELOG.txt

@@ -43,6 +43,10 @@ Breaking changes:
 
 Other changes:
 
+- Tables: Fixed assert when loading .ini settings of reordered columns. (#8496, #7934)
+- Tables: Fixed issues when loading .ini settings for a table with columns using
+  ImGuiTableColumnFlags_DefaultHide or ImGuiTableColumnFlags_DefaultSort. (#8496, #7934)
+
 
 -----------------------------------------------------------------------
  VERSION 1.91.9 (Released 2025-03-14)

+ 3 - 3
imgui_tables.cpp

@@ -1638,9 +1638,9 @@ void ImGui::TableSetupColumn(const char* label, ImGuiTableColumnFlags flags, flo
     column->InitStretchWeightOrWidth = init_width_or_weight;
     if (table->IsInitializing)
     {
-        ImGuiTableFlags init_flags = ~0;
-        if (column->WidthRequest >= 0.0f || column->StretchWeight >= 0.0f)
-            init_flags &= ~ImGuiTableFlags_Resizable;
+        ImGuiTableFlags init_flags = ~table->SettingsLoadedFlags;
+        if (column->WidthRequest < 0.0f && column->StretchWeight < 0.0f)
+            init_flags |= ImGuiTableFlags_Resizable;
         TableInitColumnDefaults(table, column, init_flags);
     }