From 27177c9cbc47d4114ccee56015fb0407e7e258cc Mon Sep 17 00:00:00 2001 From: B Stack Date: Tue, 12 Mar 2019 16:09:20 -0400 Subject: 10.10 --- wx+/image_tools.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'wx+/image_tools.h') diff --git a/wx+/image_tools.h b/wx+/image_tools.h index e1a6953c..b1df41e6 100644 --- a/wx+/image_tools.h +++ b/wx+/image_tools.h @@ -187,6 +187,10 @@ wxImage shrinkImage(const wxImage& img, int requestedSize) { const int maxExtent = std::max(img.GetWidth(), img.GetHeight()); assert(requestedSize <= maxExtent); + + if (requestedSize >= maxExtent) + return img; + return img.Scale(img.GetWidth () * requestedSize / maxExtent, img.GetHeight() * requestedSize / maxExtent, wxIMAGE_QUALITY_BILINEAR); //looks sharper than wxIMAGE_QUALITY_HIGH! } -- cgit