Browse Source

node editor: push/pop imgui ID scopes when rendering nodes

This is a really bad, undefined-behavior hack.
we should hash or something?
or just use the index in the render ordering[1]

[1]: topological ordering of the render graph
master
gradient 8 years ago
parent
commit
c08bd3cfca
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/gui/node_editor.h

+ 4
- 0
src/gui/node_editor.h View File

@ -122,6 +122,9 @@ public:
for (const auto &node : nodeList) {
bool visible = viewportRect.intersects(node.bbox);
if (visible) {
// TODO: this is garbage
ImGui::PushID((void *)&node);
// -- Draw the node boxes
draw_list->ChannelsSetCurrent(0); // Switch to the background layer
@ -137,6 +140,7 @@ public:
// draw_list->AddCircleFilled(offset + position, 4.0f, ImColor(150, 150, 150, 150));
// }
ImGui::PopID();
}
}


Loading…
Cancel
Save