summaryrefslogtreecommitdiff
path: root/wx+/image_tools.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2019-03-12 16:09:20 -0400
committerB Stack <bgstack15@gmail.com>2019-03-12 16:09:20 -0400
commit27177c9cbc47d4114ccee56015fb0407e7e258cc (patch)
treedc226d83311470a23cdf0c02064feb525fcc5096 /wx+/image_tools.h
parentMerge branch '10.9' into 'master' (diff)
downloadFreeFileSync-27177c9cbc47d4114ccee56015fb0407e7e258cc.tar.gz
FreeFileSync-27177c9cbc47d4114ccee56015fb0407e7e258cc.tar.bz2
FreeFileSync-27177c9cbc47d4114ccee56015fb0407e7e258cc.zip
10.10
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