Browse Source

Use the dirty rect from BeginPaint on WM_PAINT.

The one returned by `GetUpdateRect` at this point will be empty, from
the win32 docs:

> BeginPaint automatically validates the update region, so any call to
GetUpdateRect made immediately after the call to BeginPaint retrieves an
empty update region.
pull/914/head
Steven Kirk 10 years ago
parent
commit
2b87e22db4
  1. 3
      src/Windows/Avalonia.Win32/WindowImpl.cs

3
src/Windows/Avalonia.Win32/WindowImpl.cs

@ -572,9 +572,8 @@ namespace Avalonia.Win32
if (UnmanagedMethods.BeginPaint(_hwnd, out ps) != IntPtr.Zero)
{
UnmanagedMethods.RECT r;
UnmanagedMethods.GetUpdateRect(_hwnd, out r, false);
var f = Scaling;
var r = ps.rcPaint;
Paint?.Invoke(new Rect(r.left / f, r.top / f, (r.right - r.left) / f, (r.bottom - r.top) / f));
UnmanagedMethods.EndPaint(_hwnd, ref ps);
}

Loading…
Cancel
Save