Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set ScaleFactor for inheritance margin context menu #74849

Merged
merged 5 commits into from
Aug 22, 2024

Conversation

Cosifne
Copy link
Member

@Cosifne Cosifne commented Aug 22, 2024

Fix: #74035

Current behavior:
image

After:
image

@Cosifne Cosifne requested a review from a team as a code owner August 22, 2024 03:11
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 22, 2024
{
var zoomTransform = new ScaleTransform(_scaleFactor, _scaleFactor);
zoomTransform.Freeze();
LayoutTransform = zoomTransform;
Copy link
Member

Choose a reason for hiding this comment

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

nit. can this be a local function? or just inline entirely in to the constructor.

@@ -25,20 +26,31 @@ internal partial class InheritanceMarginContextMenu : ContextMenu
private readonly IUIThreadOperationExecutor _operationExecutor;
private readonly Workspace _workspace;
private readonly IAsynchronousOperationListener _listener;
private readonly double _scaleFactor;
Copy link
Member

Choose a reason for hiding this comment

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

do you need to acctually save this? it appears to only be used once.

InitializeComponent();
SetZoom();
Copy link
Member

Choose a reason for hiding this comment

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

can this just be:

Suggested change
SetZoom();
this.LayoutTransformation = new ScaleTransform(scaleFactor, scaleFactor).Freeze();

?

Copy link
Member

@sharwell sharwell Aug 22, 2024

Choose a reason for hiding this comment

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

The Freeze method returns void so it can't be quite this simple. An AsFrozen generic extension method would likely work.

Copy link
Member

@CyrusNajmabadi CyrusNajmabadi left a comment

Choose a reason for hiding this comment

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

Signing off. Up to you if you can simplify here.

@Cosifne Cosifne enabled auto-merge August 22, 2024 16:52
@Cosifne Cosifne merged commit 439bea0 into dotnet:main Aug 22, 2024
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Aug 22, 2024
@Cosifne Cosifne deleted the dev/shech/InheritanceMarginZoom branch August 22, 2024 18:19
@dibarbet dibarbet modified the milestones: Next, 17.12 P2 Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Needs UX Triage untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inheritance margin doesn't work well with screen scaling
4 participants