Use Math.Round to caculate win32 physical size. (#17)

At some dpi, dpi * wpf size may get non-integer win32 physical size. And convert it to integer directly may cause that the browser size is one pixel smaller than expected.
This commit is contained in:
Shaojun Li
2022-08-02 11:21:32 +08:00
committed by GitHub
parent 94548cb609
commit 73fa0b0c61
+2 -2
View File
@@ -1680,8 +1680,8 @@ namespace CefSharp.Wpf.HwndHost
{
if (dpiScale > 1)
{
width = (int)(width * dpiScale);
height = (int)(height * dpiScale);
width = (int)Math.Round(width * dpiScale);
height = (int)Math.Round(height * dpiScale);
}
managedCefBrowserAdapter.Resize(width, height);