From eb52e8655350f06ff30b1cc876459b3332175e44 Mon Sep 17 00:00:00 2001 From: Daniel Kulp Date: Sat, 3 Apr 2021 18:03:33 +0200 Subject: [PATCH] Take into account scale factor of images added to wxImageList Closes #19114. --- src/generic/imaglist.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index daf2aa647b..bf880c6d2a 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -69,7 +69,7 @@ wxBitmap GetImageListBitmap(const wxBitmap& bitmap, bool useMask, const wxSize& #if wxUSE_IMAGE wxImage img = bmp.ConvertToImage(); img.ClearAlpha(); - bmp = img; + bmp = wxBitmap(img, -1, bmp.GetScaleFactor()); #endif // wxUSE_IMAGE } } @@ -81,7 +81,7 @@ wxBitmap GetImageListBitmap(const wxBitmap& bitmap, bool useMask, const wxSize& #if wxUSE_IMAGE wxImage img = bmp.ConvertToImage(); img.ConvertAlphaToMask(); - bmp = img; + bmp = wxBitmap(img, -1, bmp.GetScaleFactor()); #endif // wxUSE_IMAGE } else @@ -107,7 +107,7 @@ wxBitmap GetImageListBitmap(const wxBitmap& bitmap, bool useMask, const wxSize& #if wxUSE_IMAGE wxImage img = bmp.ConvertToImage(); img.InitAlpha(); - bmp = img; + bmp = wxBitmap(img, -1, bmp.GetScaleFactor()); #else bmp.SetMask(NULL); #endif // wxUSE_IMAGE @@ -117,7 +117,7 @@ wxBitmap GetImageListBitmap(const wxBitmap& bitmap, bool useMask, const wxSize& // Ensure image size is the same as the size of the images on the image list. wxBitmap bmpResized; - const wxSize sz = bmp.GetSize(); + const wxSize sz = bmp.GetScaledSize(); if ( sz.x == imgSize.x && sz.y == imgSize.y ) { bmpResized = bmp;