rokups / ImNodes

Node graph implementation for Dear ImGui. Used in https://github.com/rokups/rbfx
MIT License
656 stars 57 forks source link

Table not rendering correctly #29

Closed flamendless closed 3 years ago

flamendless commented 3 years ago

The code

if (ImNodes::Ez::BeginNode(node, node->m_var_name, &node->m_pos, &node->m_selected))
{
  if (ImGui::BeginTable("test", 2))
  {
    ImGui::TableNextRow();
    ImGui::TableNextColumn();
    ImGui::Text("Name:");
    ImGui::Text("Value:");

    ImGui::TableNextColumn();
    ImGui::Text("%s", node->m_var_name);
    ImGui::Text("%s", node->m_var_value);

    ImGui::EndTable();
  }

  ImNodes::Ez::InputSlots(node->m_in_slots.data(), node->m_in_slots.size());  
  ImNodes::Ez::OutputSlots(node->m_out_slots.data(), node->m_out_slots.size());
  //more
  ImNodes::Ez::EndNode();
}

shows the screenshot below 2021-03-14_10-37

The use case is to cleanly show the names of the fields and the values of the fields in a tabular form.

sonoro1234 commented 3 years ago

flag ImGuiTableFlags_SizingFixedFit solves the issue for me

flamendless commented 3 years ago

Thank you! It works

flag ImGuiTableFlags_SizingFixedFit solves the issue for me