Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Acheson <harley.acheson@gmail.com>2022-09-24 00:49:36 +0300
committerHarley Acheson <harley.acheson@gmail.com>2022-09-24 00:49:36 +0300
commitff27b68f41ce511e162d6e561103c522d9507a5f (patch)
tree7953bd39fa9a80e9e21aaff3d64756b95257b15b /source/blender/blendthumb
parentce63fea080ce3e171375d4c788a503ddca6ab668 (diff)
Fix T101295: Allow Large Windows Thumbnails
Allow our Windows Thumbnail Handler to supply thumbnails up to the maximum 256x256 size. Differential Revision: https://developer.blender.org/D16051 Reviewed by Ray Molenkamp
Diffstat (limited to 'source/blender/blendthumb')
-rw-r--r--source/blender/blendthumb/src/blendthumb_win32.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blendthumb/src/blendthumb_win32.cc b/source/blender/blendthumb/src/blendthumb_win32.cc
index 287710934e2..2acc8f20a12 100644
--- a/source/blender/blendthumb/src/blendthumb_win32.cc
+++ b/source/blender/blendthumb/src/blendthumb_win32.cc
@@ -171,8 +171,8 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE
}
*pdwAlpha = WTSAT_ARGB;
- /* Scale down the thumbnail if required. */
- if ((unsigned)thumb.width > cx || (unsigned)thumb.height > cx) {
+ /* Scale up the thumbnail if required. */
+ if ((unsigned)thumb.width < cx && (unsigned)thumb.height < cx) {
float scale = 1.0f / (std::max(thumb.width, thumb.height) / (float)cx);
LONG NewWidth = (LONG)(thumb.width * scale);
LONG NewHeight = (LONG)(thumb.height * scale);