summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-08-24 13:06:39 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2010-09-02 06:02:04 (GMT)
commit1e0514ae6442ba159cd0e167ad2deea25d52859c (patch)
treec0fb6e3b14a0da0f4fd9cd572e286e7ed836a64f
parent1864ecabcaa21261629d56518a4b88b2d3e0d7ba (diff)
downloadQt-1e0514ae6442ba159cd0e167ad2deea25d52859c.zip
Qt-1e0514ae6442ba159cd0e167ad2deea25d52859c.tar.gz
Qt-1e0514ae6442ba159cd0e167ad2deea25d52859c.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 (cherry picked from commit f3771c5d91995b2beaa73bd3e3c783b76a887b50)
-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;
}