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:
@@ -174,6 +174,8 @@ void Surface::InitPixMap(int width, int height, Surface *surface_) {
|
|||||||
Release();
|
Release();
|
||||||
hdc = new wxMemoryDC(surface_->hdc);
|
hdc = new wxMemoryDC(surface_->hdc);
|
||||||
hdcOwned = true;
|
hdcOwned = true;
|
||||||
|
if (width < 1) width = 1;
|
||||||
|
if (height < 1) height = 1;
|
||||||
bitmap = new wxBitmap(width, height);
|
bitmap = new wxBitmap(width, height);
|
||||||
((wxMemoryDC*)hdc)->SelectObject(*bitmap);
|
((wxMemoryDC*)hdc)->SelectObject(*bitmap);
|
||||||
}
|
}
|
||||||
|
@@ -174,6 +174,8 @@ void Surface::InitPixMap(int width, int height, Surface *surface_) {
|
|||||||
Release();
|
Release();
|
||||||
hdc = new wxMemoryDC(surface_->hdc);
|
hdc = new wxMemoryDC(surface_->hdc);
|
||||||
hdcOwned = true;
|
hdcOwned = true;
|
||||||
|
if (width < 1) width = 1;
|
||||||
|
if (height < 1) height = 1;
|
||||||
bitmap = new wxBitmap(width, height);
|
bitmap = new wxBitmap(width, height);
|
||||||
((wxMemoryDC*)hdc)->SelectObject(*bitmap);
|
((wxMemoryDC*)hdc)->SelectObject(*bitmap);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user