X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a7cfad3ad6bc8080b33a0878a14b1c02ca33fe3e..4164a04a98be1066038317c2d16438cce3f59c81:/src/common/artstd.cpp diff --git a/src/common/artstd.cpp b/src/common/artstd.cpp index c12a849c9d..3fa46d4d45 100644 --- a/src/common/artstd.cpp +++ b/src/common/artstd.cpp @@ -20,6 +20,8 @@ #pragma hdrstop #endif +#if wxUSE_ARTPROVIDER_STD + #ifndef WX_PRECOMP #include "wx/image.h" #endif @@ -43,7 +45,7 @@ protected: /*static*/ void wxArtProvider::InitStdProvider() { - wxArtProvider::Push(new wxDefaultArtProvider); + wxArtProvider::PushBack(new wxDefaultArtProvider); } // ---------------------------------------------------------------------------- @@ -205,7 +207,7 @@ wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id, wxBitmap bmp = wxDefaultArtProvider_CreateBitmap(id); #if wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB) - if (bmp.Ok()) + if (bmp.IsOk()) { // fit into transparent image with desired size hint from the client if (reqSize == wxDefaultSize) @@ -217,7 +219,12 @@ wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id, 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 @@ -246,3 +253,5 @@ wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id, return bmp; } + +#endif // wxUSE_ARTPROVIDER_STD