diff options
author | Jerome Pasion <jerome.pasion@nokia.com> | 2011-07-08 11:17:37 (GMT) |
---|---|---|
committer | Jerome Pasion <jerome.pasion@nokia.com> | 2011-07-08 11:17:37 (GMT) |
commit | f037c0e87d186a01f07cb9aa360dcc496d11145e (patch) | |
tree | 9449cc65b856b4743e933cf2b8ae1cb2f85ba9fd /src/gui/painting | |
parent | 5016de08d84c4d2887f7424dbf17f31e27c2e8e2 (diff) | |
parent | 1dd26ea2486db87b61e8e9f70a1e04f7386405ef (diff) | |
download | Qt-f037c0e87d186a01f07cb9aa360dcc496d11145e.zip Qt-f037c0e87d186a01f07cb9aa360dcc496d11145e.tar.gz Qt-f037c0e87d186a01f07cb9aa360dcc496d11145e.tar.bz2 |
Merge remote branch 'upstream/4.8'
Conflicts:
doc/src/external-resources.qdoc
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qgraphicssystemfactory.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/gui/painting/qgraphicssystemfactory.cpp b/src/gui/painting/qgraphicssystemfactory.cpp index 4309140..01ece09 100644 --- a/src/gui/painting/qgraphicssystemfactory.cpp +++ b/src/gui/painting/qgraphicssystemfactory.cpp @@ -74,7 +74,7 @@ QGraphicsSystem *QGraphicsSystemFactory::create(const QString& key) if (system.isEmpty()) { system = QLatin1String("runtime"); } -#elif defined (QT_GRAPHICSSYSTEM_RASTER) && !defined(Q_WS_WIN) && !defined(Q_OS_SYMBIAN) || defined(Q_WS_X11) || (defined (Q_WS_MAC) && defined(QT_MAC_USE_COCOA)) +#elif defined (QT_GRAPHICSSYSTEM_RASTER) && !defined(Q_WS_WIN) && !defined(Q_OS_SYMBIAN) || defined(Q_WS_X11) if (system.isEmpty()) { system = QLatin1String("raster"); } diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 5a566d1..9bd9733 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -2737,7 +2737,7 @@ QRectF QPainter::clipBoundingRect() const } // Accumulate the bounding box in device space. This is not 100% - // precise, but it fits within the guarantee and it is resonably + // precise, but it fits within the guarantee and it is reasonably // fast. QRectF bounds; for (int i=0; i<d->state->clipInfo.size(); ++i) { @@ -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 |