-
Notifications
You must be signed in to change notification settings - Fork 635
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
DYN-7433 Cleanup Node Layout Crash #15495
DYN-7433 Cleanup Node Layout Crash #15495
Conversation
When trying to add an Edge was using nodes that doesn't exist in the GraphLayout so it was crashing when trying to access the node coordinates (there is no null validations) so I've added a validation that check if the two nodes exist before trying to create the Edge. I noticed that there is a re-organization layout problem when using the CleanNodeLayout functionality and having a pin inside a group or in the Canvas (seems that the wires and pins are re-organized in a weird way) but I consider that we should create a task for this specific case (just if is a bug, due that pins behave weird when re-organizing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-7433
UI Smoke TestsTest: success. 11 passed, 0 failed. |
@@ -108,6 +108,9 @@ public void AddNode(Guid guid, double width, double height, double x, double y, | |||
/// <param name="endY">The y coordinate of the connector's right end point.</param> | |||
public void AddEdge(Guid startId, Guid endId, double startX, double startY, double endX, double endY) | |||
{ | |||
//Validates that the two nodes that will be used to create the Edge exist | |||
if (Nodes.Where(node => node.Id == startId).Count() == 0 || Nodes.Where(node => node.Id == endId).Count() == 0) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use !Any() instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in the next commit: 0f97fe1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one minor comment
Refactoring code
Purpose
Crash when we have a pin inside a group and using the GraphLayout functionality.
When trying to add an Edge was using nodes that doesn't exist in the GraphLayout so it was crashing when trying to access the node coordinates (there is no null validations) so I've added a validation that check if the two nodes exist before trying to create the Edge. I noticed that there is a re-organization layout problem when using the CleanNodeLayout functionality and having a pin inside a group or in the Canvas (seems that the wires and pins are re-organized in a weird way) but I consider that we should create a task for this specific case (just if is a bug, due that pins behave weird when re-organizing).
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
Crash when we have a pin inside a group and using the GraphLayout functionality.
Reviewers
@QilongTang
FYIs
@achintyabhat