mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 03:32:37 +00:00
WPF - store width/height in local variable upon size change
Do this so it's easier to implement a workaround for #2779
This commit is contained in:
@@ -39,6 +39,11 @@ namespace CefSharp.Wpf
|
||||
public const string PartImageName = "PART_image";
|
||||
public const string PartPopupImageName = "PART_popupImage";
|
||||
|
||||
/// <summary>
|
||||
/// View Rectangle used by <see cref="GetViewRect"/>
|
||||
/// </summary>
|
||||
private Rect viewRect;
|
||||
|
||||
/// <summary>
|
||||
/// The source
|
||||
/// </summary>
|
||||
@@ -754,11 +759,6 @@ namespace CefSharp.Wpf
|
||||
/// <returns>View Rectangle</returns>
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user