From 29a48b2d76b855b2f7401a25d6114339208fd4d4 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 5 Feb 2010 13:03:42 +0100 Subject: Add explanatory comment to QGL2PaintEngineExPrivate::drawCachedGlyphs A small hack to turn off the current matrix when drawing QStaticText, since its coordinates are already transformed. --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index ed0f708..917a1a2 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1451,6 +1451,9 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp QBrush pensBrush = q->state()->pen.brush(); setBrush(pensBrush); + // When painting a QStaticTextItem, the glyph positions are already in device coordinates, + // therefore we temporarily set an identity matrix on the painter for the draw call to + // avoid transforming the positions twice. QTransform old = s->matrix; if (includeMatrixInCache) s->matrix = QTransform(); -- cgit v0.12