-
Notifications
You must be signed in to change notification settings - Fork 57
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
Separator/CollapsingHeader exceeds node's width #30
Comments
It seems that the same is happening in Nelarius/imnodes: https://github.com/Nelarius/imnodes/tree/ee6d4071eef5d253e6402e488e93f64208ae195a#known-issues What happens if everything is inside a Table? |
It doesn't get drawn properly. if (ImGui::BeginTable("TableNode##NodeVar", 2, ImGuiTableFlags_SizingFixedFit))
{
ImGui::Separator(); //this doesnt get drawn
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Separator(); //this is drawn but it exceeds the node size as well
ImGui::Text("Name:");
ImGui::Text("Value:");
ImGui::TableNextColumn();
ImGui::Text("%s", m_name);
if (m_value)
m_value->draw();
else
m_value_orig.draw();
ImGui::EndTable();
} |
I'm also seeing this when using a table inside a Node: Just this code in a node: static ImGuiTableFlags flags = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_Resizable | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_ContextMenuInBody | ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY;
if (ImGui::BeginTable("table1", 3, flags))
{
for (int row = 0; row < 3; row++)
{
ImGui::TableNextRow();
for (int column = 0; column < 3; column++)
{
ImGui::TableSetColumnIndex(column);
ImGui::Text("Hello %d,%d", column, row);
}
}
ImGui::EndTable();
} |
This needs some inside ImGui perspective. I think it might be caused by the fact that item space is provided by a window and a Node is not a window. See here for the separator: It jus gets the max width from the underlying window. When we're in a node this should be the max width of the node. Perhaps we need to register nodes as a window? |
A workaround might be to wrap the widgets which exceed the width inside a BeginChild()/EndChild() |
results to
More testing shows that anywhere the ImGui::Separator() is called as long as inside the
ImNodes::Ez::BeginNode
andImNodes::Ez::EndNode
it results to the same problemThe text was updated successfully, but these errors were encountered: