[DYN-8055] Placement of UI pop up for input/output ports is not accurate#16250
Conversation
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-8055
…output-ports-is-not-accurate
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Same question as copilot :)
There was a problem hiding this comment.
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.
Purpose
This PR provides a fix for #16147 and DYN-8055.
The PortViewModel logic now takes into account the Windows scaling factor.
Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
Fixed incorrect positioning of port context menus by updating the placement logic.
Reviewers
@DynamoDS/eidos
@jasonstratton
FYIs
@achintyabhat
@dnenov