diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-05-06 08:25:20 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-05-06 08:43:46 (GMT) |
commit | 55446d104db77fc7994ab12352b1c08bb7b63346 (patch) | |
tree | c68835aba68881396eb5b11069d14a986e40db08 /src/gui/painting/qpainter.cpp | |
parent | b81e1b76231dfe41de1857e87d4f6bf918c609a6 (diff) | |
download | Qt-55446d104db77fc7994ab12352b1c08bb7b63346.zip Qt-55446d104db77fc7994ab12352b1c08bb7b63346.tar.gz Qt-55446d104db77fc7994ab12352b1c08bb7b63346.tar.bz2 |
Fix QPainter::drawGlyphs() with non-affine transformation
When the matrix has an non-affine transformation, the text will have to
be rendered using the default path-renderer. This means going through
the drawTextItem() path (since drawStaticText() has no support for those
transformations) and it also means not pre-transforming the coordinates,
since the default implementation of drawTextItem() supports
transformations.
Task-number: QTBUG-18214
Reviewed-by: Jiang Jiang
Diffstat (limited to 'src/gui/painting/qpainter.cpp')
-rw-r--r-- | src/gui/painting/qpainter.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 9e28102..ee960d1 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -5819,6 +5819,13 @@ void QPainter::drawGlyphs(const QPointF &position, const QGlyphs &glyphs) d->extended != 0 ? qt_paintengine_supports_transformations(d->extended->type()) : qt_paintengine_supports_transformations(d->engine->type()); + + // If the matrix is not affine, the paint engine will fall back to + // drawing the glyphs as paths, which in turn means we should not + // preprocess the glyph positions + if (!d->state->matrix.isAffine()) + paintEngineSupportsTransformations = true; + for (int i=0; i<count; ++i) { QPointF processedPosition = position + glyphPositions.at(i); if (!paintEngineSupportsTransformations) @@ -5862,7 +5869,7 @@ void QPainterPrivate::drawGlyphs(quint32 *glyphArray, QFixedPoint *positions, in QFixed width = rightMost - leftMost; - if (extended != 0) { + if (extended != 0 && state->matrix.isAffine()) { QStaticTextItem staticTextItem; staticTextItem.color = state->pen.color(); staticTextItem.font = state->font; |