Skip to content

Tables: SizingFixedFit flag not honored correctly for synched tables (widths of one bleeds into next one) #7218

Closed
@Ifry

Description

@Ifry

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:

            ImGui::Begin("Synced tables test");

            if (ImGui::BeginTable("test_table", 2, ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit))
            {
                ImGui::TableNextColumn();
                ImGui::Text("Very very long text 1");

                ImGui::TableNextColumn();
                ImGui::Text("Text 1");

                ImGui::TableNextColumn();
                ImGui::Text("Very very long text 2");

                ImGui::TableNextColumn();
                ImGui::Text("Text 2");

                ImGui::EndTable();
            }

            if (ImGui::BeginTable("test_table", 2, ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit))
            {
                ImGui::TableNextColumn();
                ImGui::Text("Text 1");

                ImGui::TableNextColumn();
                ImGui::Text("Text 2");

                ImGui::TableNextColumn();
                ImGui::Text("Text 1");

                ImGui::TableNextColumn();
                ImGui::Text("Text 2");

                ImGui::EndTable();
            }

            ImGui::End();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions