Skip to content

[DYN-8055] Placement of UI pop up for input/output ports is not accurate#16250

Merged
zeusongit merged 4 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-8055-Placement-of-UI-pop-up-for-input/output-ports-is-not-accurate
Jun 6, 2025
Merged

[DYN-8055] Placement of UI pop up for input/output ports is not accurate#16250
zeusongit merged 4 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-8055-Placement-of-UI-pop-up-for-input/output-ports-is-not-accurate

Conversation

@ivaylo-matov

Copy link
Copy Markdown
Contributor

Purpose

This PR provides a fix for #16147 and DYN-8055.

The PortViewModel logic now takes into account the Windows scaling factor.

DYN-8055-Proposal_250415

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 incorrect positioning of port context menus by updating the placement logic.

Reviewers

@DynamoDS/eidos
@jasonstratton

FYIs

@achintyabhat
@dnenov

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

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-8055

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the inaccurate placement of UI popups for input/output ports by updating the PortViewModel logic to account for the Windows scaling factor.

  • Applied dpi scaling to the vertical offset calculation for port context menus.
  • Introduced dpiScale extraction from the visual of the main window to adjust positioning.


var y = popupHeightOffset + headerHeightOffset + portHalfHeight + rowOffset + customNodeOffset;
var y = popupHeightOffset + (headerHeightOffset + portHalfHeight + rowOffset + customNodeOffset) * dpiScale;

Copilot AI May 30, 2025

Copy link

Choose a reason for hiding this comment

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

Consider whether popupHeightOffset should also be scaled by dpiScale for consistency. If it's intentionally left unscaled, please add a comment to clarify the rationale.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same question as copilot :)

@ivaylo-matov ivaylo-matov May 30, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Applying dpi scaling to this value causes the popup to appear vertically misaligned. This is because popupSize.Height is already in dpi scaled screen pixels, while HeaderHeight and PortModel.Height are in device independent units and require manual adjustment.
I've added a comment to clarify this.

@zeusongit zeusongit merged commit 4a30723 into DynamoDS:master Jun 6, 2025
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.

4 participants