mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-04-11 17:37:22 +10:00
Properly round font size
Use MulDiv for proper rounding to nearest integer. Fixes #1547.
This commit is contained in:
@@ -149,7 +149,7 @@ LRESULT CUpdateDlg::OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
|
||||
HDC hdc=::GetDC(NULL);
|
||||
int dpi=GetDeviceCaps(hdc,LOGPIXELSY);
|
||||
::ReleaseDC(NULL,hdc);
|
||||
m_Font=CreateFont(-9*dpi/72,0,0,0,FW_NORMAL,0,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FIXED_PITCH,L"Consolas");
|
||||
m_Font=CreateFont(-MulDiv(9,dpi,72),0,0,0,FW_NORMAL,0,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FIXED_PITCH,L"Consolas");
|
||||
if (m_Font)
|
||||
GetDlgItem(IDC_EDITTEXT).SetFont(m_Font);
|
||||
m_Tooltip.Create(TOOLTIPS_CLASS,m_hWnd,NULL,NULL,WS_POPUP|TTS_NOPREFIX);
|
||||
|
||||
Reference in New Issue
Block a user