Properly round font size

Use MulDiv for proper rounding to nearest integer.

Fixes #1547.
This commit is contained in:
ge0rdi
2023-05-22 19:41:08 +02:00
parent 2130047bd6
commit 9c149334fa
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -2701,7 +2701,7 @@ LRESULT CTreeSettingsDlg::OnBrowse( WORD wNotifyCode, WORD wID, HWND hWndCtl, BO
else if (_wcsicmp(token,L"bold_italic")==0)
font.lfWeight=FW_BOLD, font.lfItalic=1;
str=GetToken(str,token,_countof(token),L", \t");
font.lfHeight=-(_wtol(token)*dpi+36)/72;
font.lfHeight=-MulDiv(_wtol(token),dpi,72);
CHOOSEFONT choose={sizeof(choose),m_hWnd,NULL,&font};
choose.Flags=CF_NOSCRIPTSEL;