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

Node overlap rendering is not correct #9

Closed
Nelarius opened this issue Dec 1, 2019 · 14 comments
Closed

Node overlap rendering is not correct #9

Nelarius opened this issue Dec 1, 2019 · 14 comments
Labels
bug Something isn't working

Comments

@Nelarius
Copy link
Owner

Nelarius commented Dec 1, 2019

When dragging nodes over each other, the rendering is glitchy due to all node frames being rendered in a loop in EndNodeEditor. It would be better to render the frame after EndNode is called so that the node frame and ImGui UI are at least rendered in the same order.

node_overlap_rendering_problem

@Nelarius Nelarius added the bug Something isn't working label Dec 1, 2019
@ketoo
Copy link
Contributor

ketoo commented Jan 7, 2020

Meet the same issue.

@NukeBird
Copy link

are there any improvements?

@Nelarius
Copy link
Owner Author

Not yet 😞 I think I am going start working on this issue next week, going to try to fix a few other fundamental issues as well.

@ketoo
Copy link
Contributor

ketoo commented Jan 29, 2020

Great, please let me know if you need any help that comes from other developers.

@NukeBird
Copy link

Cool! Keep it up, I really love your lib!
It's pretty simple in comparison with others

@Nelarius
Copy link
Owner Author

Thanks, happy to hear that you think so! 😊

@Nelarius
Copy link
Owner Author

Nelarius commented Feb 8, 2020

All right, finally made some progress on this. Now nodes are nicely rendered on top of each other if they overlap. It's not perfect though: clicking and dragging a node doesn't put it in top of other nodes automatically -- the "depth order" depends on which order you called BeginNode/EndNode. It would be nice to have more control over the depth order of the node draw commands, but that's another issue. I will close this issue 🙂

@ketoo I had to delete IsAttributeLinked and therefore remove the pin linked/unlinked rendering 😞 Really sorry for breaking the feature so soon after you wrote it! To fix the overlap issue, I had to movedraw_node and draw_pin from EndNodeEditor to EndNode(), which meant that the link connectivity information is no longer available at that point. So the pins are back to being simple filled shapes for now. One of the drawbacks of being an immediate mode UI is that you have to throw the state away at the end of every frame 😬

@Nelarius Nelarius closed this as completed Feb 8, 2020
@ketoo
Copy link
Contributor

ketoo commented Feb 9, 2020

All right, finally made some progress on this. Now nodes are nicely rendered on top of each other if they overlap. It's not perfect though: clicking and dragging a node doesn't put it in top of other nodes automatically -- the "depth order" depends on which order you called BeginNode/EndNode. It would be nice to have more control over the depth order of the node draw commands, but that's another issue. I will close this issue 🙂

@ketoo I had to delete IsAttributeLinked and therefore remove the pin linked/unlinked rendering 😞 Really sorry for breaking the feature so soon after you wrote it! To fix the overlap issue, I had to movedraw_node and draw_pin from EndNodeEditor to EndNode(), which meant that the link connectivity information is no longer available at that point. So the pins are back to being simple filled shapes for now. One of the drawbacks of being an immediate mode UI is that you have to throw the state away at the end of every frame 😬

No worry, the application can manage the pin's status by itself. To do this, the pin system needs to support more shapes, for instance, the solid triangle and the hollow triangle, which can meet the same goal. Actually, my application has all statuses about the nodes and pins, which means the application can pass the status when drawing the nodes and pins.

@Nelarius
Copy link
Owner Author

Yeah, my application also has the connectivity information. So what we now need is to be able to set per-pin style, and allow the pin shape style to be hollow or filled 👍

@ketoo
Copy link
Contributor

ketoo commented Feb 10, 2020

Great, thats enough for the developer.

@Nelarius
Copy link
Owner Author

I added filled/unfilled shapes to master.

@ketoo
Copy link
Contributor

ketoo commented Feb 12, 2020

Cool! I updated and it works. But I meet a new issue when I run the application on MAC, listed as below:

image

This issue will come when I resize the window.

@Nelarius
Copy link
Owner Author

Looks like something fails deep inside OpenGL 😯 Are you sure it was imnode's triggering this crash? imnodes itself doesn't touch window resize logic, nor did the pin rendering changes have anything to do with UI event handling 🤔

@ketoo
Copy link
Contributor

ketoo commented Feb 17, 2020

I have done a test, the result shows that the issue comes from Imgui itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants