Don't store negative dimensions for images in wxImageList

This commit is contained in:
Artur Wieczorek
2021-04-04 20:59:00 +02:00
parent 2ed7355d5c
commit d6443e65ee

View File

@@ -73,7 +73,8 @@ wxImageList::wxImageList()
// Creates an image list // Creates an image list
bool wxImageList::Create(int width, int height, bool mask, int initial) bool wxImageList::Create(int width, int height, bool mask, int initial)
{ {
m_size = wxSize(width, height); // Prevent from storing negative dimensions
m_size = wxSize(wxMax(width, 0), wxMax(height, 0));
UINT flags = 0; UINT flags = 0;
// as we want to be able to use 32bpp bitmaps in the image lists, we always // as we want to be able to use 32bpp bitmaps in the image lists, we always