Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions imnodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2759,6 +2759,13 @@ ImVec2 GetNodeScreenSpacePos(const int node_id)
return GridSpaceToScreenSpace(editor, node.Origin);
}

ImVec2 GetOrCreateNodeEditorSpacePos(const int node_id)
{
ImNodesEditorContext& editor = EditorContextGet();
ImNodeData& node = ObjectPoolFindOrCreateObject(editor.Nodes, node_id);
return GridSpaceToEditorSpace(editor, node.Origin);
}

ImVec2 GetNodeEditorSpacePos(const int node_id)
{
ImNodesEditorContext& editor = EditorContextGet();
Expand Down
1 change: 1 addition & 0 deletions imnodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ void SetNodeScreenSpacePos(int node_id, const ImVec2& screen_space_pos);
void SetNodeEditorSpacePos(int node_id, const ImVec2& editor_space_pos);
void SetNodeGridSpacePos(int node_id, const ImVec2& grid_pos);

ImVec2 GetOrCreateNodeEditorSpacePos(const int node_id);
ImVec2 GetNodeScreenSpacePos(const int node_id);
ImVec2 GetNodeEditorSpacePos(const int node_id);
ImVec2 GetNodeGridSpacePos(const int node_id);
Expand Down