Ensure we never create empty bitmap in wxHtmlWindow::OnPaint().

Doing this resulted in an assert from wxBitmap ctor and was useless anyhow,
just skip the drawing code if the window is reduced to empty client area.
This commit is contained in:
Vadim Zeitlin
2015-06-21 15:37:24 +02:00
parent d5fda9d69b
commit bede8a3296

View File

@@ -1148,6 +1148,10 @@ void wxHtmlWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
const wxRect rect = GetUpdateRegion().GetBox();
const wxSize sz = GetClientSize();
// Don't bother drawing the empty window.
if ( sz.x == 0 || sz.y == 0 )
return;
// set up the DC we're drawing on: if the window is already double buffered
// we do it directly on wxPaintDC, otherwise we allocate a backing store
// buffer and compose the drawing there and then blit it to screen all at