I fixed the pin hovering detection, and it should no longer be possible to create links from hidden pins. The change is in this branch: https://github.com/Nelarius/imnodes/tree/hover-pass @francesco-cattoglio and @Moi78 since you reported the issues in the first place, I was wondering if you could try it on your end to make sure things work as expected π
What it does not fix
This does not change the fact that clicking and dragging a node will affect the ImGui widget of a node underneath. That's a more complicated issue π
Why was hover detection completely rewritten?
The way that UI elements are detected as near the mouse had to be changed. Before, hover detection was a local algorithm, and the hover detection was done at the same time as the UI element was rendered. It was possible for multiple pins and links to be graphically detected as hovered as a result.
Now, hover detection is done in a separate pass, and all pins, nodes, and links are inspected before making a decision on what is being hovered over:
only one pin, link, node, being detected as hovered at a time
a single pin, link, or node being detected as hovered excludes the possibility of anything else being hovered over at the same time
There were some issues with the hover-detection code related to pins. These two issues reported that you could start a link at a pin hidden underneath a node: https://github.com/Nelarius/imnodes/issues/77, https://github.com/Nelarius/imnodes/issues/73.
I fixed the pin hovering detection, and it should no longer be possible to create links from hidden pins. The change is in this branch: https://github.com/Nelarius/imnodes/tree/hover-pass @francesco-cattoglio and @Moi78 since you reported the issues in the first place, I was wondering if you could try it on your end to make sure things work as expected π
What it does not fix
This does not change the fact that clicking and dragging a node will affect the ImGui widget of a node underneath. That's a more complicated issue π
Why was hover detection completely rewritten?
The way that UI elements are detected as near the mouse had to be changed. Before, hover detection was a local algorithm, and the hover detection was done at the same time as the UI element was rendered. It was possible for multiple pins and links to be graphically detected as hovered as a result.
Now, hover detection is done in a separate pass, and all pins, nodes, and links are inspected before making a decision on what is being hovered over: