Consistently refuse to create bitmaps with 0 width or height.

Homogenize the behaviour of all ports when creating bitmaps with 0 width or
height: just fail always as it doesn't seem to make sense to support this.

Closes #16828.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78434 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2015-02-03 18:28:21 +00:00
parent 0c0484eaae
commit 3d2d8fc4ab
5 changed files with 25 additions and 4 deletions

View File

@@ -536,7 +536,7 @@ wxBitmap::~wxBitmap()
bool wxBitmap::Create( int width, int height, int depth )
{
UnRef();
wxCHECK_MSG(width >= 0 && height >= 0, false, "invalid bitmap size");
wxCHECK_MSG(width > 0 && height > 0, false, "invalid bitmap size");
m_refData = new wxBitmapRefData(width, height, depth);
return true;
}