imgui-node-editor icon indicating copy to clipboard operation
imgui-node-editor copied to clipboard

Imgui 1.86 WIP with docking support

Open Ubpa opened this issue 2 years ago • 1 comments

Hi, I found that imgui-node-editor does not support with imgui 1.86 docking. Could you please fix the bug? image

Ubpa avatar Mar 05 '22 08:03 Ubpa

I will check it out

thedmd avatar Apr 16 '22 07:04 thedmd

Same thing here, I'm using your branch 1.89 WIP (18808), I cannot dock the window :'(

arabine avatar Oct 07 '22 07:10 arabine

Can you provide a repro?

So far I didn't manage to not make it work.

thedmd avatar Oct 09 '22 14:10 thedmd

Ah! I have added your simple example to my global frame drawing:

void Blueprint::OnFrame()
{
    auto& io = ImGui::GetIO();

            ed::SetCurrentEditor(m_Editor);
            ed::Begin("My Editor");
            int uniqueId = 1;
            // Start drawing nodes.
            ed::BeginNode(uniqueId++);
                ImGui::Text("Node A");
                ed::BeginPin(uniqueId++, ed::PinKind::Input);
                    ImGui::Text("-> In");
                ed::EndPin();
                ImGui::SameLine();
                ed::BeginPin(uniqueId++, ed::PinKind::Output);
                    ImGui::Text("Out ->");
                ed::EndPin();
            ed::EndNode();
            ed::End();
            ed::SetCurrentEditor(nullptr);

    return;
}

All other windows are docked, when I drag this window I do not see any "blue anchor rectangle". Here the main loop (I'm using SDL2 as renderer):

    int Update(SDL_Renderer *renderer, double deltaTime) override
    {
        draw_editor_layout();
        draw_memory_editor();
        m_blueprint.OnFrame();  // <<------- The Node editor is here
        draw_ost_device(renderer, deltaTime);
        code_editor_draw();

        m_console.Draw("Console", nullptr);

        return 0;
    }

arabine avatar Oct 10 '22 08:10 arabine

Hello do you need more information? I will try to push my project for you.

arabine avatar Oct 31 '22 15:10 arabine

ed::Begin does not create own window. Can you try to enclose code in OnFrame() in ImGui::Begin()/ImGui::End()?

thedmd avatar Nov 02 '22 04:11 thedmd

Yes it works, thank you it was obvious now.

arabine avatar Nov 06 '22 21:11 arabine

1.86

The newest version of imgui is 1.89, and there's bug when integrating node-editor. It occurs when zooming and scrolling.

image

https://user-images.githubusercontent.com/48938612/208335911-f4ba9144-5408-4982-a0da-0c32b1ba00be.mp4

ChivenZhang avatar Dec 19 '22 02:12 ChivenZhang

As a workaround please avoid running editor with zero size od when ImGui::GetContentRegionAvail() is an empty rect. This will be fixed in the future.

Also, please in the future open new issue instead of hijacking older ones.

thedmd avatar May 02 '23 15:05 thedmd