Avoid creating empty bitmap in MSW wxNotebook::OnPaint()
It can apparently happen that the window has 0 size and in this creating the bitmap is useless and just triggers an assert. Closes #18879.
This commit is contained in:
parent
e094734a89
commit
b48c46285c
1 changed files with 4 additions and 2 deletions
|
|
@ -787,11 +787,13 @@ void wxNotebook::OnEraseBackground(wxEraseEvent& WXUNUSED(event))
|
|||
void wxNotebook::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
wxMemoryDC memdc;
|
||||
RECT rc;
|
||||
::GetClientRect(GetHwnd(), &rc);
|
||||
if ( !rc.right || !rc.bottom )
|
||||
return;
|
||||
|
||||
wxBitmap bmp(rc.right, rc.bottom);
|
||||
memdc.SelectObject(bmp);
|
||||
wxMemoryDC memdc(bmp);
|
||||
|
||||
const wxLayoutDirection dir = dc.GetLayoutDirection();
|
||||
memdc.SetLayoutDirection(dir);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue