summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-05-17 18:00:03 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-05-17 18:00:03 (GMT)
commit91a1f7a1c408052b1d284d6b901819964e338fe5 (patch)
treedf7103f0ea0cb9d98f4b641d72c0f8b0ebdf2498 /src/gui/painting
parent94a3356d5eb7b255d439efe2699bf3a9b025e8eb (diff)
parent509ef11ab4ba6165c16d9d311c4a1bf7cdfd2528 (diff)
downloadQt-91a1f7a1c408052b1d284d6b901819964e338fe5.zip
Qt-91a1f7a1c408052b1d284d6b901819964e338fe5.tar.gz
Qt-91a1f7a1c408052b1d284d6b901819964e338fe5.tar.bz2
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: demos/demos.pro mkspecs/features/resources.prf mkspecs/features/uic.prf src/corelib/io/qurl.cpp src/corelib/tools/qlocale_symbian.cpp src/gui/graphicsview/qgraphicsscene.cpp src/gui/graphicsview/qgraphicswidget_p.cpp src/gui/graphicsview/qgraphicswidget_p.h src/gui/util/qsystemtrayicon_win.cpp src/multimedia/audio/qaudioinput.cpp tests/auto/qhostinfo/qhostinfo.pro
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpainter.cpp9
-rw-r--r--src/gui/painting/qpdf.cpp9
2 files changed, 16 insertions, 2 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 898a996..596649e 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5977,12 +5977,17 @@ void QPainter::drawText(const QPointF &p, const QString &str, int tf, int justif
gf.glyphs = engine.shapedGlyphs(&si);
gf.chars = engine.layoutData->string.unicode() + si.position;
gf.num_chars = engine.length(item);
- gf.width = si.width;
+ if (engine.forceJustification) {
+ for (int j=0; j<gf.glyphs.numGlyphs; ++j)
+ gf.width += gf.glyphs.effectiveAdvance(j);
+ } else {
+ gf.width = si.width;
+ }
gf.logClusters = engine.logClusters(&si);
drawTextItem(QPointF(x.toReal(), p.y()), gf);
- x += si.width;
+ x += gf.width;
}
}
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 44049c0..6e02435 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -971,12 +971,17 @@ void QPdfBaseEngine::drawPoints (const QPointF *points, int pointCount)
if (!points)
return;
+ Q_D(QPdfBaseEngine);
QPainterPath p;
for (int i=0; i!=pointCount;++i) {
p.moveTo(points[i]);
p.lineTo(points[i] + QPointF(0, 0.001));
}
+
+ bool hadBrush = d->hasBrush;
+ d->hasBrush = false;
drawPath(p);
+ d->hasBrush = hadBrush;
}
void QPdfBaseEngine::drawLines (const QLineF *lines, int lineCount)
@@ -984,12 +989,16 @@ void QPdfBaseEngine::drawLines (const QLineF *lines, int lineCount)
if (!lines)
return;
+ Q_D(QPdfBaseEngine);
QPainterPath p;
for (int i=0; i!=lineCount;++i) {
p.moveTo(lines[i].p1());
p.lineTo(lines[i].p2());
}
+ bool hadBrush = d->hasBrush;
+ d->hasBrush = false;
drawPath(p);
+ d->hasBrush = hadBrush;
}
void QPdfBaseEngine::drawRects (const QRectF *rects, int rectCount)