79374896

Date: 2025-01-21 15:02:49
Score: 4.5
Natty: 4.5
Report link
ClientSizeProperty.Changed.Subscribe(size =>
{
    var x = (size.OldValue.Value.Width - size.NewValue.Value.Width) / 2 * Scaling;
    var y = (size.OldValue.Value.Height - size.NewValue.Value.Height) / 2 * Scaling;

    Position = new PixelPoint(Position.X + (int)x, Position.Y + (int)y);
});

public double Scaling => Screens.ScreenFromWindow(this)!.Scaling;

I need to multiply x and y by window scaling factor. Otherwise, the window would slowly shift.

Is this the right way to fix?

Reasons:
  • Blacklisted phrase (0.5): I need
  • RegEx Blacklisted phrase (1.5): fix?
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: ajtn123