You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 16, 2023. It is now read-only.
It looks like the code to center the nodes on the right side of the graph isn't working correctly. For me these nodes were often offset at odd angles. I changed this method to fix it:
private void CenterTreeToRoot(Node.NodeInputSide side)
{
var children = _refTargetNode.GetChildren(side);
if (children.Count > 1)
{
float refTargetY = _refTargetNode.Position.y;
float size = _refTargetNode.GetLastChild(side).Position.y -
_refTargetNode.GetFirstChild(side).Position.y;
float actualY = _refTargetNode.GetFirstChild(side).Position.y;
float desiredY = refTargetY - size/2.0f;
float shiftY = desiredY - actualY;
for (int i = 0; i < children.Count; ++i)
{
children[i].ForeachChildrenRecursively(side, (node) => node.SetPositionY(node.Position.y + shiftY));
}
}
}
The text was updated successfully, but these errors were encountered:
I will completely trust you and add it into the plugin.
I won't tell that I had no idea of what I was doing but I tried to implement an algorithm that I did not fully understood...
So, thanks you for your contribution!
It is now available on master.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It looks like the code to center the nodes on the right side of the graph isn't working correctly. For me these nodes were often offset at odd angles. I changed this method to fix it:
The text was updated successfully, but these errors were encountered: