mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 04:00:07 +00:00
Added support for resizing. Doesn't work fully, throws exceptions sometimes, but it's at least a start.
This commit is contained in:
@@ -22,6 +22,7 @@ namespace CefSharp
|
||||
|
||||
void SetCursor(IntPtr cursor);
|
||||
|
||||
void ClearBitmap();
|
||||
void SetBitmap();
|
||||
|
||||
void SetPopupBitmap();
|
||||
|
||||
@@ -85,6 +85,18 @@ namespace CefSharp
|
||||
_renderWebBrowser->SetCursor((IntPtr) cursor);
|
||||
}
|
||||
|
||||
void WasResized()
|
||||
{
|
||||
if (this->GetCefBrowser() == nullptr ||
|
||||
this->GetCefBrowser()->GetHost() == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->GetCefBrowser()->GetHost()->WasResized();
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void SetBuffer(int width, int height, const void* buffer)
|
||||
@@ -119,6 +131,8 @@ namespace CefSharp
|
||||
currentWidth != width ||
|
||||
currentHeight != height)
|
||||
{
|
||||
_renderWebBrowser->ClearBitmap();
|
||||
|
||||
if (backBufferHandle)
|
||||
{
|
||||
UnmapViewOfFile(backBufferHandle);
|
||||
|
||||
@@ -39,5 +39,10 @@ namespace CefSharp
|
||||
CefBrowserHost::CreateBrowser(window, _renderClientAdapterInternal, url,
|
||||
*(CefBrowserSettings*) browserSettings->_internalBrowserSettings);
|
||||
}
|
||||
|
||||
void WasResized()
|
||||
{
|
||||
_renderClientAdapterInternal->WasResized();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user