[MSPAINT] Fix the size of settings if too large (#4189)

- Fix the initial values of BMPHeight and BMPWidth.
- Fix the values of BMPHeight and BMPWidth if too large.
This commit is contained in:
Katayama Hirofumi MZ 2021-12-27 10:52:53 +09:00 committed by GitHub
parent 98775c4c83
commit 30e47fdb77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,8 +50,8 @@ void RegistrySettings::SetWallpaper(LPCTSTR szFileName, RegistrySettings::Wallpa
void RegistrySettings::LoadPresets()
{
BMPHeight = 300;
BMPWidth = 400;
BMPHeight = GetSystemMetrics(SM_CYSCREEN) / 2;
BMPWidth = GetSystemMetrics(SM_CXSCREEN) / 2;
GridExtent = 1;
NoStretching = 0;
ShowThumbnail = 0;
@ -103,6 +103,12 @@ void RegistrySettings::Load()
ReadFileHistory(files, _T("File3"), strFile3);
ReadFileHistory(files, _T("File4"), strFile4);
}
// Fix the bitmap size if too large
if (BMPWidth > 5000)
BMPWidth = (GetSystemMetrics(SM_CXSCREEN) * 6) / 10;
if (BMPHeight > 5000)
BMPHeight = (GetSystemMetrics(SM_CYSCREEN) * 6) / 10;
}
void RegistrySettings::Store()