Don't use image index to get the size of the image in generic wxImageList

The index parameter should be ignored as all images in the list have
the same size (see docs). Native wxMSW implementation also works this
 way.
This commit is contained in:
Artur Wieczorek 2021-04-04 21:08:32 +02:00
parent f1c3ff4037
commit b6f4e5cf59

View File

@ -277,20 +277,12 @@ bool wxGenericImageList::RemoveAll()
return true;
}
bool wxGenericImageList::GetSize( int index, int &width, int &height ) const
bool wxGenericImageList::GetSize( int WXUNUSED(index), int &width, int &height ) const
{
wxASSERT_MSG( m_size != wxSize(0, 0), "Invalid image list" );
width = m_size.x;
height = m_size.y;
const wxBitmap* bmp = DoGetPtr(index);
if ( !bmp )
{
width = 0;
height = 0;
return false;
}
width = bmp->GetScaledWidth();
height = bmp->GetScaledHeight();
wxCHECK_MSG( m_size != wxSize(0, 0), false, "Invalid image list" );
return true;
}