-
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
Adjust the node position when a Node-Autocompletion element is connected. #11775
Conversation
src/DynamoCoreWpf/ViewModels/Search/NodeSearchElementViewModel.cs
Outdated
Show resolved
Hide resolved
@@ -278,16 +279,22 @@ protected virtual void CreateAndConnectToPort(object parameter) | |||
|
|||
// Create a new node based on node creation name and connection ports | |||
dynamoViewModel.ExecuteCommand(new DynamoModel.CreateAndConnectNodeCommand(id, initialNode.GUID, | |||
Model.CreationName, 0, Model.AutoCompletionNodeElementInfo.PortToConnect, adjustedX, 0, createAsDownStreamNode, false, true)); | |||
Model.CreationName, 0, Model.AutoCompletionNodeElementInfo.PortToConnect, adjustedX, adjustedY, createAsDownStreamNode, false, true)); |
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.
I thought we made the adjusted Y 0 on purpose, @aparajit-pratap @zeusongit can you confirm? Maybe we thought the auto layout algorithm will simply solve that? Anyway, the solution here looks simple enough to be consistent
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.
There was some back-and-forth on this I remember. But I dont recall the problem. Anyway it seems to work fine at the moment.
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.
Some small comments, the end results looks quite appealing
@reddyashish looks much better! 😊 Can you please check in the zoomed out way on the new PR to see if it still behaves correctly? |
@Amoursol yes verified that the new node is created relative to the node sizes in the workspace(zoomed in/out). |
Merging this. Will have to verify if these changes cause of any of UI automation tests to fail. |
Purpose
This PR is to adjust the position of the new nodes that are created from Node-Autocompletion functionality.
In the current algorithm, the X-axis position of the new node is relative to position of the port and that looks fine. But the Y-axis position of the new node was not being set relative to parent node so that is set accordingly in these changes. If the input node is a slider, we want to adjust the X-axis position(move left) to compensate for the extra width of the slider node. For all other nodes, the current algorithm works fine.
For the output port, we need a solution to handle placement of multiple nodes as it will be hard to compute how many nodes are already connected to that port and based on that we will need to set the location of the new node. @zeusongit are you covering this part in your task?
Before:
NodeAutocomplete_NotHonoringLocationOfNode.mov
After:
Declarations
Check these if you believe they are true
*.resx
filesReviewers
@QilongTang @zeusongit @Amoursol