Reuse wxNativeFontInfo::GetLogFontHeightAtPPI()
Instead of calling ::MulDiv() directly, reuse GetLogFontHeightAtPPI() as it is more readable.
This commit is contained in:
@@ -3124,7 +3124,7 @@ bool wxTextCtrl::GetStyle(long position, wxTextAttr& style)
|
|||||||
// Convert the height from the units of 1/20th of the point in which
|
// Convert the height from the units of 1/20th of the point in which
|
||||||
// CHARFORMAT stores it to pixel-based units used by LOGFONT.
|
// CHARFORMAT stores it to pixel-based units used by LOGFONT.
|
||||||
const wxCoord ppi = wxClientDC(this).GetPPI().y;
|
const wxCoord ppi = wxClientDC(this).GetPPI().y;
|
||||||
lf.lfHeight = -MulDiv(cf.yHeight/20, ppi, 72);
|
lf.lfHeight = wxNativeFontInfo::GetLogFontHeightAtPPI(cf.yHeight/20.0f, ppi);
|
||||||
lf.lfWidth = 0;
|
lf.lfWidth = 0;
|
||||||
lf.lfCharSet = ANSI_CHARSET; // FIXME: how to get correct charset?
|
lf.lfCharSet = ANSI_CHARSET; // FIXME: how to get correct charset?
|
||||||
lf.lfClipPrecision = 0;
|
lf.lfClipPrecision = 0;
|
||||||
|
Reference in New Issue
Block a user