diff options
author | David Faure <faure@kde.org> | 2009-11-06 11:59:35 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-11-06 12:01:06 (GMT) |
commit | 9b500e9a09907f05002bd0e57869c5312ae101db (patch) | |
tree | 3ac295059349513975c72ce834906992a4afabba /src | |
parent | 971c9c84a9cff8370e72fe120867be540e0aca8b (diff) | |
download | Qt-9b500e9a09907f05002bd0e57869c5312ae101db.zip Qt-9b500e9a09907f05002bd0e57869c5312ae101db.tar.gz Qt-9b500e9a09907f05002bd0e57869c5312ae101db.tar.bz2 |
Fix QPainter::setPen(pen with color but no style) on non-extended.
It was working with a QImage but not with a QPixmap, which is obviously
a bug. In addition, it broke WebCore::GraphicsContext::setPlatformStrokeColor
which does exactly what I put in the unittest: get pen, set color, set pen.
This commit fixes the wrong color in the underline of the links in
http://www.davidfaure.fr/kde/link_underline_color.html in QtWebkit.
Merge-request: 1995
Reviewed-by: Samuel Rødal <sroedal@trolltech.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/painting/qpainter.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 4c13d3e..48629d1 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -3787,27 +3787,14 @@ void QPainter::setPen(const QPen &pen) if (d->state->pen == pen) return; + d->state->pen = pen; + if (d->extended) { - d->state->pen = pen; d->checkEmulation(); d->extended->penChanged(); return; } - // Do some checks to see if we are the same pen. - Qt::PenStyle currentStyle = d->state->pen.style(); - if (currentStyle == pen.style() && currentStyle != Qt::CustomDashLine) { - if (currentStyle == Qt::NoPen || - (d->state->pen.isSolid() && pen.isSolid() - && d->state->pen.color() == pen.color() - && d->state->pen.widthF() == pen.widthF() - && d->state->pen.capStyle() == pen.capStyle() - && d->state->pen.joinStyle() == pen.joinStyle() - && d->state->pen.isCosmetic() == pen.isCosmetic())) - return; - } - - d->state->pen = pen; d->state->dirtyFlags |= QPaintEngine::DirtyPen; } |