I'm trying to make the default examples work. Here is my main loop:
void main_loop(App &app) {
ImGui::Begin("node editor");
ImNodes::BeginNodeEditor();
const int hardcoded_node_id = 1;
ImNodes::BeginNode(hardcoded_node_id + 1);
ImNodes::BeginNodeTitleBar();
ImGui::TextUnformatted("node");
ImNodes::EndNodeTitleBar();
ImNodes::EndNode();
ImNodes::EndNodeEditor();
ImGui::End();
}
// Elsewhere:
while (glfwWindowShouldClose(window) != GLFW_TRUE) {
glfwPollEvents();
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
main_loop(app);
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
glfwSwapBuffers(window);
}
For some reason, the node rectangle gets expanded every loop by the padding value at
ImNodes::EndNode(); -> node.Rect.Expand(node.LayoutStyle.Padding); -> Rect gets 8 pixel added to Max.x every loop (but not Max.y)
I don't really understand why it is doing this. Should I create a context and destroy it every frame ? I'm not doing it for ImGui and the examples do not seem to do it as well.
ImGui version 1.19.1
imnodes from branch master commit b2ec254
I'm trying to make the default examples work. Here is my main loop:
For some reason, the node rectangle gets expanded every loop by the padding value at
I don't really understand why it is doing this. Should I create a context and destroy it every frame ? I'm not doing it for ImGui and the examples do not seem to do it as well.
ImGui version 1.19.1
imnodes from branch master commit b2ec254