Fix font engine dependent text transformation
authorJiang Jiang <jiang.jiang@nokia.com>
Fri, 11 May 2012 13:03:57 +0000 (15:03 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 11 May 2012 15:39:13 +0000 (17:39 +0200)
The font engine used in supportsTransformation() should be the same
as the one used in drawCachedGlyphs. If it's a multi font engine we
should check the primary font engine inside it.

Change-Id: I384aab3c58edfe2e7ae6fe7fe96bef766053d3ef
Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
src/gui/painting/qpainter.cpp

index d6becf0..2a793a1 100644 (file)
@@ -5709,7 +5709,10 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText
         return;
     }
 
-    bool supportsTransformations = d->extended->supportsTransformations(staticText_d->font.d->engineForScript(QUnicodeTables::Common),
+    QFontEngine *fe = staticText_d->font.d->engineForScript(QUnicodeTables::Common);
+    if (fe->type() == QFontEngine::Multi)
+        fe = static_cast<QFontEngineMulti *>(fe)->engine(0);
+    bool supportsTransformations = d->extended->supportsTransformations(fe,
                                                                         d->state->matrix);
     if (supportsTransformations && !staticText_d->untransformedCoordinates) {
         staticText_d->untransformedCoordinates = true;