]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dcgraph.cpp
Compilation fixes for wx{X11,GTK1,Motif} after making ref data non copyable.
[wxWidgets.git] / src / common / dcgraph.cpp
index 66a531bb47e0d2323de3f2993b2522d499d8f100..9206732e715a1a4312ba7dbf29fea1580d073ed7 100644 (file)
@@ -57,8 +57,10 @@ static bool TranslateRasterOp(wxRasterOperationMode function, wxCompositionMode
 {
     switch ( function )
     {
-        case wxCOPY:       // (default) src
-            *op = wxCOMPOSITION_SOURCE; //
+        case wxCOPY: // src
+            // since we are supporting alpha, _OVER is closer to the intention than _SOURCE
+            // since the latter would overwrite even when alpha is is not set to opaque
+            *op = wxCOMPOSITION_OVER; 
             break;
         case wxOR:         // src OR dst
             *op = wxCOMPOSITION_ADD;
@@ -1047,7 +1049,10 @@ void wxGCDCImpl::Clear(void)
     m_graphicContext->SetBrush( m_backgroundBrush );
     wxPen p = *wxTRANSPARENT_PEN;
     m_graphicContext->SetPen( p );
+    wxCompositionMode formerMode = m_graphicContext->GetCompositionMode();
+    m_graphicContext->SetCompositionMode(wxCOMPOSITION_SOURCE);
     DoDrawRectangle( 0, 0, 32000 , 32000 );
+    m_graphicContext->SetCompositionMode(formerMode);
     m_graphicContext->SetPen( m_pen );
     m_graphicContext->SetBrush( m_brush );
 }