From 49257f86bdb090d97c387183e8f600bbb8a7eef3 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 10 Jan 2011 16:46:48 +0100 Subject: QFont/Windows: restrict the pixel size accuracy Like on all other platforms, the pixel size accuracy is now restricted to two digits after the decimal point. Task-number: QTBUG-15688 Reviewed-by: Jiang Jiang --- src/gui/text/qfontdatabase_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qfontdatabase_win.cpp b/src/gui/text/qfontdatabase_win.cpp index c46369b..e2c5116 100644 --- a/src/gui/text/qfontdatabase_win.cpp +++ b/src/gui/text/qfontdatabase_win.cpp @@ -920,7 +920,7 @@ void QFontDatabase::load(const QFontPrivate *d, int script) // normalize the request to get better caching QFontDef req = d->request; if (req.pixelSize <= 0) - req.pixelSize = qreal((req.pointSize * d->dpi) / 72.); + req.pixelSize = floor((100.0 * req.pointSize * d->dpi) / 72. + 0.5) / 100; if (req.pixelSize < 1) req.pixelSize = 1; if (req.weight == 0) -- cgit v0.12