From a96827606ef54312168c7f48aea419d36c4b2f43 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 4 Jun 2009 08:55:44 +0000 Subject: [PATCH] postpone the call to CopyAttributes() until the DC is fully initialized (closes #10867) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60891 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/dcbuffer.h | 4 ---- src/common/dcbufcmn.cpp | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/wx/dcbuffer.h b/include/wx/dcbuffer.h index e5c45a8247..7b54ecd7e8 100644 --- a/include/wx/dcbuffer.h +++ b/include/wx/dcbuffer.h @@ -116,10 +116,6 @@ private: m_dc = dc; m_style = style; - - // inherit the same layout direction as the original DC - if ( dc && dc->IsOk() ) - CopyAttributes(*dc); } // check that the bitmap is valid and use it diff --git a/src/common/dcbufcmn.cpp b/src/common/dcbufcmn.cpp index 6ae9f3ef82..58d40b5f9b 100644 --- a/src/common/dcbufcmn.cpp +++ b/src/common/dcbufcmn.cpp @@ -115,6 +115,11 @@ void wxBufferedDC::UseBuffer(wxCoord w, wxCoord h) } SelectObject(*m_buffer); + + // now that the DC is valid we can inherit the attributes (fonts, colours, + // layout direction, ...) from the original DC + if ( m_dc->IsOk() ) + CopyAttributes(*m_dc); } void wxBufferedDC::UnMask() -- 2.50.0