Browse Source
Merge pull request #2211 from ahopper/fix-black-area-inside-window
fix #2166 black area on windows
pull/2221/head
Steven Kirk
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
4 deletions
-
src/Windows/Avalonia.Win32/WindowImpl.cs
|
|
|
@ -153,17 +153,20 @@ namespace Avalonia.Win32 |
|
|
|
|
|
|
|
public void Resize(Size value) |
|
|
|
{ |
|
|
|
if (value != ClientSize) |
|
|
|
var clientRect = ClientSize; |
|
|
|
if (value != clientRect) |
|
|
|
{ |
|
|
|
value *= Scaling; |
|
|
|
|
|
|
|
UnmanagedMethods.RECT windowRect; |
|
|
|
UnmanagedMethods.GetWindowRect(_hwnd, out windowRect); |
|
|
|
|
|
|
|
UnmanagedMethods.SetWindowPos( |
|
|
|
_hwnd, |
|
|
|
IntPtr.Zero, |
|
|
|
0, |
|
|
|
0, |
|
|
|
(int)value.Width, |
|
|
|
(int)value.Height, |
|
|
|
(int)(value.Width + (windowRect.Width - clientRect.Width)), |
|
|
|
(int)(value.Height + (windowRect.Height - clientRect.Height)), |
|
|
|
UnmanagedMethods.SetWindowPosFlags.SWP_RESIZE); |
|
|
|
} |
|
|
|
} |
|
|
|
|