From c6b745655fa811e067170900073d051ad4a39ee1 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 23 Dec 2021 21:21:53 +0100 Subject: [PATCH] Prevent asserts when setting bitmap buttons at a different DPI Closes #19353 --- src/msw/anybutton.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/msw/anybutton.cpp b/src/msw/anybutton.cpp index 9e871efbae..57a0d2fa7b 100644 --- a/src/msw/anybutton.cpp +++ b/src/msw/anybutton.cpp @@ -846,7 +846,8 @@ void wxAnyButton::DoSetBitmap(const wxBitmapBundle& bitmapBundle, State which) // Check if we already had bitmaps of different size. if ( m_imageData && - bitmapBundle.GetDefaultSize() != m_imageData->GetBitmapSize() ) + bitmapBundle.GetDefaultSize() != + m_imageData->GetBitmapBundle(State_Normal).GetDefaultSize() ) { wxASSERT_MSG( which == State_Normal, "Must set normal bitmap with the new size first" );