summaryrefslogtreecommitdiff
path: root/wx+/image_tools.h
diff options
context:
space:
mode:
Diffstat (limited to 'wx+/image_tools.h')
-rw-r--r--wx+/image_tools.h4
1 files changed, 4 insertions, 0 deletions
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!
}
bgstack15