diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2012-07-04 18:49:20 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-05 10:13:08 +0200 |
commit | 3f00617d4c822ddf18dbd523a6f832f61e11ca58 (patch) | |
tree | ef067fcb0c14d74f220c44e9ff3880719052efb3 | |
parent | 94a519372021708febd890d0cfe5c4be70948970 (diff) |
Use qFloor instead of qRound for glyph coordinates
Like we did in raster paint engine to make sure glyphs are positioned
correctly.
Change-Id: I1327b8727bd2b5085dfb2edc11b4d049403a2fb5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
-rw-r--r-- | src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index 33f02a8ac0..4c4f97ad34 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -50,6 +50,7 @@ #include <QtQuick/private/qsgtexture_p.h> #include <private/qrawfont_p.h> +#include <QtCore/qmath.h> QT_BEGIN_NAMESPACE @@ -214,8 +215,8 @@ void QSGTextMaskMaterial::populate(const QPointF &p, const QTextureGlyphCache::Coord &c = cache->coords.value(glyph); QPointF glyphPosition = glyphPositions.at(i) + position; - int x = qRound(glyphPosition.x()) + c.baseLineX - margin; - int y = qRound(glyphPosition.y()) - c.baseLineY - margin; + int x = qFloor(glyphPosition.x()) + c.baseLineX - margin; + int y = qFloor(glyphPosition.y()) - c.baseLineY - margin; *boundingRect |= QRectF(x + margin, y + margin, c.w, c.h); |