summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-07-08 07:57:45 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2011-07-08 07:57:45 (GMT)
commit978e22d6529d7cbe9472749352d632eefd22cd07 (patch)
treeac92a4f489c0a93a48eb502457c679659e472ac0 /src/gui/painting
parentcb11bb0df08f134bbded52fd4140197a01570a0e (diff)
parent1dd26ea2486db87b61e8e9f70a1e04f7386405ef (diff)
downloadQt-978e22d6529d7cbe9472749352d632eefd22cd07.zip
Qt-978e22d6529d7cbe9472749352d632eefd22cd07.tar.gz
Qt-978e22d6529d7cbe9472749352d632eefd22cd07.tar.bz2
Merge remote branch 'mainline/4.8' into staging
Conflicts: dist/changes-4.8.0
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qgraphicssystemfactory.cpp2
-rw-r--r--src/gui/painting/qpainter.cpp16
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