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

Allow setting of Channel (z-axis) of Nodes #109

Closed
JaroslavHolecek opened this issue Apr 25, 2021 · 4 comments
Closed

Allow setting of Channel (z-axis) of Nodes #109

JaroslavHolecek opened this issue Apr 25, 2021 · 4 comments
Assignees

Comments

@JaroslavHolecek
Copy link

JaroslavHolecek commented Apr 25, 2021

Hi,
it will be super, if you allow manual setting of Channel (z-axis) order of Nodes.
For example some switcher whether use your current implementation or manual setting of each Nodes.
Just add to Node variable for manual Channel and at the end allow sorting nodes based on this variable.
It will enlarge usability of library.
For example: I need draw Node with pins - and this node has as middle another Nodes - this is (i guess) impossible now - because if I select the main node it cover inside nodes...

@thedmd
Copy link
Owner

thedmd commented Jul 8, 2021

Hi!

You're correct there is no Z control for nodes in public API. Comment nodes (group nodes) are always under regular nodes, but this can be easily generalized to have custom Z value. Sounds like neat idea.

I will look into this.

@thedmd thedmd self-assigned this Jul 8, 2021
@JaroslavHolecek
Copy link
Author

Great!
Can I ask you when you will have time to do it?
On your time depend, whether I wait for your update or somehow figure out my solution (my own simple node_editor)

@thedmd
Copy link
Owner

thedmd commented Jul 8, 2021

I will look into that this weekend. Will be raining, so there should be plenty of time for that. : )

thedmd added a commit that referenced this issue Jul 11, 2021
Nodes with higher Z position are drawn on top of ones with lower.

New API:
```
void SetNodeZPosition(NodeId nodeId, float z); // Sets node z position, nodes with higher value are drawn over nodes with lower value
float GetNodeZPosition(NodeId nodeId); // Returns node z position, defaults is 0.0f
```
@thedmd
Copy link
Owner

thedmd commented Jul 11, 2021

Nodes now can have Z position. This has highest priority when determining draw order.

void SetNodeZPosition(NodeId nodeId, float z); // Sets node z position, nodes with higher value are drawn over nodes with lower value
float GetNodeZPosition(NodeId nodeId); // Returns node z position, defaults is 0.0f

@thedmd thedmd closed this as completed Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants