https://git.reactos.org/?p=reactos.git;a=commitdiff;h=30e47fdb773b819702f6b16b72c36a2c56b74493

commit 30e47fdb773b819702f6b16b72c36a2c56b74493
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Mon Dec 27 10:52:53 2021 +0900
Commit:     GitHub <[email protected]>
CommitDate: Mon Dec 27 10:52:53 2021 +0900

    [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.
---
 base/applications/mspaint/registry.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/base/applications/mspaint/registry.cpp 
b/base/applications/mspaint/registry.cpp
index 1bc47e93a6c..eb257e0cf3b 100644
--- a/base/applications/mspaint/registry.cpp
+++ b/base/applications/mspaint/registry.cpp
@@ -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()

Reply via email to