Skip to content
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
4 changes: 4 additions & 0 deletions src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2365,6 +2365,10 @@ private void DynamoView_KeyUp(object sender, KeyEventArgs e)
if (dynamoViewModel.BackgroundPreviewViewModel.CanNavigateBackground)
{
dynamoViewModel.BackgroundPreviewViewModel.NavigationKeyIsDown = false;
// Release any mouse capture held by the 3D preview viewport
// (e.g., during a right-click orbit gesture) so the orbit wheel
// indicator disappears immediately when returning to graph view.
BackgroundPreview?.ReleaseViewportMouseCapture();
dynamoViewModel.EscapeCommand.Execute(null);
e.Handled = true;
}
Expand Down
23 changes: 23 additions & 0 deletions src/DynamoCoreWpf/Views/Preview/Watch3DView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,29 @@
{
return View.GetCameraPosition();
}

/// <summary>
/// Ends any active HelixToolkit camera gesture (e.g. right-click orbit) and
/// hides the orbit indicator when switching back to graph view.
/// </summary>
/// <remarks>
/// HelixToolkit's MouseGestureHandler has no LostMouseCapture handler, so
/// calling Mouse.Capture(null) alone releases WPF capture but never invokes
/// Completed() / HideTargetAdorner(). Raising a synthetic MouseUp causes
/// HelixToolkit's OnMouseUp to run, which properly ends the gesture.
/// </remarks>
internal void ReleaseViewportMouseCapture()

Check warning on line 462 in src/DynamoCoreWpf/Views/Preview/Watch3DView.xaml.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make 'ReleaseViewportMouseCapture' a static method.

See more on https://sonarcloud.io/project/issues?id=DynamoDS_Dynamo&issues=AZ35JnMnZS6hJc1rO6_O&open=AZ35JnMnZS6hJc1rO6_O&pullRequest=17096
{
if (watch_view?.IsMouseCaptureWithin ?? false)
{
Mouse.Capture(null);
var args = new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Right)
{
RoutedEvent = UIElement.MouseUpEvent
};
watch_view.RaiseEvent(args);
}
}
}


Expand Down
Loading