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
This commit is contained in:
Harley Acheson 2022-09-23 14:49:36 -07:00
parent ce63fea080
commit ff27b68f41
Notes: blender-bot 2023-02-14 06:55:40 +01:00
Referenced by issue #101295, .blend file thumbnails doesn't scale up properly on windows
1 changed files with 2 additions and 2 deletions

View File

@ -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);