imgui-node-editor
imgui-node-editor copied to clipboard
Disable mouse interaction
Ho, I would like to disable mouse interaction when custom mouse interaction happens. In the example below I want to drag item out of the list:

Node selection should be turned off. Any ideas? Even if I had to modify the library?
It does not really solves the problem, but you can rebind mouse buttons:
NodeEditor::Config cfg;
cfg.DragButtonIndex = 0;
cfg.SelectButtonIndex = 1;
cfg.NavigateButtonIndex = 2;
cfg.ContextMenuButtonIndex = 1;
NodeEditor::EditorContext* ctx = NodeEditor::CreateEditor(&cfg);
@Namek Do I understand correctly that the problem is selection rectangle appearing here?
@thedmd yes as for now I used the suggestion above but it's not ideal
Can you by any chance provide a code sample I can play with to reproduce the issue?
@thedmd ~this issue persist only in develop branch, no problems in master.~ (see comment below)
Can you by any chance provide a code sample I can play with to reproduce the issue?
There is nothing special 😃
void NodesDemo::Draw()
{
static float number = 0.0f;
unsigned int id = 0;
NodeEditor::Begin("MyEditor");
NodeEditor::BeginNode(id++);
ImGui::Text("Test node");
ImGui::PushItemWidth(64.0f);
ImGui::DragFloat("test", &number);
ImGui::PopItemWidth();
NodeEditor::EndNode();
NodeEditor::End();
}
Actually, there is something wrong with d&d in master...

I pushed a fix. Can you confirm if it work for you d&d case too?
@thedmd works fine for me 👍