From 512d20c554e37b531f3ddbf17cab8db667a0f33e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 2 Jun 2022 22:58:57 +0100 Subject: [PATCH] Fix confusion between width and height in wxArtProvider Amazingly, the fact that the bitmap height was compared with the required width went unnoticed even though it was there since this code was added back in e53a95bcb1 (Applied patch for ArtProvider., 2005-03-12) and even survived migration to a different file in 2b7e668221 (Move bitmap resizing from wxDefaultArtProvider to base class, 2022-02-05). That this has never been a problem seems to conclusively prove that non-square icons simply don't exist, but still fix the comparisons just to be tidy. --- src/common/artprov.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/artprov.cpp b/src/common/artprov.cpp index 27e07ef535..fff39e7370 100644 --- a/src/common/artprov.cpp +++ b/src/common/artprov.cpp @@ -309,7 +309,7 @@ wxArtProvider::RescaleOrResizeIfNeeded(wxBitmap& bmp, const wxSize& sizeNeeded) return; #if wxUSE_IMAGE - if ((bmp_h <= sizeNeeded.x) && (bmp_w <= sizeNeeded.y)) + if ((bmp_w <= sizeNeeded.x) && (bmp_h <= sizeNeeded.y)) { // the caller wants default size, which is larger than // the image we have; to avoid degrading it visually by