]> git.saurik.com Git - wxWidgets.git/commitdiff
postpone the call to CopyAttributes() until the DC is fully initialized (closes ...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 4 Jun 2009 08:55:44 +0000 (08:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 4 Jun 2009 08:55:44 +0000 (08:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60891 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/dcbuffer.h
src/common/dcbufcmn.cpp

index e5c45a8247f1c4ba56d5cc13b71b72b680c123f1..7b54ecd7e8229fd7d99ae8389d6020899652c5da 100644 (file)
@@ -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
index 6ae9f3ef8240df581a5d6707601d971c8c487201..58d40b5f9b8bcec01cd5107f277e4e2672ba6e73 100644 (file)
@@ -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()