Report failure while creating generic wxImageList with invalid image size

Native wxMSW implementation reports failure if dimensions <= 0.
This commit is contained in:
Artur Wieczorek 2021-04-04 21:05:06 +02:00
parent 51ff4ec08b
commit 032c443c42

View File

@ -46,11 +46,13 @@ int wxGenericImageList::GetImageCount() const
bool wxGenericImageList::Create( int width, int height, bool mask, int WXUNUSED(initialCount) )
{
m_size = wxSize(width, height);
// Prevent from storing negative dimensions
m_size = wxSize(wxMax(width, 0), wxMax(height, 0));
m_useMask = mask;
m_scaleFactor = 1.0;
return true;
// Images must have proper size
return m_size != wxSize(0, 0);
}
namespace