summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 8489daf794..b6da578f26 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1090,6 +1090,8 @@ bool QGL2PaintEngineExPrivate::prepareForCachedGlyphDraw(const QFontEngineGlyphC
{
Q_Q(QGL2PaintEngineEx);
+ Q_ASSERT(cache.transform().type() <= QTransform::TxScale);
+
QTransform &transform = q->state()->matrix;
transform.scale(1.0 / cache.transform().m11(), 1.0 / cache.transform().m22());
bool ret = prepareForDraw(false);
@@ -1594,7 +1596,11 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
// We allow scaling, so that the glyph-cache will contain glyphs with the
// appropriate resolution in the case of displays with a device-pixel-ratio != 1.
- QTransform transform = QTransform::fromScale(s->matrix.m11(), s->matrix.m22());
+ QTransform transform = s->matrix.type() < QTransform::TxRotate ?
+ QTransform::fromScale(qAbs(s->matrix.m11()), qAbs(s->matrix.m22())) :
+ QTransform::fromScale(
+ QVector2D(s->matrix.m11(), s->matrix.m12()).length(),
+ QVector2D(s->matrix.m21(), s->matrix.m22()).length());
QFontEngine *fe = staticTextItem->fontEngine();
QGLTextureGlyphCache *cache =