Closed przemkovv closed 4 years ago
Found this appearing in my setup too:
Version/Branch of Dear ImGui:
Version: 1.76 WIP Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_dx11.cpp + imgui_impl_win32.cpp Operating System: Windows 10 Home
ImGui::Begin("Test");
static bool test = false;
ImGui::PushStyleVar(ImGuiStyleVar_SelectableTextAlign, ImVec2(0.5f, 0.5f));
ImGui::Selectable("Test", &test, 0, ImVec2(80,10));
ImGui::PopStyleVar();
ImGui::End();
ImGui::Begin("Test");
static bool test = false;
ImGui::PushStyleVar(ImGuiStyleVar_SelectableTextAlign, ImVec2(0.5f, 0.5f));
ImGui::Selectable("Test", &test);
ImGui::PopStyleVar();
ImGui::End();
The two overloads for Selectable() behave differently. The one with the bool* selected parameter is working as expected
Hello @przemkovv, @IronicallySerious,
Sorry for my late answer. This should be fixed now. (it's not merged in Docking right away but will be soon). It was an issue in the initial commit from #2347.
Thanks!
I'm currently working on Selectable() and cleaning a few confusing things that have been accumulating over time (pushed 3 small commits already). Some other changes incoming to fix issues dealing with multiple columns spanning in Tables/Columns api.
Version/Branch of Dear ImGui:
Version: 1.69
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp Operating System: Windows
My Issue/Question:
ImGui::Selectable
suppose to support aligning the label. IfImGuiStyleVar_SelectableTextAlign
style is set toImVec2(0.5f, 0.5f)
, the text should be centered. Unfortunately, the style value is "indirectly" ignored.I think, that
bb_inner
in theImGui::Selectable
function is wrongly computed, as it stores the size of text, not the widget. In the result,RenderTextClipped
has no room to operate. If I replacebb_inner
in the call withbb
, it works as expected.Screenshots/Video
That it looks now:
Expected result:
Standalone, minimal, complete and verifiable example: