Nelarius / imnodes

A small, dependency-free node editor for dear imgui
MIT License
1.97k stars 241 forks source link

Node not respecting another elements mouse focus #103

Closed mworzala closed 3 years ago

mworzala commented 3 years ago

Is there any way to stop the node from moving when I try to use the color input as seen in the video?

https://i.imgur.com/LKnfEwX.mp4

void256 commented 3 years ago

I do have the same issue but I was able to work around it by changing https://github.com/Nelarius/imnodes/blob/0bcc9b77cba43da3eb625f16133d4b36fe6145b0/imnodes.cpp#L1470

to

if (GImNodes->LeftMouseClicked && node_free_to_move && !ImGui::IsAnyItemActive())

which prevents selecting a Node when there is already any other item active.

This seems to work for me right now but I'm new to both Dear ImGui and imnodes so it's possible it breaks something else that I'm not aware yet 😉

mworzala commented 3 years ago

Fantastic, thanks for the work around :)

Nelarius commented 3 years ago

Thanks for the report. This was fixed in https://github.com/Nelarius/imnodes/commit/61c609a2ed5a4404b45137d21d9e7e48d125ee53. 👍