]> git.saurik.com Git - wxWidgets.git/commitdiff
don't erase the background of wxHtmlWindow unconditionally
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 9 Feb 2005 18:33:00 +0000 (18:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 9 Feb 2005 18:33:00 +0000 (18:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31875 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/html/htmlwin.cpp

index 6acacdb8f63c2373a4e74e1f3a7e34d3f8ee8924..089483b2da1dd33530b24822db3374adea7516dd 100644 (file)
@@ -867,9 +867,16 @@ void wxHtmlWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
     if ( !m_backBuffer )
         m_backBuffer = new wxBitmap(sz.x, sz.y);
     dcm.SelectObject(*m_backBuffer);
-    dcm.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID));
-    dcm.Clear();
     PrepareDC(dcm);
+
+    // preserve the existing background, otherwise we'd erase anything the user
+    // code had drawn in its EVT_ERASE_BACKGROUND handler when we do the Blit
+    // back below
+    dcm.Blit(0, rect.GetTop(),
+             sz.x, rect.GetBottom() - rect.GetTop() + 1,
+             &dc,
+             0, rect.GetTop());
+
     dcm.SetMapMode(wxMM_TEXT);
     dcm.SetBackgroundMode(wxTRANSPARENT);