diff --git a/CefSharp.Wpf/ChromiumWebBrowser.cs b/CefSharp.Wpf/ChromiumWebBrowser.cs
index 5ebed2973..4e42faf65 100644
--- a/CefSharp.Wpf/ChromiumWebBrowser.cs
+++ b/CefSharp.Wpf/ChromiumWebBrowser.cs
@@ -39,6 +39,11 @@ namespace CefSharp.Wpf
public const string PartImageName = "PART_image";
public const string PartPopupImageName = "PART_popupImage";
+ ///
+ /// View Rectangle used by
+ ///
+ private Rect viewRect;
+
///
/// The source
///
@@ -754,11 +759,6 @@ namespace CefSharp.Wpf
/// View Rectangle
protected virtual Rect GetViewRect()
{
- //NOTE: Previous we used Math.Ceiling to round the sizing up, we
- //now set UseLayoutRounding = true; on the control so the sizes are
- //already rounded to a whole number for us.
- var viewRect = new Rect(0, 0, (int)ActualWidth, (int)ActualHeight);
-
return viewRect;
}
@@ -1856,6 +1856,11 @@ namespace CefSharp.Wpf
// Initialize RenderClientAdapter when WPF has calculated the actual size of current content.
CreateOffscreenBrowser(e.NewSize);
+ //NOTE: Previous we used Math.Ceiling to round the sizing up, we
+ //now set UseLayoutRounding = true; on the control so the sizes are
+ //already rounded to a whole number for us.
+ viewRect = new Rect(0, 0, (int)e.NewSize.Width, (int)e.NewSize.Height);
+
if (browser != null)
{
browser.GetHost().WasResized();