Prevent asserts when setting bitmap buttons at a different DPI

Closes #19353
This commit is contained in:
Maarten Bent 2021-12-23 21:21:53 +01:00
parent fe50693304
commit c6b745655f

View File

@ -846,7 +846,8 @@ void wxAnyButton::DoSetBitmap(const wxBitmapBundle& bitmapBundle, State which)
// Check if we already had bitmaps of different size. // Check if we already had bitmaps of different size.
if ( m_imageData && if ( m_imageData &&
bitmapBundle.GetDefaultSize() != m_imageData->GetBitmapSize() ) bitmapBundle.GetDefaultSize() !=
m_imageData->GetBitmapBundle(State_Normal).GetDefaultSize() )
{ {
wxASSERT_MSG( which == State_Normal, wxASSERT_MSG( which == State_Normal,
"Must set normal bitmap with the new size first" ); "Must set normal bitmap with the new size first" );