diff --git a/src/gui/node_editor.h b/src/gui/node_editor.h index 921ea05..d011840 100644 --- a/src/gui/node_editor.h +++ b/src/gui/node_editor.h @@ -92,6 +92,7 @@ public: ImVec2 offset = canvas_pos - scrolling; // TODO: add scrolling // -- Draw the grid + draw_list->ChannelsSetCurrent(0); if (show_grid) { ImVec2 local_offset = ImGui::GetCursorPos() - scrolling; @@ -105,6 +106,17 @@ public: ImVec2(canvas_size.x, y)+canvas_pos, color); } + + draw_list->ChannelsSetCurrent(0); + for (const auto &edge : edgeList) { + auto head = offset + edge.lhs->slot_location(GuiNode::OUT, edge.fromSlot); + auto tail = offset + edge.rhs->slot_location(GuiNode::IN, edge.fromSlot); + + draw_list->AddBezierCurve(head, head+ImVec2(50, 0), + tail+ImVec2(-50, 0), tail, + ImColor(200, 200, 200), 3.0f); + } + Rect viewportRect = Rect(scrolling, canvas_size); for (const auto &node : nodeList) {