Skip to content

Commit c326d2a

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: imgui_node_editor.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -3333,7 +3333,10 @@ ed::EditorAction::AcceptResult ed::NavigateAction::Accept(const Control& control
33333333
if (m_IsActive)
33343334
return False;
33353335

3336-
if (Editor->CanAcceptUserInput() /*&& !ImGui::IsAnyItemActive()*/ && ImGui::IsMouseDragging(Editor->GetConfig().NavigateButtonIndex, 0.0f))
3336+
if (Editor->CanAcceptUserInput() /*&& !ImGui::IsAnyItemActive()*/
3337+
&& ImGui::IsMouseDragging(Editor->GetConfig().NavigateButtonIndex, 0.0f)
3338+
&& !ImGui::IsMouseDragPastThreshold(Editor->GetConfig().NavigateButtonIndex) // Make sure that if the dragging started in another window, we don't pick it up.
3339+
)
33373340
{
33383341
m_IsActive = true;
33393342
m_ScrollStart = m_Scroll;

0 commit comments

Comments
 (0)