-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Set ScaleFactor for inheritance margin context menu #74849
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
Conversation
{ | ||
var zoomTransform = new ScaleTransform(_scaleFactor, _scaleFactor); | ||
zoomTransform.Freeze(); | ||
LayoutTransform = zoomTransform; |
There was a problem hiding this comment.
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.
private readonly IUIThreadOperationExecutor _operationExecutor; | ||
private readonly Workspace _workspace; | ||
private readonly IAsynchronousOperationListener _listener; | ||
private readonly double _scaleFactor; |
There was a problem hiding this comment.
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.
_listener = listener; | ||
_scaleFactor = scaleFactor; | ||
InitializeComponent(); | ||
SetZoom(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this just be:
SetZoom(); | |
this.LayoutTransformation = new ScaleTransform(scaleFactor, scaleFactor).Freeze(); |
?
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
Fix: #74035
Current behavior:

After:
