From 7bc0fe7e5802b6102de5b4545a6d10b5e58474b9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 21 Jun 2015 15:37:24 +0200 Subject: [PATCH] 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. (cherry picked from commit bede8a3296431f7883c37140e5047c43636b7289) --- src/html/htmlwin.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index bdace9971b..32bfcced27 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -1138,6 +1138,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