mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 04:00:07 +00:00
WPF - Resize Glitches (Image glitches during resize)
- WritableBitmapRenderHandler/InteropBitmapRenderHandler ignore update if size doesn't match It's possible that OnPaint is called multiple times before our BeginInvoke call is marshalled onto the UI Thread. In those cases we check width/height and ignore the call if it doesn't match Issue #3114
This commit is contained in:
@@ -67,6 +67,18 @@ namespace CefSharp.Wpf.Rendering
|
||||
return;
|
||||
}
|
||||
|
||||
var size = isPopup ? popupSize : viewSize;
|
||||
|
||||
//If OnPaint is called multiple times before
|
||||
//our BeginInvoke call we check the size matches our most recent
|
||||
//update, the buffer has already been overriden (frame is dropped effectively)
|
||||
//so we ignore this call
|
||||
//https://github.com/cefsharp/CefSharp/issues/3114
|
||||
if (size.Width != width || size.Height != height)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (createNewBitmap)
|
||||
{
|
||||
if (image.Source != null)
|
||||
|
||||
@@ -83,6 +83,18 @@ namespace CefSharp.Wpf.Rendering
|
||||
return;
|
||||
}
|
||||
|
||||
var size = isPopup ? popupSize : viewSize;
|
||||
|
||||
//If OnPaint is called multiple times before
|
||||
//our BeginInvoke call we check the size matches our most recent
|
||||
//update, the buffer has already been overriden (frame is dropped effectively)
|
||||
//so we ignore this call
|
||||
//https://github.com/cefsharp/CefSharp/issues/3114
|
||||
if (size.Width != width || size.Height != height)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (createNewBitmap)
|
||||
{
|
||||
if (image.Source != null)
|
||||
|
||||
Reference in New Issue
Block a user