Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reordered table columns results in assert when restoring from ini #8496

Closed
bear24rw opened this issue Mar 17, 2025 · 5 comments
Closed

Reordered table columns results in assert when restoring from ini #8496

bear24rw opened this issue Mar 17, 2025 · 5 comments
Labels

Comments

@bear24rw
Copy link
Contributor

bear24rw commented Mar 17, 2025

Version/Branch of Dear ImGui:

v1.91.9-docking

Back-ends:

imgui_impl_glfw.cpp + imgui_impl_metal.cpp

Compiler, OS:

macOS + clang

  1. Open Tables & Columns > Reorderable, hidable, with headers
  2. Reorder the columns
  3. Quit the app
  4. Re-launch the app
  5. Try to go back to that section in the demo window
  6. Hit this assert:

Assertion failed: (column->IndexWithinEnabledSet <= column->DisplayOrder), function TableUpdateLayout, file imgui_tables.cpp, line 879.

@ocornut
Copy link
Owner

ocornut commented Mar 17, 2025

Caused by the changes for #7934 (cc @lailoken)
Will likely publish a hotfix release once I finish investigating/fixing.

Thanks for reporting !

ocornut added a commit that referenced this issue Mar 17, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@ocornut
Copy link
Owner

ocornut commented Mar 17, 2025

@bear24rw

You may try this, in TableSetupColumn():

    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;
        TableInitColumnDefaults(table, column, init_flags);
    }

@bear24rw
Copy link
Contributor Author

That works, thanks!

ocornut added a commit that referenced this issue Mar 17, 2025
Not sure what I did with 05742f9 but I missed on the primary filter.
@ocornut
Copy link
Owner

ocornut commented Mar 17, 2025

Pushed fix and published a release for it.

@bear24rw
Copy link
Contributor Author

Awesome, thanks for the quick turn around!

@ocornut ocornut closed this as completed Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants