X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8d7eaf91403705cdd94acaae0d7413e711cce3dc..79b7b95aed76eb742deef93d046886c20452fb36:/src/msw/dcclient.cpp diff --git a/src/msw/dcclient.cpp b/src/msw/dcclient.cpp index d318904387..75c1c9a550 100644 --- a/src/msw/dcclient.cpp +++ b/src/msw/dcclient.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dcclient.cpp +// Name: src/msw/dcclient.cpp // Purpose: wxClientDC class // Author: Julian Smart // Modified by: @@ -24,13 +24,15 @@ #pragma hdrstop #endif -#include "wx/string.h" -#include "wx/log.h" -#include "wx/window.h" +#include "wx/dcclient.h" -#include "wx/msw/private.h" +#ifndef WX_PRECOMP + #include "wx/string.h" + #include "wx/log.h" + #include "wx/window.h" +#endif -#include "wx/dcclient.h" +#include "wx/msw/private.h" // ---------------------------------------------------------------------------- // array/list types @@ -236,10 +238,16 @@ wxPaintDC::wxPaintDC(wxWindow *canvas) ms_cache.Add(new wxPaintDCInfo(m_canvas, this)); } - // (re)set the DC parameters. // Note: at this point m_hDC can be NULL under MicroWindows, when dragging. - if (GetHDC()) - InitDC(); + if (!GetHDC()) + return; + + // (re)set the DC parameters. + InitDC(); + + // the HDC can have a clipping box (which we didn't set), make sure our + // DoGetClippingBox() checks for it + m_clipping = true; } wxPaintDC::~wxPaintDC() @@ -353,4 +361,3 @@ wxPaintDCEx::~wxPaintDCEx() // prevent the base class dtor from ReleaseDC()ing it again m_hDC = 0; } -