Closed
Description
Describe the bug
The value of PixelPointEvenArgs.Point
inside event handler is wrong.
To Reproduce
Steps to reproduce the behavior:
- Create new Avalonia C# project.
- In
MainWindow.axaml.cs
add line in constructor to output argument value and actual value:
public MainWindow()
{
InitializeComponent();
PositionChanged += (s, e) => Debug.WriteLine($"Position={e.Point}, actual={Position}");
//Position = new(666, 666); // optional
}
- Run and observe debugger "Output" window.
- My outputs are
Position=190, 213, actual=188, 182
or
Position=668, 697, actual=666, 666
Expected behavior
I expect e.Point
value to be equal to actual window Position
.
Environment
- OS: Windows 11
- Avalonia-Version: 11.0.9
Additional context
I tried to use PositionChanged
event to store position of window in normal state, see #14517 ,but unfortunately discovered a new frustrating bug in Avalonia.