-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Tables: SizingFixedFit flag not honored correctly for synched tables (widths of one bleeds into next one) #7218
Comments
As a new user of ImGui, I thought I was going insane |
The issue here appears because they are tables sharing the same identifier. If I change the code to use: if (ImGui::BeginTable("test_table", 2, ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit))
[...]
if (ImGui::BeginTable("test_table2", 2, ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit)) Then it works as expected. So effectively it is a bug in the feature that allows to share table settings between two tables. Read the FAQ Entry about ID Stack System if you need to submit many tables in a loop and you want them to have unique ids, then you can use e.g. |
This is exactly what i wanted |
I can't answer for OP, but at least in my case
This is exactly what I wanted. I am having the tables be children of treenodes (via TreeNodeEx with NoPush), with all tables being the same tree depth. The tables do not have borders (it just looks like columns of text), and I was aiming for the columns to have the same positioning. |
I have pushed a fix for this d3c3514 |
Pushed test for this too: |
Unfortunately, having updated the codebase that I was experiencing this issue in to v1.90.5, the issue remains. The only notable difference from OP's original issue, is for me, the short text is in the first table and the long text is in the second table. I'll see if simply reordering the rows from OP's MCVE is enough to reproduce it, and if so, report back here. |
Sorry for my late reaction! Hopefully this is right this time! |
Version/Branch of Dear ImGui:
Version 1.90.1, Branch: master
Back-ends:
imgui_impl_dx11.cpp
Compiler, OS:
Windows 11 + MSVC 2022
Full config/build information:
No response
Details:
My Issue/Question:
When I use ImGuiTableFlags_SizingFixedFit without ImGuiTableFlags_Resizable, table columns are not synchronized and have different widths. It appears as if the widths are swapped between the first and second table.
The expected behavior is to have both tables with the same width of first column adjusted to fit the text "Very very long text 1"
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: