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
Combo jitters inside Table when _SizingStretchProp is set #7445
Comments
You have a feedback loop using “ imgui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);” which uses the column width for the framed part of the combo, and the column itself measuring its contents to set its width proportional to contents to both columns. Unfortunately one of those parameters would need to be altered. |
Hi Omar, thanks for getting back to me. What you say makes perfect sense, though unfortunately this issue occurs even without the second row with ImGui::Begin("window");
ImGui::BeginTable("table_broken", 2, ImGuiTableFlags_SizingStretchProp);
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
ImGui::Text("broken");
ImGui::TableSetColumnIndex(1);
if (ImGui::BeginCombo("##combo", "this table jitters"))
ImGui::EndCombo();
ImGui::EndTable();
ImGui::BeginTable("table_working", 2, ImGuiTableFlags_SizingStretchProp);
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
ImGui::Text("working");
ImGui::TableSetColumnIndex(1);
ImGui::Text("but this table is fine");
ImGui::EndTable();
ImGui::End(); This is the same code as above, just without the second row. I get the following happening: simplescreenrecorder-2024-03-28_22.30.40.mp4It's happening to a lesser extent, but it's particularly noticeable when the width is increased. |
Actually it's pretty noticeable when I extend the window further: The right extent of the Combo moves smoothly, it's entirely the left extent that is shifting every 2nd or so frame, resulting in the jittering effect. simplescreenrecorder-2024-03-28_22.39.05.mp4 |
I can confirm it happens on Windows as well. On my 165Hz monitor it's a lot smoother but it still happens. arc_IEa2KMBRTG.mp4 |
Version/Branch of Dear ImGui:
1.90.4 (master)
Back-ends:
imgui_impl_sdl2.cpp + imgui_impl_opengl3.cpp
Compiler, OS:
Linux 6.1.67-gentoo-x86_64 #1 SMP PREEMPT_DYNAMIC + gcc version 13.2.1 20240210 + KDE 5.115.0
Full config/build information:
Details:
My Issue/Question:
I'm building out a GUI with a nested TabBar > TabItem > Child > Table and noticed that as soon as I started using
ImGuiTableFlags_SizingStretchProp
to nicely separate my left text column from my right content column and stretch it, any time I was using a Combo in one of my tabs, the entire column would start to jitter when I resize the window.I have reduced this to an MCVE and I believe it is easily viewable in the attached video.
You will see that when the containing window is resized, if the column contains a Combo, it will jitter back and forth from the leftmost/start of X point.
If it has anything to do with my platform, I will have you know the following:
It's late here now - I might test this tomorrow on my 165Hz monitor running Windows 10 to check if it's a cross-platform issue.
I've tested this with Buttons and Text and am not seeing the same issue arise with them.
Screenshots/Video:
simplescreenrecorder-2024-03-27_22.43.42.mp4
Minimal, Complete and Verifiable Example code:
This is the code used in the video above.
Though please take the word 'broken' very lightly - ImGui is a wonderful piece of software and it's certainly better than anything I could ever release.
The text was updated successfully, but these errors were encountered: