Skip to content

Commit

Permalink
Fixes a problem with selections
Browse files Browse the repository at this point in the history
The selected nodes and links are cleared no matter what window you click in.
This was a problem for me because i had a property window for selected nodes, and whenever i would click in that window to edit a property, it would unselect the node (and links).
This makes it so the click has to happen in the node editor window to cause unselection.
Fixes this issue: #22
  • Loading branch information
Alan Wolfe authored and Nelarius committed Feb 22, 2020
1 parent 083e09f commit d6a5467
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions imnodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,7 @@ void EndNodeEditor()
const ImGuiIO& imgui_io = ImGui::GetIO();

// check to see if the mouse was near any node
if (g.node_hovered == INVALID_INDEX)
if (g.node_hovered == INVALID_INDEX && ImGui::IsWindowHovered())
{
if (is_mouse_clicked)
{
Expand All @@ -1448,7 +1448,7 @@ void EndNodeEditor()
}
}

if (g.link_hovered == INVALID_INDEX)
if (g.link_hovered == INVALID_INDEX && ImGui::IsWindowHovered())
{
if (is_mouse_clicked)
{
Expand Down

0 comments on commit d6a5467

Please sign in to comment.