Skip to content

Commit 4b20395

Browse files
JulesFouchypthom
authored andcommitted
Fix: don't respond to mouse drag events that started outside of our nodes window
1 parent 7ac23db commit 4b20395

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

imgui_node_editor.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -3293,7 +3293,10 @@ ed::EditorAction::AcceptResult ed::NavigateAction::Accept(const Control& control
32933293
if (m_IsActive)
32943294
return False;
32953295

3296-
if (Editor->CanAcceptUserInput() /*&& !ImGui::IsAnyItemActive()*/ && ImGui::IsMouseDragging(Editor->GetConfig().NavigateButtonIndex, 0.0f))
3296+
if (Editor->CanAcceptUserInput() /*&& !ImGui::IsAnyItemActive()*/
3297+
&& ImGui::IsMouseDragging(Editor->GetConfig().NavigateButtonIndex, 0.0f)
3298+
&& !ImGui::IsMouseDragPastThreshold(Editor->GetConfig().NavigateButtonIndex) // Make sure that if the dragging started in another window, we don't pick it up.
3299+
)
32973300
{
32983301
m_IsActive = true;
32993302
m_ScrollStart = m_Scroll;

0 commit comments

Comments
 (0)