MCPcopy Create free account
hub / github.com/Nelarius/imnodes / NodeLineHandler

Function NodeLineHandler

imnodes.cpp:3013–3029  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3011namespace
3012{
3013void NodeLineHandler(ImNodesEditorContext& editor, const char* const line)
3014{
3015 int id;
3016 int x, y;
3017 if (sscanf(line, "[node.%i", &id) == 1)
3018 {
3019 const int node_idx = ObjectPoolFindOrCreateIndex(editor.Nodes, id);
3020 GImNodes->CurrentNodeIdx = node_idx;
3021 ImNodeData& node = editor.Nodes.Pool[node_idx];
3022 node.Id = id;
3023 }
3024 else if (sscanf(line, "origin=%i,%i", &x, &y) == 2)
3025 {
3026 ImNodeData& node = editor.Nodes.Pool[GImNodes->CurrentNodeIdx];
3027 node.Origin = ImVec2((float)x, (float)y);
3028 }
3029}
3030
3031void EditorLineHandler(ImNodesEditorContext& editor, const char* const line)
3032{

Callers

nothing calls this directly

Calls 2

ImVec2Class · 0.70

Tested by

no test coverage detected