@@ -1034,6 +1034,7 @@ ed::EditorContext::EditorContext(const ax::NodeEditor::Config* config)
10341034 , m_IsFocused(false )
10351035 , m_IsHovered(false )
10361036 , m_IsHoveredWithoutOverlapp(false )
1037+ , m_EnableUserInput(true )
10371038 , m_ShortcutsEnabled(true )
10381039 , m_Style()
10391040 , m_Nodes()
@@ -1085,6 +1086,7 @@ ed::EditorContext::~EditorContext()
10851086
10861087void ed::EditorContext::Begin (const char * id, const ImVec2& size)
10871088{
1089+ m_EnableUserInput = true ;
10881090 m_EditorActiveId = ImGui::GetID (id);
10891091 ImGui::PushID (id);
10901092
@@ -1294,10 +1296,13 @@ void ed::EditorContext::End()
12941296 if (m_CurrentAction && !m_CurrentAction->Process (control))
12951297 m_CurrentAction = nullptr ;
12961298
1297- if (m_NavigateAction.m_IsActive )
1298- m_NavigateAction.Process (control);
1299- else
1300- m_NavigateAction.Accept (control);
1299+ if (m_EnableUserInput)
1300+ {
1301+ if (m_NavigateAction.m_IsActive )
1302+ m_NavigateAction.Process (control);
1303+ else
1304+ m_NavigateAction.Accept (control);
1305+ }
13011306
13021307 if (nullptr == m_CurrentAction)
13031308 {
@@ -1966,7 +1971,12 @@ bool ed::EditorContext::IsHoveredWithoutOverlapp() const
19661971
19671972bool ed::EditorContext::CanAcceptUserInput () const
19681973{
1969- return m_IsFocused && m_IsHovered;
1974+ return m_IsFocused && m_IsHovered && m_EnableUserInput;
1975+ }
1976+
1977+ void ed::EditorContext::DisableUserInputThisFrame ()
1978+ {
1979+ m_EnableUserInput = false ;
19701980}
19711981
19721982int ed::EditorContext::CountLiveNodes () const
0 commit comments