Don't create a bitmap with dimensions <= 0...

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11837 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2001-10-04 19:15:17 +00:00
parent 1650623133
commit 2beb01db00
2 changed files with 4 additions and 0 deletions

View File

@ -174,6 +174,8 @@ void Surface::InitPixMap(int width, int height, Surface *surface_) {
Release();
hdc = new wxMemoryDC(surface_->hdc);
hdcOwned = true;
if (width < 1) width = 1;
if (height < 1) height = 1;
bitmap = new wxBitmap(width, height);
((wxMemoryDC*)hdc)->SelectObject(*bitmap);
}

View File

@ -174,6 +174,8 @@ void Surface::InitPixMap(int width, int height, Surface *surface_) {
Release();
hdc = new wxMemoryDC(surface_->hdc);
hdcOwned = true;
if (width < 1) width = 1;
if (height < 1) height = 1;
bitmap = new wxBitmap(width, height);
((wxMemoryDC*)hdc)->SelectObject(*bitmap);
}