diff options
Diffstat (limited to 'src/gui/painting/qtextureglyphcache.cpp')
-rw-r--r-- | src/gui/painting/qtextureglyphcache.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 215eb75e32..a67cbfacc1 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<GlyphAndSubPixelPosition, Coord> 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; |