From ba588fd072e84a9596a402b622adf78d0cb111db Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 3 Apr 2021 18:52:23 +0200 Subject: [PATCH] Take into account scale actor while resizing the image in generic wxImageList Too small image needs to be resized to the required physical size first and next converted to wxBitmap with actual scale factor. --- src/generic/imaglist.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index e6f6763195..94a7781eaa 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -132,8 +132,9 @@ wxBitmap GetImageListBitmap(const wxBitmap& bitmap, bool useMask, const wxSize& { #if wxUSE_IMAGE wxImage img = bmp.ConvertToImage(); - wxImage imgResized = img.Size(imgSize, wxPoint(0, 0), 0, 0, 0); - bmpResized = imgResized; + // We need image with new physical size + wxImage imgResized = img.Size(scaleFactor * imgSize, wxPoint(0, 0), 0, 0, 0); + bmpResized = wxBitmap(imgResized, -1, scaleFactor); #else bmpResized = bmp; #endif // wxUSE_IMAGE