Skip to content

Commit 93f5ade

Browse files
DYN-8307: Remove unused code for Port cursor (#16311)
Co-authored-by: DimitarVen <dimitar.venkov@autodesk.com>
1 parent 44d64b6 commit 93f5ade

1 file changed

Lines changed: 0 additions & 45 deletions

File tree

src/DynamoCoreWpf/Views/Core/WorkspaceView.xaml.cs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -961,22 +961,6 @@ private void OnMouseMove(object sender, MouseEventArgs e)
961961
ViewModel.CurrentCursor = CursorLibrary.GetCursor(CursorSet.ArcSelect);
962962
}
963963

964-
if (ViewModel.IsInIdleState)
965-
{
966-
// Find the dependency object directly under the mouse
967-
// cursor, then see if it represents a port. If it does,
968-
// then determine its type, we would like to show the
969-
// "ArcRemoving" cursor when the mouse is over an out port.
970-
Point mouse = e.GetPosition((UIElement)sender);
971-
var dependencyObject = ElementUnderMouseCursor(mouse);
972-
PortViewModel pvm = PortFromHitTestResult(dependencyObject);
973-
974-
if (null != pvm && (pvm.PortType == PortType.Input))
975-
this.Cursor = CursorLibrary.GetCursor(CursorSet.ArcSelect);
976-
else
977-
this.Cursor = null;
978-
}
979-
980964
// If selection is going to be dragged and ctrl is pressed.
981965
if (ViewModel.IsDragging && Keyboard.Modifiers == ModifierKeys.Control)
982966
{
@@ -1129,35 +1113,6 @@ private void workBench_OnLoaded(object sender, RoutedEventArgs e)
11291113
workBench.owningWorkspace = this;
11301114
}
11311115

1132-
private PortViewModel PortFromHitTestResult(DependencyObject depObject)
1133-
{
1134-
Grid grid = depObject as Grid;
1135-
if (null != grid)
1136-
return grid.DataContext as PortViewModel;
1137-
1138-
return null;
1139-
}
1140-
1141-
private DependencyObject ElementUnderMouseCursor(Point mouseCursor)
1142-
{
1143-
hitResultsList.Clear();
1144-
VisualTreeHelper.HitTest(this, null, DirectHitTestCallback,
1145-
new PointHitTestParameters(mouseCursor));
1146-
1147-
return ((hitResultsList.Count > 0) ? hitResultsList[0] : null);
1148-
}
1149-
1150-
private HitTestResultBehavior DirectHitTestCallback(HitTestResult result)
1151-
{
1152-
if (null != result && (null != result.VisualHit))
1153-
{
1154-
hitResultsList.Add(result.VisualHit);
1155-
return HitTestResultBehavior.Stop;
1156-
}
1157-
1158-
return HitTestResultBehavior.Continue;
1159-
}
1160-
11611116
private void OnWorkspaceDrop(object sender, DragEventArgs e)
11621117
{
11631118

0 commit comments

Comments
 (0)