Skip to content

An initialization problem of "Begin()" #200

@jkooooo99

Description

@jkooooo99

It seems like Node Editor can not initialize correctly when the ImGui::GetContentRegionAvail() returns an {0, 0} (or {-123,-456}, etc.)...

But If I have a complex layout ( I am using the docking branch of imgui ), there may be such a moment that the "region" is (0,0) or even minus numbers.

And Node Editor will definitely throw an error!
20230208

For now, I fix it with a simple "if" check.

                        ImGui::Begin("##window");
                        auto size = ImGui::GetContentRegionAvail();
			if (size.x <= 0 || size.y <= 0)
                        {
				ImGui::End();
				return;
			}

                       ed::Begin("##editor");
                       //...
                       ed::End();
                       ImGui::End();

20230208

There is one more bug when I am using the docking branch...
It will show a weird scrollbar when I drag the window to another screen.

20230208

And I am suppressing it with an "ImGuiWindowFlags_NoScrollbar" child window...

Sorry for my poor English.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions