X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/837e57436a89516a5fa9f478f401e06bd872c17c..d1d7cdff87c64552187e1984d86c8f7a8b94fdb7:/src/msw/dc.cpp diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index f53d6d84f7..c5c2a08b64 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -295,14 +295,19 @@ int wxDC::GetDepth() const void wxDC::Clear() { RECT rect; - if (m_canvas) + if ( m_canvas ) + { GetClientRect((HWND) m_canvas->GetHWND(), &rect); - else if (m_selectedBitmap.Ok()) + } + else { + wxCHECK_RET( m_selectedBitmap.Ok(), _T("this DC can't be cleared") ); + rect.left = 0; rect.top = 0; rect.right = m_selectedBitmap.GetWidth(); rect.bottom = m_selectedBitmap.GetHeight(); } + (void) ::SetMapMode(GetHdc(), MM_TEXT); DWORD colour = GetBkColor(GetHdc());