summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontdatabase_win.cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2011-01-10 16:46:48 +0100
committerJoerg Bornemann <joerg.bornemann@nokia.com>2011-01-10 17:31:55 +0100
commit49257f86bdb090d97c387183e8f600bbb8a7eef3 (patch)
tree9d88b038d658b420b246ce4ea4706996a9f90a59 /src/gui/text/qfontdatabase_win.cpp
parentac5c099cc3c5b8c7eec7a49fdeb8a21037230350 (diff)
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
Diffstat (limited to 'src/gui/text/qfontdatabase_win.cpp')
-rw-r--r--src/gui/text/qfontdatabase_win.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qfontdatabase_win.cpp b/src/gui/text/qfontdatabase_win.cpp
index c46369bccf..e2c5116d87 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)