aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/quick/scenegraph/qsgdefaultglyphnode_p.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
index cfa645bfd0..f73b64f537 100644
--- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
+++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
@@ -789,11 +789,12 @@ void QSGTextMaskMaterial::populate(const QPointF &p,
const QMargins &margins)
{
Q_ASSERT(m_font.isValid());
+ QPointF position(p.x(), p.y() - m_font.ascent());
QVector<QFixedPoint> fixedPointPositions;
const int glyphPositionsSize = glyphPositions.size();
fixedPointPositions.reserve(glyphPositionsSize);
for (int i=0; i < glyphPositionsSize; ++i)
- fixedPointPositions.append(QFixedPoint::fromPointF(glyphPositions.at(i)));
+ fixedPointPositions.append(QFixedPoint::fromPointF(position + glyphPositions.at(i)));
QTextureGlyphCache *cache = glyphCache();
@@ -815,18 +816,16 @@ void QSGTextMaskMaterial::populate(const QPointF &p,
Q_ASSERT(geometry->sizeOfVertex() == sizeof(QVector4D));
ushort *ip = geometry->indexDataAsUShort();
- QPointF position(p.x(), p.y() - m_font.ascent());
bool supportsSubPixelPositions = fontD->fontEngine->supportsSubPixelPositions();
for (int i=0; i<glyphIndexes.size(); ++i) {
+ QPointF glyphPosition = glyphPositions.at(i) + position;
QFixed subPixelPosition;
if (supportsSubPixelPositions)
- subPixelPosition = fontD->fontEngine->subPixelPositionForX(QFixed::fromReal(glyphPositions.at(i).x()));
+ subPixelPosition = fontD->fontEngine->subPixelPositionForX(QFixed::fromReal(glyphPosition.x()));
QTextureGlyphCache::GlyphAndSubPixelPosition glyph(glyphIndexes.at(i), subPixelPosition);
const QTextureGlyphCache::Coord &c = cache->coords.value(glyph);
- QPointF glyphPosition = glyphPositions.at(i) + position;
-
// On a retina screen the glyph positions are not pre-scaled (as opposed to
// eg. the raster paint engine). To ensure that we get the same behavior as
// the raster engine (and CoreText itself) when it comes to rounding of the