]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mgl/dc.cpp
fixed TLWs resizing to invalidate the DFB surface used for painting
[wxWidgets.git] / src / mgl / dc.cpp
index c3026cb75e1c0a58735631d895aec6dc4e2c95c8..312969a018b31029ebe15515035feb41d2b45595 100644 (file)
 #ifndef WX_PRECOMP
     #include "wx/dc.h"
     #include "wx/dcmemory.h"
+    #include "wx/log.h"
 #endif
 
 #include "wx/fontutil.h"
 #include "wx/encinfo.h"
 #include "wx/fontmap.h"
 #include "wx/mgl/private.h"
-#include "wx/log.h"
 
 #include <string.h>
 #include <mgraph.hpp>
@@ -1122,7 +1122,7 @@ void wxDC::SetBackground(const wxBrush& brush)
 {
     wxCHECK_RET( Ok(), wxT("invalid dc") );
 
-    if (!m_backgroundBrush.Ok()) return;
+    if (!brush.Ok()) return;
 
     m_backgroundBrush = brush;
     wxColour &clr = m_backgroundBrush.GetColour();
@@ -1433,17 +1433,19 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest,
     /* scale/translate size and position */
     wxCoord xx = XLOG2DEV(xdest);
     wxCoord yy = YLOG2DEV(ydest);
-    wxCoord ww = XLOG2DEVREL(width);
-    wxCoord hh = YLOG2DEVREL(height);
 
     if ( source->m_isMemDC )
     {
         wxMemoryDC *memDC = (wxMemoryDC*) source;
-        DoDrawSubBitmap(memDC->GetSelectedObject(), xsrc, ysrc, ww, hh,
+        DoDrawSubBitmap(memDC->GetSelectedObject(),
+                        xsrc, ysrc, width, height,
                         xdest, ydest, rop, useMask);
     }
     else
     {
+        wxCoord ww = XLOG2DEVREL(width);
+        wxCoord hh = YLOG2DEVREL(height);
+
         m_MGLDC->makeCurrent(); // will go away with MGL6.0
         m_MGLDC->bitBlt(*source->GetMGLDC(),
                         xsrc, ysrc, xsrc + ww, ysrc + hh,