an assert added to check that we're not doing something stupid

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2869 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 1999-06-22 21:18:31 +00:00
parent a622c15240
commit 2506aab63c

View File

@ -295,14 +295,19 @@ int wxDC::GetDepth() const
void wxDC::Clear()
{
RECT rect;
if (m_canvas)
GetClientRect((HWND) m_canvas->GetHWND(), &rect);
else if (m_selectedBitmap.Ok())
if ( m_canvas )
{
GetClientRect((HWND) m_canvas->GetHWND(), &rect);
}
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());