浏览代码

Bug 1544: Editor font too large on high DPI screens

https://winscp.net/tracker/1544

Source commit: 04455bb9a5d449b7323aba7c1087cda7e5c7306a
Martin Prikryl 8 年之前
父节点
当前提交
ca2c1890f3
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      source/forms/Editor.cpp
  2. 1 1
      source/forms/Preferences.cpp

+ 1 - 1
source/forms/Editor.cpp

@@ -200,7 +200,7 @@ void __fastcall TRichEdit20::ApplyFont()
 {
   std::unique_ptr<TFont> NewFont(new TFont());
   TWinConfiguration::RestoreFont(FFontConfiguration, NewFont.get());
-  NewFont->Height = ScaleByTextHeight(this, NewFont->Height);
+  NewFont->Size = ScaleByPixelsPerInchFromSystem(NewFont->Size, this);
   NewFont->Color = GetWindowTextColor(FFontColor);
   // setting DefAttributes may take quite time, even if the font attributes
   // do not change, so avoid that if not necessary

+ 1 - 1
source/forms/Preferences.cpp

@@ -1162,7 +1162,7 @@ void __fastcall TPreferencesDialog::UpdateControls()
     std::unique_ptr<TFont> EditorFont(new TFont());
     EditorFont->Assign(FEditorFont.get());
     EditorFont->Color = GetWindowTextColor(FEditorFont->Color);
-    EditorFont->Size = ScaleByTextHeight(this, FEditorFont->Size);
+    EditorFont->Size = ScaleByPixelsPerInchFromSystem(FEditorFont->Size, this);
     if (!SameFont(EditorFontLabel->Font, EditorFont.get()) ||
         (EditorFontLabel->Font->Color != EditorFont->Color))
     {