]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't scale 16x15 to 16x16 - fixes corruption of bookmark icons in help window
authorJulian Smart <julian@anthemion.co.uk>
Tue, 13 Mar 2012 17:23:58 +0000 (17:23 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 13 Mar 2012 17:23:58 +0000 (17:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/artstd.cpp

index b6889e3f878ab50fb9d6f49c2e8de7e27466a0a5..3fa46d4d45afd7f2214f2fff5abaa341132dec71 100644 (file)
@@ -219,7 +219,12 @@ wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id,
                 int bmp_w = bmp.GetWidth();
                 int bmp_h = bmp.GetHeight();
 
                 int bmp_w = bmp.GetWidth();
                 int bmp_h = bmp.GetHeight();
 
-                if ((bmp_h < bestSize.x) && (bmp_w < bestSize.y))
+                if (bmp_w == 16 && bmp_h == 15 && bestSize == wxSize(16, 16))
+                {
+                    // Do nothing in this special but quite common case, because scaling
+                    // with only a pixel difference will look horrible.
+                }
+                else if ((bmp_h < bestSize.x) && (bmp_w < bestSize.y))
                 {
                     // the caller wants default size, which is larger than
                     // the image we have; to avoid degrading it visually by
                 {
                     // the caller wants default size, which is larger than
                     // the image we have; to avoid degrading it visually by