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

DYN-6176 Retain selected nodes/groups when dragging it into a group #14986

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/Utilities/CompactBubbleHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static CompactBubbleViewModel Process(MirrorData value)
{
items = 0;
var viewModel = ProcessThing(value, true);
viewModel.SetObjectType(value.Data);
viewModel.SetObjectType(value?.Data);
viewModel.NumberOfItems = items;

return viewModel;
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/ViewModels/Core/AnnotationViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ public AnnotationViewModel(WorkspaceViewModel workspaceViewModel, AnnotationMode

ViewModelBases = this.WorkspaceViewModel.GetViewModelsInternal(annotationModel.Nodes.Select(x => x.GUID));

// Add all grouped AnnotaionModels to the CutGeometryDictionary.
// Add all grouped AnnotationModels to the CutGeometryDictionary.
// And raise ZIndex changed to make sure nested groups have
// a higher zIndex than the parent.
using (NestedGroupsGeometries.DeferCollectionReset())
Expand Down
6 changes: 4 additions & 2 deletions src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ internal bool HandleMouseRelease(object sender, MouseButtonEventArgs e)
.ToList();

// AddModelsToGroupModelCommand adds models to the selected group
// therefor we add the dropGroup to the selection before calling
// therefore we add the dropGroup to the selection before calling
// the command.
DynamoSelection.Instance.Selection.AddUnique(dropGroup.AnnotationModel);

Expand Down Expand Up @@ -794,7 +794,9 @@ internal bool HandleMouseRelease(object sender, MouseButtonEventArgs e)
owningWorkspace.DynamoViewModel.AddModelsToGroupModelCommand.Execute(null);
}
dropGroup.NodeHoveringState = false;
dropGroup.SelectAll();
//select only those models which were added to the group
DynamoSelection.Instance.ClearSelection();
DynamoSelection.Instance.Selection.AddRange(modelsToAdd);
}

SetCurrentState(State.None); // Dragging operation ended.
Expand Down
Loading