Skip to content

Commit eb1559a

Browse files
authored
[DYN-7466] Follow up - Zoom to fit to nodes/groups selected in TuneUP and GraphNodeManager (#15547)
1 parent d05c5a6 commit eb1559a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2771,6 +2771,7 @@ var customNodeWorkspace in
27712771
}
27722772
// Center the view on the model
27732773
this.CurrentSpaceViewModel.OnRequestCenterViewOnElement(this, new ModelEventArgs(e));
2774+
FitView(false);
27742775
}
27752776

27762777
private void CancelActiveState(NodeModel node)

src/DynamoCoreWpf/ViewModels/Core/WorkspaceViewModel.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1156,23 +1156,23 @@ public double GetSelectionAverageY()
11561156

11571157
public double GetSelectionMinX()
11581158
{
1159-
return DynamoSelection.Instance.Selection.Where((x) => !(x is AnnotationModel) && x is ILocatable)
1159+
return DynamoSelection.Instance.Selection.Where((x) => x is ILocatable)
11601160
.Cast<ILocatable>()
11611161
.Select((x) => x.X)
11621162
.Min();
11631163
}
11641164

11651165
public double GetSelectionMinY()
11661166
{
1167-
return DynamoSelection.Instance.Selection.Where((x) => !(x is AnnotationModel) && x is ILocatable)
1167+
return DynamoSelection.Instance.Selection.Where((x) => x is ILocatable)
11681168
.Cast<ILocatable>()
11691169
.Select((x) => x.Y)
11701170
.Min();
11711171
}
11721172

11731173
public double GetSelectionMaxX()
11741174
{
1175-
return DynamoSelection.Instance.Selection.Where((x) => !(x is AnnotationModel) && x is ILocatable)
1175+
return DynamoSelection.Instance.Selection.Where((x) => x is ILocatable)
11761176
.Cast<ILocatable>()
11771177
.Select((x) => x.X + x.Width)
11781178
.Max();
@@ -1188,7 +1188,7 @@ public double GetSelectionMaxLeftX()
11881188

11891189
public double GetSelectionMaxY()
11901190
{
1191-
return DynamoSelection.Instance.Selection.Where((x) => !(x is AnnotationModel) && x is ILocatable)
1191+
return DynamoSelection.Instance.Selection.Where((x) => x is ILocatable)
11921192
.Cast<ILocatable>()
11931193
.Select((x) => x.Y + x.Height)
11941194
.Max();

0 commit comments

Comments
 (0)