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:
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
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue