Skip to content

Conversation

@ivaylo-matov
Copy link
Contributor

Purpose

This PR addresses DYN-7840 and follows up on feedback from DYN-8055.

  • Changes in the logic on PortViewModel ensure that the Windows display scale (dpi) factor is taken into account when positioning the port context menu popup. The adjustment primarily affects the horizontal placement, making sure the chevron arrow remains visually centered relative to the port across different scaling levels.

  • The Data path for the popup chevron arrows has been updated to improve vertical alignment. This ensures the arrow appears centered within the popup body, especially at smaller zoom levels, where it previously gave the impression of being slightly off-center.

DYN-7840-Fix_250604

Declarations

Check these if you believe they are true

  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB
  • This PR introduces new feature code involve network connecting and is tested with no-network mode.

Release Notes

Fixed placement of Context menu popup for nodes in collapsed groups.

Reviewers

@DynamoDS/eidos
@jasonstratton

FYIs

@dnenov
@achintyabhat

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-7840

@zeusongit
Copy link
Contributor

@ivaylo-matov please try merging the master, it should fix the failing checks

Comment on lines 436 to 440
private static double GetDpiScale()
{
var source = PresentationSource.FromVisual(Application.Current.MainWindow);
return source?.CompositionTarget?.TransformToDevice.M22 ?? 1.0;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably a good idea to wrap this in a try-catch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 done

Copy link
Contributor

@zeusongit zeusongit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment, LGTM

@QilongTang QilongTang requested a review from Copilot June 6, 2025 02:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

A fix addressing inaccurate popup placement for input nodes in collapsed groups by incorporating DPI scaling adjustments and improving arrow alignment.

  • Incorporates DPI scaling (via GetDpiScale) into placement logic in PortViewModel, adjusting both left and right context menu popups.
  • Adjusts Y-coordinate calculation in PlacePortContextMenu to ensure proper alignment across various DPI settings.
  • Updates the vector path Data in InPortContextMenu.xaml to improve the vertical centering of chevron arrows.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/DynamoCoreWpf/ViewModels/Core/PortViewModel.cs Adds DPI scaling adjustments to popup placement logic and introduces a helper method (GetDpiScale) for DPI retrieval.
src/DynamoCoreWpf/Controls/InPortContextMenu.xaml Updates the Path Data for chevron arrows for better visual alignment.

@zeusongit zeusongit merged commit ad5a04b into DynamoDS:master Jun 6, 2025
25 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants