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:
parent
f1c3ff4037
commit
b6f4e5cf59
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user