diff --git a/imgui_node_editor.h b/imgui_node_editor.h index a173cde3..a1640b0d 100644 --- a/imgui_node_editor.h +++ b/imgui_node_editor.h @@ -368,6 +368,9 @@ int BreakLinks(PinId pinId); // Break all links connected to this pin void NavigateToContent(float duration = -1); void NavigateToSelection(bool zoomIn = false, float duration = -1); +void SuspendNavigation(); +void ResumeNavigation(); + bool ShowNodeContextMenu(NodeId* nodeId); bool ShowPinContextMenu(PinId* pinId); bool ShowLinkContextMenu(LinkId* linkId); diff --git a/imgui_node_editor_api.cpp b/imgui_node_editor_api.cpp index c8c7c3ff..4adf15ff 100644 --- a/imgui_node_editor_api.cpp +++ b/imgui_node_editor_api.cpp @@ -576,6 +576,16 @@ void ax::NodeEditor::NavigateToSelection(bool zoomIn, float duration) s_Editor->NavigateTo(s_Editor->GetSelectionBounds(), zoomIn, duration); } +void ax::NodeEditor::SuspendNavigation() +{ + s_Editor->SuspendNavigation(); +} + +void ax::NodeEditor::ResumeNavigation() +{ + s_Editor->ResumeNavigation(); +} + bool ax::NodeEditor::ShowNodeContextMenu(NodeId* nodeId) { return s_Editor->GetContextMenu().ShowNodeContextMenu(nodeId); diff --git a/imgui_node_editor_internal.h b/imgui_node_editor_internal.h index 4c57725f..fba41970 100644 --- a/imgui_node_editor_internal.h +++ b/imgui_node_editor_internal.h @@ -1433,6 +1433,16 @@ struct EditorContext m_NavigateAction.NavigateTo(bounds, zoomMode, duration); } + inline void SuspendNavigation() + { + m_NavigateAction.m_IsActive = false; + } + + inline void ResumeNavigation() + { + m_NavigateAction.m_IsActive = true; + } + void RegisterAnimation(Animation* animation); void UnregisterAnimation(Animation* animation);