@@ -1074,6 +1074,7 @@ ed::EditorContext::EditorContext(const ax::NodeEditor::Config* config)
10741074 , m_IsFocused(false )
10751075 , m_IsHovered(false )
10761076 , m_IsHoveredWithoutOverlapp(false )
1077+ , m_EnableUserInput(true )
10771078 , m_ShortcutsEnabled(true )
10781079 , m_Style()
10791080 , m_Nodes()
@@ -1125,6 +1126,7 @@ ed::EditorContext::~EditorContext()
11251126
11261127void ed::EditorContext::Begin (const char * id, const ImVec2& size)
11271128{
1129+ m_EnableUserInput = true ;
11281130 m_EditorActiveId = ImGui::GetID (id);
11291131 ImGui::PushID (id);
11301132
@@ -1334,10 +1336,13 @@ void ed::EditorContext::End()
13341336 if (m_CurrentAction && !m_CurrentAction->Process (control))
13351337 m_CurrentAction = nullptr ;
13361338
1337- if (m_NavigateAction.m_IsActive )
1338- m_NavigateAction.Process (control);
1339- else
1340- m_NavigateAction.Accept (control);
1339+ if (m_EnableUserInput)
1340+ {
1341+ if (m_NavigateAction.m_IsActive )
1342+ m_NavigateAction.Process (control);
1343+ else
1344+ m_NavigateAction.Accept (control);
1345+ }
13411346
13421347 if (nullptr == m_CurrentAction)
13431348 {
@@ -2006,7 +2011,12 @@ bool ed::EditorContext::IsHoveredWithoutOverlapp() const
20062011
20072012bool ed::EditorContext::CanAcceptUserInput () const
20082013{
2009- return m_IsFocused && m_IsHovered;
2014+ return m_IsFocused && m_IsHovered && m_EnableUserInput;
2015+ }
2016+
2017+ void ed::EditorContext::DisableUserInputThisFrame ()
2018+ {
2019+ m_EnableUserInput = false ;
20102020}
20112021
20122022int ed::EditorContext::CountLiveNodes () const
0 commit comments