diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-07-07 16:06:16 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-07-07 16:06:16 (GMT) |
commit | 4f8978312a8897e27b2e548fe85f2a76402aa17a (patch) | |
tree | 47bbd865ea2d4603b271f01a8c9f1aac1c19e9c1 /src/gui/painting/qpainter.cpp | |
parent | 8bc5a6319455d7dc0655a8c48862ada8890b0064 (diff) | |
parent | 1fc2dcd798cf984d59568c1f681c830ce16bda1e (diff) | |
download | Qt-4f8978312a8897e27b2e548fe85f2a76402aa17a.zip Qt-4f8978312a8897e27b2e548fe85f2a76402aa17a.tar.gz Qt-4f8978312a8897e27b2e548fe85f2a76402aa17a.tar.bz2 |
Merge branch 4.7 into qt-4.8-from-4.7
Diffstat (limited to 'src/gui/painting/qpainter.cpp')
-rw-r--r-- | src/gui/painting/qpainter.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 435e12a..9bd9733 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -6646,6 +6646,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) { @@ -6662,14 +6666,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; @@ -6684,6 +6693,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 |