Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misalignment when adding child window to node #236

Open
vtnoah opened this issue Jun 11, 2023 · 5 comments
Open

Misalignment when adding child window to node #236

vtnoah opened this issue Jun 11, 2023 · 5 comments

Comments

@vtnoah
Copy link

vtnoah commented Jun 11, 2023

I'm trying to add a child window into a node using the blueprints example by placing the following code between the builder.Begin() and builder.End() statements.

ImGui::BeginChild("Nody", ImVec2(200, 200), true);

ImGui::Button("B", button_sz3);

ImGui::EndChild();

It seems to work but the child window isn't bound into the node. When resizing the window it does seem to clip the child window when the node is clipped. Any ideas what might be going on?

Animation

@TamirVered
Copy link

Having the same issue with the contents of a ListBox inside a node

@Shiselster
Copy link

Experiencing the same issue here as well, when using Group.
Any known workaround or upcoming fix?

@thedmd
Copy link
Owner

thedmd commented Sep 6, 2023

I would need to inspect ImGui to see if canvas would be able to recognize child windows and scale them appropriately.
So far workaround is to display widgets containing child windows as popups.

@TamirVered
Copy link

Any suggestion on how to make such a popup constantly open and follow the node? So it will fill as if it were its content.

@thedmd
Copy link
Owner

thedmd commented Sep 19, 2023

Nodes are moved in ed::End. To stay in sync it is bess to update popup position after this function is called.

You can query the position of the node (ed::GetNodePosition) and use it to position popup.

ed::CanvasToScreen does convert node position in canvas to screen position ImGui use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants