summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainter.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-07-12 16:11:03 +0200
committerQt by Nokia <qt-info@nokia.com>2011-07-12 16:11:03 +0200
commit2770415f921d494e30e9a770c40b538d223351d6 (patch)
tree929f375ef83033efd5c463d181494b3ca37bfa3f /src/gui/painting/qpainter.cpp
parent992ef929dff21e079f7d8a207c07dbfd0c3c8f78 (diff)
parent2371147354d4436bb54c588662ac315dd4c2f940 (diff)
Merge "Merge remote branch 'gerrit/master' into refactor" into refactor
Diffstat (limited to 'src/gui/painting/qpainter.cpp')
-rw-r--r--src/gui/painting/qpainter.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index be5c41ce76..d5b9f97378 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -1291,7 +1291,7 @@ void QPainterPrivate::updateState(QPainterState *newState)
\o \inlineimage qpainter-compositiondemo.png
\o
- \bold {Composition Modes Demo}
+ \bold {Composition Modes Example}
The \l {painting/composition}{Composition Modes} example, available in
Qt's examples directory, allows you to experiment with the various
@@ -6503,6 +6503,10 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
qreal x = p.x();
qreal y = p.y();
+ bool rtl = ti.flags & QTextItem::RightToLeft;
+ if (rtl)
+ x += ti.width.toReal();
+
int start = 0;
int end, i;
for (end = 0; end < ti.glyphs.numGlyphs; ++end) {
@@ -6519,14 +6523,19 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
ti2.width += ti.glyphs.effectiveAdvance(i);
}
+ if (rtl)
+ x -= ti2.width.toReal();
+
d->engine->drawTextItem(QPointF(x, y), ti2);
+ if (!rtl)
+ x += ti2.width.toReal();
+
// reset the high byte for all glyphs and advance to the next sub-string
const int hi = which << 24;
for (i = start; i < end; ++i) {
glyphs.glyphs[i] = hi | glyphs.glyphs[i];
}
- x += ti2.width.toReal();
// change engine
start = end;
@@ -6541,6 +6550,9 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
ti2.width += ti.glyphs.effectiveAdvance(i);
}
+ if (rtl)
+ x -= ti2.width.toReal();
+
if (d->extended)
d->extended->drawTextItem(QPointF(x, y), ti2);
else