diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 215eb75e327..a67cbfacc1b 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -60,7 +60,8 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions, - QPainter::RenderHints renderHints) + QPainter::RenderHints renderHints, + bool includeGlyphCacheScale) { #ifdef CACHE_DEBUG printf("Populating with %d glyphs\n", numGlyphs); @@ -89,6 +90,9 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, m_cy = padding; } + qreal glyphCacheScaleX = transform().m11(); + qreal glyphCacheScaleY = transform().m22(); + QHash listItemCoordinates; int rowHeight = 0; @@ -99,6 +103,10 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, QFixedPoint subPixelPosition; if (supportsSubPixelPositions) { QFixedPoint pos = positions != nullptr ? positions[i] : QFixedPoint(); + if (includeGlyphCacheScale) { + pos = QFixedPoint(QFixed::fromReal(pos.x.toReal() * glyphCacheScaleX), + QFixed::fromReal(pos.y.toReal() * glyphCacheScaleY)); + } subPixelPosition = fontEngine->subPixelPositionFor(pos); if (!verticalSubPixelPositions) subPixelPosition.y = 0; diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h index bf6b07f36f3..4c18b302856 100644 --- a/src/gui/painting/qtextureglyphcache_p.h +++ b/src/gui/painting/qtextureglyphcache_p.h @@ -78,7 +78,8 @@ public: int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions, - QPainter::RenderHints renderHints = QPainter::RenderHints()); + QPainter::RenderHints renderHints = QPainter::RenderHints(), + bool includeGlyphCacheScale = false); bool hasPendingGlyphs() const { return !m_pendingGlyphs.isEmpty(); } void fillInPendingGlyphs();