GithubHelp home page GithubHelp logo

Comments (4)

ocornut avatar ocornut commented on May 20, 2024

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.

from imgui.

rayment avatar rayment commented on May 20, 2024

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 SetNextItemWidth.

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.mp4

It's happening to a lesser extent, but it's particularly noticeable when the width is increased.

from imgui.

rayment avatar rayment commented on May 20, 2024

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

from imgui.

rayment avatar rayment commented on May 20, 2024

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

from imgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.