Draw, CtrlLib, ide: Fixed problem with GetAveWidth being unreliable

git-svn-id: svn://ultimatepp.org/upp/trunk@15842 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2021-03-13 08:24:08 +00:00
parent c19b5b1421
commit 95fb7897ec
5 changed files with 24 additions and 11 deletions

View file

@ -391,12 +391,10 @@ void TextCompareCtrl::SetFont(Font f, Font nf)
{
font = f;
number_font = nf;
FontInfo fi = f.Info();
FontInfo ni = nf.Info();
letter.cy = fi.GetHeight();
letter.cx = fi.GetAveWidth();
number_width = 5 * ni.GetAveWidth();
number_yshift = (fi.GetHeight() - ni.GetHeight() + 2) >> 1;
letter.cy = f.GetHeight();
letter.cx = f.GetMonoWidth();
number_width = 5 * nf.GetMonoWidth();
number_yshift = (f.GetHeight() - nf.GetHeight() + 2) >> 1;
Layout();
}