summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-08-24 13:06:39 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-08-24 13:34:49 (GMT)
commitf3771c5d91995b2beaa73bd3e3c783b76a887b50 (patch)
tree2f6f0af4221d3203de3ef0f58ff9e0047f70cd95 /src/gui
parentf58296de0d88f1b7f58efbabbb12a9e8afe6828c (diff)
downloadQt-f3771c5d91995b2beaa73bd3e3c783b76a887b50.zip
Qt-f3771c5d91995b2beaa73bd3e3c783b76a887b50.tar.gz
Qt-f3771c5d91995b2beaa73bd3e3c783b76a887b50.tar.bz2
Fix mispositioned text with QStaticText and OpenVG graphics system
The OpenVG paint engine, like the OpenGL2 paint engine, supports caching the untransformed glyphs and transforming them as they are drawn. Since we would pretransform the positions of the glyphs, the transformation would be applied twice, thus making the glyphs appear in the wrong location when the painter had a transform set. Task-number: QTBUG-13049 Reviewed-by: Gunnar
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qpainter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index b694d9c..be90006 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5862,10 +5862,13 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText
return;
}
- if (d->extended->type() == QPaintEngine::OpenGL2 && !staticText_d->untransformedCoordinates) {
+ bool paintEngineSupportsTransformations = d->extended->type() == QPaintEngine::OpenGL2
+ || d->extended->type() == QPaintEngine::OpenVG;
+
+ if (paintEngineSupportsTransformations && !staticText_d->untransformedCoordinates) {
staticText_d->untransformedCoordinates = true;
staticText_d->needsRelayout = true;
- } else if (d->extended->type() != QPaintEngine::OpenGL2 && staticText_d->untransformedCoordinates) {
+ } else if (!paintEngineSupportsTransformations && staticText_d->untransformedCoordinates) {
staticText_d->untransformedCoordinates = false;
staticText_d->needsRelayout = true;
}